Subject: Re: question about x86 spllower()
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Charles M. Hannum <abuse@spamalicious.com>
List: port-i386
Date: 12/16/2004 23:38:23
On Thursday 16 December 2004 23:31, Manuel Bouyer wrote:
> On Thu, Dec 16, 2004 at 11:25:57PM +0000, Charles M. Hannum wrote:
> > On Thursday 16 December 2004 23:08, Manuel Bouyer wrote:
> > > 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
> >
> > You really don't get how this works, do you?  CLI/STI are special
> > instructions to change the interrupt flag in the PSL without whacking the
> > whole register.
>
> Yes, that's why I didn't understant why we would want to save/restore the
> whole register in this case. I got it later: we do it this way, only
> because we don't know if interrupts are already disabled or not, and it
> they're already disabled we don't want to reenable them.

Yes, that would be the theory.  It's unclear to me why they'd ever be disabled 
at that point, though.  I don't think it makes sense.