bug-hurd
[Top][All Lists]
Advanced

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

Re: [PATCH gnumach] lapic timer: Calibrate based on 10 PIT sleeps for 10


From: Samuel Thibault
Subject: Re: [PATCH gnumach] lapic timer: Calibrate based on 10 PIT sleeps for 10ms
Date: Sun, 26 Feb 2023 11:09:07 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Damien Zammit, le dim. 26 févr. 2023 09:42:27 +0000, a ecrit:
> On 26/2/23 20:20, Samuel Thibault wrote:
> > Samuel Thibault, le dim. 26 févr. 2023 10:03:28 +0100, a ecrit:
> >> Damien Zammit, le dim. 26 févr. 2023 03:34:59 +0000, a ecrit:
> >>> On 26/2/23 12:31, Damien Zammit wrote:
> >>>> NB: This relies on a fix for QEMU as one-shot PIT mode
> >>>> is currently broken in qemu.
> >>>
> >>> Here is the corresponding qemu patch:
> >>>
> >>> https://lists.nongnu.org/archive/html/qemu-devel/2023-02/msg07549.html
> >>
> >> I'm afraid this means we should refrain from using this mode.
> >>
> >> Because this mode being buggy in qemu means that OSes don't usually use
> >> it, which means that virtualization tools most probably don't notice
> >> their bugs in this mode.
> >
> > (meaning: it'll be a perpetual burden, and people will criticize
> > the Hurd « it doesn't even run under <whatever yet other bugged
> > virtualization tool> »)
> 
> I don't know how else to calibrate the local apic timer. How should we do it?
> Intel cpus have varying bus clocks and they are all slightly different.
> The PIT provides a constant clock speed based on a crystal oscillator so
> is the simplest choice to calibrate any other timer.

Can we perhaps keep the PIT for the clock update, and use the LAPIC only
for periodic interrupt on APs? I.e. the sleep function would just wait
for a number of PIT periodic interrupts.

Also, doesn't the LAPIC frequency vary according to CPU frequency and
whatnot? We don't want to have to track that.

> Isn't that the beauty of free software, that bugs can be fixed?

Sure, but reality is that bugs creep in, and whenever you depend on them
being fixed everywhere, you are screwed.

> The PIT code works on native hardware and I have provided a patch to fix qemu.

And it will take months/years for it to come into production, and there
are also virtualbox and other virtualization tools.


Really, trust my experience on this: whenever we depart from what other
OSes use, we suffer a lot. We don't need that suffering.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]