continuing troubles with AMD64

John Baldwin jhb at FreeBSD.org
Wed Jun 9 15:00:02 GMT 2004


On Wednesday 09 June 2004 10:36 am, Mikhail Teterin wrote:
> On Wednesday 09 June 2004 10:25 am, John Baldwin wrote:
> = On Tuesday 08 June 2004 04:17 pm, Mikhail Teterin wrote:
> = > The good part: the Mar 1st -current kernel works fine.
> = >
> = > The bad:
> = > 	1) Any newer kernels don't see the system drive, presumably,
> = > 	abecause ttempts to allocate IRQs for the all of the
> = > 	aata-controllers fail.
> = >
> = > 	2) Yesterday's kernel panics with:
> = >
> = > 		madt_probe_cpus_handler: CPU ID 129 too high
> = >
> = > 	Indeed, 129 is greater than NLAPICS, which is 32, but the
> = > 	Mar 1st kernel works.
> =
> = 129 is not a valid local APIC ID. (x86 only supports APIC IDs from 0
> = to 15).
>
> Perhaps, it still should not panic, but act as if APIC was not available
> at all?

Ah, the CPU is disabled.  Guess I should just ignore disabled CPUs altogether 
then.

Here's a patch to the i386 version of madt.c but it should apply to the amd64 
version as well:

--- //depot/vendor/freebsd/src/sys/i386/acpica/madt.c	2004/06/01 19:50:45
+++ //depot/user/jhb/acpipci/i386/acpica/madt.c	2004/06/09 14:58:09
@@ -65,7 +65,6 @@
 } ioapics[NIOAPICS];
 
 struct lapic_info {
-	u_int la_present:1;
 	u_int la_enabled:1;
 	u_int la_acpi_id:8;
 } lapics[NLAPICS];
@@ -446,18 +445,17 @@
 			printf("MADT: Found CPU APIC ID %d ACPI ID %d: %s\n",
 			    proc->LocalApicId, proc->ProcessorId,
 			    proc->ProcessorEnabled ? "enabled" : "disabled");
+		if (!proc->ProcessorEnabled)
+			break;
 		if (proc->LocalApicId >= NLAPICS)
 			panic("%s: CPU ID %d too high", __func__,
 			    proc->LocalApicId);
 		la = &lapics[proc->LocalApicId];
-		KASSERT(la->la_present == 0,
+		KASSERT(la->la_enabled == 0,
 		    ("Duplicate local APIC ID %d", proc->LocalApicId));
-		la->la_present = 1;
+		la->la_enabled = 1;
 		la->la_acpi_id = proc->ProcessorId;
-		if (proc->ProcessorEnabled) {
-			la->la_enabled = 1;
-			lapic_create(proc->LocalApicId, 0);
-		}
+		lapic_create(proc->LocalApicId, 0);
 		break;
 	}
 }
@@ -547,15 +545,12 @@
 	int i;
 
 	for (i = 0; i < NLAPICS; i++) {
-		if (!lapics[i].la_present)
+		if (!lapics[i].la_enabled)
 			continue;
 		if (lapics[i].la_acpi_id != acpi_id)
 			continue;
 		*apic_id = i;
-		if (lapics[i].la_enabled)
-			return (0);
-		else
-			return (ENXIO);
+		return (0);
 	}
 	return (ENOENT);
 }
@@ -769,7 +764,7 @@
 		pc = pcpu_find(i);
 		KASSERT(pc != NULL, ("no pcpu data for CPU %d", i));
 		la = &lapics[pc->pc_apic_id];
-		if (!la->la_present || !la->la_enabled)
+		if (!la->la_enabled)
 			panic("APIC: CPU with APIC ID %u is not enabled",
 			    pc->pc_apic_id);
 		pc->pc_acpi_id = la->la_acpi_id;

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-amd64 mailing list