From owner-freebsd-amd64@FreeBSD.ORG Mon Feb 11 20:46:41 2008 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1AC316A468 for ; Mon, 11 Feb 2008 20:46:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 476DD13C474 for ; Mon, 11 Feb 2008 20:46:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 231612679-1834499 for multiple; Mon, 11 Feb 2008 15:46:31 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m1BKk4In052106; Mon, 11 Feb 2008 15:46:07 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-amd64@freebsd.org, FUCHIGAMI Masachika Date: Mon, 11 Feb 2008 15:21:45 -0500 User-Agent: KMail/1.9.7 References: <200802100710.m1A7A2tI074762@freefall.freebsd.org> In-Reply-To: <200802100710.m1A7A2tI074762@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802111521.45864.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 11 Feb 2008 15:46:07 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5778/Mon Feb 11 13:53:43 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00, UPPERCASE_25_50 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Subject: Re: amd64/120202: [panic] kernel panic at start_all_aps, AP not starts X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2008 20:46:41 -0000 On Sunday 10 February 2008 02:10:02 am FUCHIGAMI Masachika wrote: > The following reply was made to PR amd64/120202; it has been noted by GNATS. > > From: masatic@mbs.sphere.ne.jp (FUCHIGAMI Masachika) > To: bug-followup@FreeBSD.org > Cc: > Subject: Re: amd64/120202: [panic] kernel panic at start_all_aps, AP not starts > Date: Sun, 10 Feb 2008 16:04:04 +0900 > > I found following patch works well. > IMHO, AP does not accept SIPI because the core shutdowns or send SIPI to itself in BIOS bootup code. > So, i modify the code to send SIPI before AP closes its ears. > > -- > *** mp_machdep.c.orig Mon Oct 8 21:51:01 2007 > --- mp_machdep.c Fri Feb 8 22:34:41 2008 > *************** > *** 788,796 **** > --- 788,798 ---- > lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | > APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, 0); > > /* wait for pending status end */ > + #if 0 > DELAY(10000); /* wait ~10mS */ > + #endif > lapic_ipi_wait(-1); > > /* > * next we do a STARTUP IPI: the previous INIT IPI might still be Removing the wait seems very odd, the pending status should still be there even if we wait. However, this particular IPI is only for older CPUs anyway. Try this patch instead perhaps: Index: amd64/amd64/mp_machdep.c =================================================================== RCS file: /usr/cvs/src/sys/amd64/amd64/mp_machdep.c,v retrieving revision 1.287 diff -u -r1.287 mp_machdep.c --- amd64/amd64/mp_machdep.c 2 Aug 2007 21:17:58 -0000 1.287 +++ amd64/amd64/mp_machdep.c 24 Sep 2007 15:09:43 -0000 @@ -783,13 +783,20 @@ /* wait for pending status end */ lapic_ipi_wait(-1); - /* do an INIT IPI: deassert RESET */ - lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | - APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, 0); - - /* wait for pending status end */ - DELAY(10000); /* wait ~10mS */ - lapic_ipi_wait(-1); + /* + * do an INIT IPI: deassert RESET on older systems to reset APIC ID + * arbitration. XXX: Should we only do this once? + */ + if (strcmp(cpu_vendor, "GenuineIntel") != 0 || + (cpu_id & 0xf00) != 0xf00) { + lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, + 0); + + /* wait for pending status end */ + DELAY(10000); /* wait ~10mS */ + lapic_ipi_wait(-1); + } /* * next we do a STARTUP IPI: the previous INIT IPI might still be Index: i386/i386/mp_machdep.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/mp_machdep.c,v retrieving revision 1.282 diff -u -r1.282 mp_machdep.c --- i386/i386/mp_machdep.c 13 Nov 2007 23:00:24 -0000 1.282 +++ i386/i386/mp_machdep.c 26 Nov 2007 19:09:12 -0000 @@ -907,13 +907,20 @@ /* wait for pending status end */ lapic_ipi_wait(-1); - /* do an INIT IPI: deassert RESET */ - lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | - APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, 0); - - /* wait for pending status end */ - DELAY(10000); /* wait ~10mS */ - lapic_ipi_wait(-1); + /* + * do an INIT IPI: deassert RESET on older systems to reset APIC ID + * arbitration. XXX: Should we only do this once? + */ + if (strcmp(cpu_vendor, "GenuineIntel") != 0 || + (cpu_id & 0xf00) != 0xf00) { + lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, + 0); + + /* wait for pending status end */ + DELAY(10000); /* wait ~10mS */ + lapic_ipi_wait(-1); + } /* * next we do a STARTUP IPI: the previous INIT IPI might still be -- John Baldwin