Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jun 2004 15:44:16 -0400
From:      Don Bowman <don@sandvine.com>
To:        'Julian Elischer' <julian@elischer.org>, Don Bowman <don@sandvine.com>
Cc:        "'current@freebsd.org'" <current@freebsd.org>
Subject:   RE: STI, HLT in acpi_cpu_idle_c1
Message-ID:  <FE045D4D9F7AED4CBFF1B3B813C85337051D9010@mail.sandvine.com>

next in thread | raw e-mail | index | archive | help
From: Julian Elischer [mailto:julian@elischer.org]
> On Thu, 17 Jun 2004, Don Bowman wrote:
> 
> > 
> > in the intel instruction manual, the effect
> > of STI is that interrupts are enabled
> > *after* the next instruction.
> > 
> > ie:
> > 
> >  sti
> >  ret
> >  ...
> > 
> > the return is still run with interrupts disabled
> > (if they were prior to the STI).
> > 
> > In acpi_cpu_idle_c1, it does:
> > 
> >  sti
> >  hlt
> > 
> > shouldn't there be a NOP in there so that interrupts
> > are guaranteed on?
> 
> I think your reading of it is right..
> but I also think that if it was ALWAYS right we'd see processors
> go idle and never wake up again....
> Since this doesn't seem to happen, maybe ther eis a bug in 
> the emulator?

My theory is there are two code paths to get there,
1 with interrupts enabled, and one without. The 'STI'
seems to be there as a form of protection for
the 2nd case.

I'm adding the nop and restarting the test.

The emulator is correct, in the normal case it shows
interrupts enabled on entry to that function.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE045D4D9F7AED4CBFF1B3B813C85337051D9010>