PERFORCE change 43515 for review

Peter Wemm peter at FreeBSD.org
Sat Dec 6 16:30:02 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=43515

Change 43515 by peter at 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.


More information about the p4-projects mailing list