qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] apic creation should not depend on pci
@ 2009-06-07 10:03 Gleb Natapov
  2009-06-07 11:01 ` [Qemu-devel] " Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Gleb Natapov @ 2009-06-07 10:03 UTC (permalink / raw)
  To: qemu-devel

Anybody knows why it currently does?

Signed-off-by: Gleb Natapov <gleb@redhat.com>
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();
--
			Gleb.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH] apic creation should not depend on pci
  2009-06-07 10:03 [Qemu-devel] [PATCH] apic creation should not depend on pci Gleb Natapov
@ 2009-06-07 11:01 ` Jan Kiszka
  2009-06-07 11:20   ` Gleb Natapov
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2009-06-07 11:01 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1264 bytes --]

Gleb Natapov wrote:
> Anybody knows why it currently does?
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> 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).

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.

Does this make some sense?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH] apic creation should not depend on pci
  2009-06-07 11:01 ` [Qemu-devel] " Jan Kiszka
@ 2009-06-07 11:20   ` Gleb Natapov
  0 siblings, 0 replies; 3+ messages in thread
From: Gleb Natapov @ 2009-06-07 11:20 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel

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 <gleb@redhat.com>
> > 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-07 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-07 10:03 [Qemu-devel] [PATCH] apic creation should not depend on pci Gleb Natapov
2009-06-07 11:01 ` [Qemu-devel] " Jan Kiszka
2009-06-07 11:20   ` Gleb Natapov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).