From: Gerd H. <kr...@re...> - 2008-05-16 07:47:44
|
Avi Kivity wrote: >> + struct timespec now,sys,boot; > > Add spaces. Done. >> +#if 0 >> + /* Hmm, getboottime() isn't exported to modules ... */ >> + getboottime(&boot); >> +#else >> + now = current_kernel_time(); >> + ktime_get_ts(&sys); >> + boot = ns_to_timespec(timespec_to_ns(&now) - timespec_to_ns(&sys)); >> +#endif >> + wc.wc_sec = boot.tv_sec; >> + wc.wc_nsec = boot.tv_nsec; > > Please drop the #if 0. Done, and added a comment for the calculation. >> +static uint32_t div_frac(uint32_t dividend, uint32_t divisor) >> +{ >> + uint32_t quotient, remainder; >> + >> + __asm__ ( "divl %4" >> + : "=a" (quotient), "=d" (remainder) >> + : "0" (0), "1" (dividend), "r" (divisor) ); >> + return quotient; >> +} >> > > do_div()? No, this one does something else. Already tried to get rid of that one before ;) > pr_debug() or something? Done. >> + kvm_set_time_scale(tsc_khz, &vcpu->arch.hv_clock); >> > What if the tsc frequency changes later on? we need to adjust the > multiplier, no? We better do that, yes. New patch series prepared and tested, will be posted in a moment ... cheers, Gerd -- http://kraxel.fedorapeople.org/xenner/ |