lkml.org 
[lkml]   [2020]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] x86/Hyper-V: Fix hv sched clock function return wrong time unit
Date
Tianyu Lan <ltykernel@gmail.com> 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

\
 
 \ /
  Last update: 2020-03-25 15:29    [W:0.039 / U:10.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site