Received: from eggs.gnu.org ([208.118.235.92]:38457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ss1m6-0008I1-1N for qemu-devel@nongnu.org; Thu, 19 Jul 2012 21:12:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ss1m4-0005EF-Ux for qemu-devel@nongnu.org; Thu, 19 Jul 2012 21:12:57 -0400 Received: from mail-vc0-f173.google.com ([209.85.220.173]:37288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ss1m4-0005E9-Qc for qemu-devel@nongnu.org; Thu, 19 Jul 2012 21:12:56 -0400 Received: by vcbfl15 with SMTP id fl15so2571529vcb.4 for ; Thu, 19 Jul 2012 18:12:56 -0700 (PDT) Date: Thu, 19 Jul 2012 21:12:54 -0400 From: Kevin O'Connor Message-ID: <20120720011254.GD24578@morn.localdomain> References: <1342731162-14285-1-git-send-email-ehabkost@redhat.com> <1342731162-14285-3-git-send-email-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1342731162-14285-3-git-send-email-ehabkost@redhat.com> Subject: Re: [Qemu-devel] [SeaBIOS] [seabios PATCH 2/2] allow CPUs to have non-contiguous Local APIC IDs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: seabios@seabios.org, qemu-devel@nongnu.org On Thu, Jul 19, 2012 at 05:52:42PM -0300, Eduardo Habkost wrote: > Extract Local APIC IDs directly from the CPUs, and instead of check for > "i < CountCPUs", check if the APIC ID was present on boot, when building > ACPI tables and the MP-Table. > > This keeps ACPI Processor ID == APIC ID, but allows the > hardware<->Seabios interface be completely APIC-ID based, and Seabios > may change the way ACPI Processor IDs are chosen in the future. > > As we currently Seabios support only xAPIC and not x2APIC, the list of > present-on-boot APIC IDs is a 256-bit bitmap. If one day Seabios starts > to support x2APIC, the data structure used to enumerate the APIC IDs > will have to be changed. Is this SeaBIOS change dependent on a particular version of QEMU? [...] > --- a/src/smp.c > +++ b/src/smp.c > @@ -36,6 +36,8 @@ wrmsr_smp(u32 index, u64 val) > > u32 CountCPUs VAR16VISIBLE; > u32 MaxCountCPUs VAR16VISIBLE; > +// 256 bits for the found APIC IDs > +u32 FoundAPICIDs[256/32] VAR16VISIBLE; > extern void smp_ap_boot_code(void); > ASM16( > " .global smp_ap_boot_code\n" > @@ -59,6 +61,12 @@ ASM16( > " jmp 1b\n" > "2:\n" > > + // get apic ID on EBX, set bit on FoundAPICIDs > + " mov $1, %eax\n" > + " cpuid\n" > + " shrl $24, %ebx\n" > + " lock bts %ebx, FoundAPICIDs\n" Because of the insanity that is 16bit mode, please use explicit size suffixes on assembler instructions (ie, "movl" and "btsl"). -Kevin