Re: [kvm-devel] [PATCH 3/4] kvm/host: fix paravirt clocksource to be compatible with xen.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux