Subject: Re: question about x86 spllower()
To: Charles M. Hannum <abuse@spamalicious.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-i386
Date: 12/17/2004 00:08:37
On Thu, Dec 16, 2004 at 10:55:58PM +0000, Charles M. Hannum wrote:
> On Thursday 16 December 2004 22:51, Manuel Bouyer wrote:
> > OK, thanks. Well, this won't work for xen, where disabling/enabling
> > interrupts is done by writing a memory shared with the hyperviror.
> > Does read_psl()/write_psl() do something else than just cli/sti here ?
> > Could this be changed to cli()/sti() (which are macro doing the right
> > thing on port-xen) ?
>
> It seems clear that the intent was to restore the old value of the interrupt
> flag. I have no idea why it was done this way -- the old code (written by
> me) didn't do that; it used cli/sti in Xspllower() for all the
> synchronization it needed, and interrupts were *always* enabled on entry.
From the commit message, this was to avoid deadlock issues on IPIs.
I can't see why what could change in the interrupt flag here between
the read_psl() and write_psl(), disable_intr() only does a cli().
And if Xspllower() is called, we won't restore the interrupt flags we saved ...
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--