From owner-freebsd-amd64@FreeBSD.ORG Wed Jun 9 15:00:02 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11D2E16A4D0 for ; Wed, 9 Jun 2004 15:00:02 +0000 (GMT) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4F7943D1F for ; Wed, 9 Jun 2004 15:00:01 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 26577 invoked from network); 9 Jun 2004 15:00:01 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 9 Jun 2004 15:00:00 -0000 Received: from 10.50.41.233 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i59ExuIb018518; Wed, 9 Jun 2004 10:59:56 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-amd64@FreeBSD.org Date: Wed, 9 Jun 2004 11:00:47 -0400 User-Agent: KMail/1.6 References: <200406081617.29485@misha-mx.virtual-estates.net> <200406091025.03741.jhb@FreeBSD.org> <200406091036.23376@aldan> In-Reply-To: <200406091036.23376@aldan> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406091100.47621.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: freebsd-current@FreeBSD.org cc: anthony@x-anthony.com cc: Mikhail Teterin Subject: Re: continuing troubles with AMD64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2004 15:00:02 -0000 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 <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org