From owner-freebsd-current Thu Jan 6 9:51:27 2000 Delivered-To: freebsd-current@freebsd.org Received: from cs.rice.edu (cs.rice.edu [128.42.1.30]) by hub.freebsd.org (Postfix) with ESMTP id 2F529156BB for ; Thu, 6 Jan 2000 09:51:23 -0800 (PST) (envelope-from aron@cs.rice.edu) Received: (from aron@localhost) by cs.rice.edu (8.9.0/8.9.0) id LAA00157 for freebsd-current@freebsd.org; Thu, 6 Jan 2000 11:51:21 -0600 (CST) From: Mohit Aron Message-Id: <200001061751.LAA00157@cs.rice.edu> Subject: patches for SMP To: freebsd-current@freebsd.org Date: Thu, 6 Jan 2000 11:51:20 -0600 (CST) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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