From owner-freebsd-hackers Wed Jan 5 0:36: 2 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id F007914BD8 for ; Wed, 5 Jan 2000 00:35:54 -0800 (PST) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id DAA26364; Wed, 5 Jan 2000 03:35:48 -0500 (EST) (envelope-from luoqi) Date: Wed, 5 Jan 2000 03:35:48 -0500 (EST) From: Luoqi Chen Message-Id: <200001050835.DAA26364@lor.watermarkgroup.com> To: aron@cs.rice.edu, freebsd-hackers@FreeBSD.ORG Subject: Re: FreeBSD-4.0 on SMP Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Hi, > I have a 4-processor machine but I want to configure FreeBSD-4.0 > to only use 1 of the processors for some tests. In addition I want the > local APIC to be enabled. It seems currently that the APIC is only enabled > when the kernel is compiled with the SMP option. However, when I specify > NCPU to be 1, the kernel panics. So the question is - is there a way to > just use one processor and still keep the APIC enabled ? > > > > - Mohit > Try again with the following patch, 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); } -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message