Re: STI, HLT in acpi_cpu_idle_c1

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 29 Jun 2004 11:52:22 -0400
On Monday 28 June 2004 09:53 am, Gerrit Nagelhout wrote:
> John Baldwin wrote:
> > Hmm, it appears it is consistently CPU1 that thinks that
> > IPI_HARDCLOCK is not
> > being EOI'd.  Can you try swapping the CPUs and see if the
> > lockup moves from
> > CPU1 to CPU3?
> >
> > --
>
> I added the following *HACK* to the idle code, and let it run
> over the weekend (with halt on idle disabled).  It hit the function
> isr_problem 9 times, but did not lockup anymore.  The problem
> is that I don't know if the EOI just got lost, or whether the
> interrupt was not handled at all.  I couldn't find any ill effects
> from this code ... yet.

As per an errata that Brian pointed out, try using this patch perhaps.  You 
can leave your isr_problem one in and hopefully the counter will stay at zero 
if it works.  It adds some dummy reads of the local APIC to EOI's for IPIs.

Index: apic_vector.s
===================================================================
RCS file: /usr/cvs/src/sys/i386/i386/apic_vector.s,v
retrieving revision 1.101
diff -u -r1.101 apic_vector.s
--- apic_vector.s	26 May 2004 07:43:41 -0000	1.101
+++ apic_vector.s	29 Jun 2004 15:48:29 -0000
_at__at_ -141,6 +141,7 _at__at_
 
 	movl	lapic, %eax
 	movl	$0, LA_EOI(%eax)	/* End Of Interrupt to APIC */
+	movl	LA_EOI(%eax),%eax
 
 	lock
 	incl	smp_tlb_wait
_at__at_ -174,6 +175,7 _at__at_
 
 	movl	lapic, %eax
 	movl	$0, LA_EOI(%eax)	/* End Of Interrupt to APIC */
+	movl	LA_EOI(%eax),%eax
 
 	lock
 	incl	smp_tlb_wait
_at__at_ -212,6 +214,7 _at__at_
 
 	movl	lapic, %eax
 	movl	$0, LA_EOI(%eax)	/* End Of Interrupt to APIC */
+	movl	LA_EOI(%eax),%edx
 
 	lock
 	incl	smp_tlb_wait
_at__at_ -237,6 +240,7 _at__at_
 
 	movl	lapic, %edx
 	movl	$0, LA_EOI(%edx)	/* End Of Interrupt to APIC */
+	movl	LA_EOI(%edx),%eax
 
 	pushl	$0		/* XXX convert trapframe to clockframe */
 	call	forwarded_hardclock
_at__at_ -260,6 +264,7 _at__at_
 
 	movl	lapic, %edx
 	movl	$0, LA_EOI(%edx)	/* End Of Interrupt to APIC */
+	movl	LA_EOI(%edx),%eax
 
 	FAKE_MCOUNT(TF_EIP(%esp))
 
_at__at_ -322,6 +327,7 _at__at_
 
 	movl	lapic, %eax
 	movl	$0, LA_EOI(%eax)	/* End Of Interrupt to APIC */
+	movl	LA_EOI(%eax),%edx
 
 	movl	PCPU(CPUID), %eax
 	imull	$PCB_SIZE, %eax
_at__at_ -382,6 +388,7 _at__at_
 
 	movl	lapic, %eax
 	movl	$0, LA_EOI(%eax)	/* End Of Interrupt to APIC */
+	movl	LA_EOI(%eax),%edx
 	POP_FRAME
 	iret
 	
_at__at_ -402,6 +409,7 _at__at_
 
 	movl	lapic, %eax	
 	movl	$0, LA_EOI(%eax)	/* End Of Interrupt to APIC */
+	movl	LA_EOI(%eax),%edx
 	POP_FRAME
 	iret
 #endif /* SMP */


-- 
John Baldwin <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Tue Jun 29 2004 - 14:08:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:59 UTC