Re: STI, HLT in acpi_cpu_idle_c1

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 9 Jul 2004 13:14:07 -0400
On Thursday 08 July 2004 08:41 pm, Gerrit Nagelhout wrote:
> John Baldwin wrote:
> > I think it does handle the interrupt, but that the EOI is
> > somehow lost or
> > ignored,or that somehow we don't send an EOI in some edge case.
>
> I switched the 2 CPUs on the system, and the problem did not
> track the CPU, so it is unlikely to be a hardware problem.
> I've been looking through the interrupt code, and one thing
> seems very suspicious, and I am hoping that someone can shed
> some light on it ... ie whether it's legal or not.
> In apic_vector.s, some of the interrupt handlers (hardclock,
> cpuast, and a few others) call doreti.  Under certain conditions,
> this can call ast().  The ast function can call PROC_LOCK,
> which is a sleep mutex.
> What would happen in this case?  How could the interrupt
> possibly block?  At this point, the interrupt handler has
> already called eoi, but not iret.  Would the processor except
> other interrupts, or get stuck?
> Thanks,

Once the EOI is sent to the APIC, the processor will except other interrupts.  
However, most of the interrupt code also runs with interrupts disabled.  The 
exception is in ast(), meaning that another interrupt can come in and nest 
during an ast(), but ast() is not called during nested returns, so it won't 
nest infinitely.  iret doesn't do any sort of EOI magic, all it does is popf 
followed by ret.  The popf usually enables interrupts when it restores the 
interrupt flag's state.  It might still be a hardware problem in the chipset, 
esp. since it always happens on a logical CPU.  The fact that no other boxes 
in the field besides the two identical boxes you have have demonstrated this 
problem makes me very suspicious with respect to the hardware.

-- 
John Baldwin <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Fri Jul 09 2004 - 15:12:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:01 UTC