From owner-p4-projects@FreeBSD.ORG Sat Dec 6 16:30:02 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4C39516A4D1; Sat, 6 Dec 2003 16:30:02 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 267BA16A4CF for ; Sat, 6 Dec 2003 16:30:02 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1227343FDD for ; Sat, 6 Dec 2003 16:30:01 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hB70U0XJ079067 for ; Sat, 6 Dec 2003 16:30:00 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hB70U0HE079064 for perforce@freebsd.org; Sat, 6 Dec 2003 16:30:00 -0800 (PST) (envelope-from peter@freebsd.org) Date: Sat, 6 Dec 2003 16:30:00 -0800 (PST) Message-Id: <200312070030.hB70U0HE079064@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 43515 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Dec 2003 00:30:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=43515 Change 43515 by peter@peter_overcee on 2003/12/06 16:29:31 WHAT HAPPEN! SOMEONE SET UP US THE BOMB! Translation: revert jhb's i386 changes that I merged over. They depend on the quirk that cpu_mp_setmaxid sets mp_maxid to MAXCPU - 1; unconditionally. This is not the case here since we set it correctly because we have acpi from the start. Affected files ... .. //depot/projects/hammer/sys/amd64/acpica/madt.c#25 edit .. //depot/projects/hammer/sys/amd64/amd64/local_apic.c#28 edit .. //depot/projects/hammer/sys/amd64/amd64/mptable.c#19 edit Differences ... ==== //depot/projects/hammer/sys/amd64/acpica/madt.c#25 (text+ko) ==== @@ -351,7 +351,8 @@ apic_register_enumerator(&madt_enumerator); } -SYSINIT(madt_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, madt_register, NULL) +SYSINIT(madt_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, + madt_register, NULL) /* * Call the handler routine for each entry in the MADT table. @@ -643,7 +644,7 @@ if (madt == NULL) return; - for (i = 0; i <= mp_maxid; i++) { + for (i = 0; i < MAXCPU; i++) { if (CPU_ABSENT(i)) continue; pc = pcpu_find(i); ==== //depot/projects/hammer/sys/amd64/amd64/local_apic.c#28 (text+ko) ==== @@ -542,8 +542,9 @@ } /* - * Probe the APIC enumerators, enumerate CPUs, and initialize the - * local APIC. + * We have to look for CPU's very, very early because certain subsystems + * want to know how many CPU's we have extremely early on in the boot + * process. */ static void apic_init(void *dummy __unused) @@ -586,14 +587,26 @@ if (retval != 0) printf("%s: Failed to probe CPUs: returned %d\n", best_enum->apic_name, retval); +} +SYSINIT(apic_init, SI_SUB_TUNABLES - 1, SI_ORDER_SECOND, apic_init, NULL) - /* Third, initialize the local APIC. */ +/* + * Setup the local APIC. We have to do this prior to starting up the APs + * in the SMP case. + */ +static void +apic_setup_local(void *dummy __unused) +{ + int retval; + + if (best_enum == NULL) + return; retval = best_enum->apic_setup_local(); if (retval != 0) printf("%s: Failed to setup the local APIC: returned %d\n", best_enum->apic_name, retval); } -SYSINIT(apic_init, SI_SUB_CPU, SI_ORDER_FIRST, apic_init, NULL) +SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_FIRST, apic_setup_local, NULL) /* * Setup the I/O APICs. ==== //depot/projects/hammer/sys/amd64/amd64/mptable.c#19 (text+ko) ==== @@ -370,8 +370,8 @@ apic_register_enumerator(&mptable_enumerator); } -SYSINIT(mptable_register, SI_SUB_CPU - 1, SI_ORDER_FIRST, mptable_register, - NULL) +SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, + mptable_register, NULL) /* * Call the handler routine for each entry in the MP config table.