Re: [PATCH v13 07/18] x86/xen/time: output xen sched_clock time from 0

From: Pavel Tatashin
Date: Tue Jul 17 2018 - 22:00:00 EST


> > +static u64 xen_sched_clock(void)
> > +{
> > + return xen_clocksource_read() - xen_sched_clock_offset;
> > +}
>
>
> Should other invocations of xen_clocksource_read() also be offset?
>

I do not believe so. Look in arch/x86/kernel/kvmclock.c
kvm_clock_get_cycles() is not normalized for instance. We need to
normalize kvm_sched_clock_read() and xen_sched_clock(), because it is
used by printk() as a sched_clock() prefix. So not to be confusing we
print time starting from 0, but the other instances where
xen_clocksource_read() is used do not need that.

Thank you,
Pavel