panic on one cpu leaves others running...

Marcel Moolenaar marcel at xcllnt.net
Thu Apr 8 11:59:54 PDT 2004


On Thu, Apr 08, 2004 at 11:51:24AM -0400, Robert Watson wrote:
> 
> > > Presumably in large part because I'm in code that doesn't require Giant,
> > > so there are no lock conflicts.
> > 
> > I don't think that's the case. It think we're just not stopping the CPUs
> > or keep them stopped. 
> 
> I agree with that interpretation -- I was suggesting that the reason this
> problem might not be noticed is that a lot of our code paths require
> Giant, and it's only when you panic in code without Giant that 

Ah, ok. The thing that strikes me as odd, if not wrong, is that we
use PCPU(CPUID) to update the stopped_cpus mask, while we should be
using PCPU(CPUMASK) for that. See attached patch (untested).

Am I off-base here?

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel at xcllnt.net
-------------- next part --------------
Index: apic_vector.s
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/apic_vector.s,v
retrieving revision 1.97
diff -u -r1.97 apic_vector.s
--- apic_vector.s	3 Feb 2004 22:00:41 -0000	1.97
+++ apic_vector.s	8 Apr 2004 18:58:31 -0000
@@ -336,7 +336,7 @@
 	call	CNAME(savectx)		/* Save process context */
 	addl	$4, %esp
 		
-	movl	PCPU(CPUID), %eax
+	movl	PCPU(CPUMASK), %eax
 
 	lock
 	btsl	%eax, CNAME(stopped_cpus) /* stopped_cpus |= (1<<id) */
Index: genassym.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/genassym.c,v
retrieving revision 1.146
diff -u -r1.146 genassym.c
--- genassym.c	12 Nov 2003 18:14:34 -0000	1.146
+++ genassym.c	8 Apr 2004 18:58:19 -0000
@@ -200,6 +200,7 @@
 ASSYM(PC_TSS_GDT, offsetof(struct pcpu, pc_tss_gdt));
 ASSYM(PC_CURRENTLDT, offsetof(struct pcpu, pc_currentldt));
 ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
+ASSYM(PC_CPUMASK, offsetof(struct pcpu, pc_cpumask));
 ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap));
 
 #ifdef DEV_APIC


More information about the freebsd-current mailing list