Re: [PATCH] x86/Hyper-V: Fix hv sched clock function return wrong time unit

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

 



Tianyu Lan <ltykernel@xxxxxxxxx> writes:

>>> @@ -398,7 +399,8 @@ static u64 notrace read_hv_clock_msr_cs(struct clocksource *arg)
>>>   
>>>   static u64 read_hv_sched_clock_msr(void)
>>>   {
>>> -	return read_hv_clock_msr() - hv_sched_clock_offset;
>>> +	return (read_hv_clock_msr() - hv_sched_clock_offset)
>>> +		* (NSEC_PER_SEC / HV_CLOCK_HZ);
>>>   }
>> 
>> kvmclock seems to have the same (pre-patch) code ...
>
>
> kvm sched clock gets time from pvclock_clocksource_read() and
> the time unit is nanosecond. So there is such issue in KVM code.
>

Ah, true, kvmclock is always 1Ghz so it's reading 'naturally' converts
to ns.

-- 
Vitaly




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux