Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2000 11:51:20 -0600 (CST)
From:      Mohit Aron <aron@cs.rice.edu>
To:        freebsd-current@freebsd.org
Subject:   patches for SMP
Message-ID:  <200001061751.LAA00157@cs.rice.edu>

next in thread | raw e-mail | index | archive | help
Hi,
	I am using the FreeBSD-4.0 snapshot from 3rd January 2000. This version
used to panic when configured as an SMP but with less CPUs than there are 
actually in the machine (I had 4 processors but only wanted to use 1). Someone
mailed me patches for fixing this problem (attached below). If these haven't
been applied already, can someone please apply them so that the FreeBSD-4.0
release scheduled for January 15th has this bug removed.



- Mohit




Index: i386/mp_machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/mp_machdep.c,v
retrieving revision 1.112
diff -u -r1.112 mp_machdep.c
--- i386/mp_machdep.c	1999/11/27 12:32:20	1.112
+++ i386/mp_machdep.c	2000/01/05 08:28:40
@@ -1097,7 +1097,7 @@
 processor_entry(proc_entry_ptr entry, int cpu)
 {
 	/* check for usability */
-	if ((cpu >= NCPU) || !(entry->cpu_flags & PROCENTRY_FLAG_EN))
+	if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
 		return 0;
 
 	/* check for BSP flag */
@@ -1109,11 +1109,13 @@
 	}
 
 	/* add another AP to list, if less than max number of CPUs */
-	else {
+	else if (cpu < NCPU) {
 		CPU_TO_ID(cpu) = entry->apic_id;
 		ID_TO_CPU(entry->apic_id) = cpu;
 		return 1;
 	}
+
+	return 0;
 }
 
 
Index: include/mpapic.h
===================================================================
RCS file: /home/ncvs/src/sys/i386/include/mpapic.h,v
retrieving revision 1.12
diff -u -r1.12 mpapic.h
--- include/mpapic.h	1999/08/28 00:44:19	1.12
+++ include/mpapic.h	2000/01/05 08:24:58
@@ -98,6 +98,8 @@
 static __inline int
 all_but_self_ipi(int vector)
 {
+	if (mp_ncpus <= 1)
+		return 0;
 	return apic_ipi(APIC_DEST_ALLESELF, vector, APIC_DELMODE_FIXED);
 }


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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