From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDGQy-00048m-6s for qemu-devel@nongnu.org; Sun, 07 Jun 2009 07:21:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDGQt-00042i-0e for qemu-devel@nongnu.org; Sun, 07 Jun 2009 07:21:03 -0400 Received: from [199.232.76.173] (port=43253 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDGQs-00042a-Sy for qemu-devel@nongnu.org; Sun, 07 Jun 2009 07:20:58 -0400 Received: from mx2.redhat.com ([66.187.237.31]:55948) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDGQs-0005vK-EL for qemu-devel@nongnu.org; Sun, 07 Jun 2009 07:20:58 -0400 Date: Sun, 7 Jun 2009 14:20:54 +0300 From: Gleb Natapov Message-ID: <20090607112054.GC29048@redhat.com> References: <20090607100346.GB29048@redhat.com> <4A2B9E22.8000109@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A2B9E22.8000109@web.de> Subject: [Qemu-devel] Re: [PATCH] apic creation should not depend on pci List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org On Sun, Jun 07, 2009 at 01:01:54PM +0200, Jan Kiszka wrote: > Gleb Natapov wrote: > > Anybody knows why it currently does? > > > > Signed-off-by: Gleb Natapov > > diff --git a/hw/pc.c b/hw/pc.c > > index 0934778..15c3efe 100644 > > --- a/hw/pc.c > > +++ b/hw/pc.c > > @@ -881,11 +881,9 @@ static void pc_init1(ram_addr_t ram_size, > > if (smp_cpus > 1) { > > /* XXX: enable it in all cases */ > > env->cpuid_features |= CPUID_APIC; > > - } > > - qemu_register_reset(main_cpu_reset, 0, env); > > - if (pci_enabled) { > > apic_init(env); > > } > > + qemu_register_reset(main_cpu_reset, 0, env); > > } > > > > vmport_init(); > > !pci_enabled means isapc, and that was probably once defined as "shall > have no external APIC". > > But I wonder if we should change this test into "(env->cpuid_features & > CPUID_APIC) || smp_cpus > 1", ie. also include isapc with LAPIC CPU > (probably a synthetic case, but a selectable one) and non-LAPIC CPU with > external APIC (for SMP). > Using (env->cpuid_features & CPUID_APIC) is definitely more correct that what is there now. > I also wonder if that explicit setting of CPUID_APIC for smp_cpus > 1 is > correct. Either the selected CPU type has one, then it's set via > PPRO_FEATURES, or not - then it could still exist externally for SMP, > see above. How software detects presence of apic on 486 smp boards? MPtable? > > Does this make some sense? > Yes (for me at least). -- Gleb.