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:41:14
On Thu, Dec 16, 2004 at 11:38:23PM +0000, Charles M. Hannum wrote:
> 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.

I tried remplasing write_psl() with a enable_interrupts(), and the kernel
didn't even print the copyright line ... But it was in xen, so maybe there's
something else going on here

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