Port-xen archive

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

Re: proposal: stop using the xen_system_time timecounter in dom0



On Thu, Jun 20, 2024 at 01:53:34PM -0700, Greg A. Woods wrote:
> I would like to propose that we stop using the xen_system_time
> timecounter in NetBSD dom0, i.e. in XEN3_DOM0.

Why can't you just set kern.timecounter.hardware to something else
if xen_system_time isn't working for you ?

> 
> As I wrote recently in the ongoing "timekeeping regression?" thread,
> xen_system_time is really just a wrapper on using the CPU TSC as a
> timecounter.
> 
> However in dom0 the RDTSC instruction is _not_ emulated[1], and, as I've
> observed, having multiple vCPUs assigned to dom0, but not pinned, on a
> machine with unstable TSCs, makes xen_system_time unstable and this of
> course leads to timekeeping problems.
> 
> So, forcing the use of raw/un-emulated RDTSC on systems where it would
> not normally be used if the system were running on bare metal seems
> wrong.
> 
> Workarounds such as pinning dom0's vCPUs, or assigning only one vCPU,
> are just that, poor workarounds (and possibly not even 100% reliable).
> 
> If we stop registering xen_system_time in dom0s (and do register TSC)
> then the system will choose whatever timecounter is best for the
> available hardware (just as if it were running on bare hardware).
> 
> I think, if I'm not missing something else important, that this _could_
> also allow for significant simplification of the code in xen_clock.c.

The only dom0-specific code I see here is related to timepush and this
can't be removed

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index