[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 2/2] Don't register cpu reset handler for cpu wi
From: |
Gleb Natapov |
Subject: |
[Qemu-devel] Re: [PATCH 2/2] Don't register cpu reset handler for cpu with APIC. |
Date: |
Tue, 9 Jun 2009 13:41:33 +0300 |
On Tue, Jun 09, 2009 at 12:21:09PM +0200, Jan Kiszka wrote:
> Gleb Natapov wrote:
> > APIC reset handler already resets cpu. Also register cpu_reset handler
> > directly to make it impossible to add additional code to main_cpu_reset()
> > by mistake.
> >
> > Signed-off-by: Gleb Natapov <address@hidden>
> > ---
> > hw/pc.c | 10 +++-------
> > 1 files changed, 3 insertions(+), 7 deletions(-)
> >
> > diff --git a/hw/pc.c b/hw/pc.c
> > index d5b4112..5e7b115 100644
> > --- a/hw/pc.c
> > +++ b/hw/pc.c
> > @@ -751,12 +751,6 @@ static void load_linux(target_phys_addr_t option_rom,
> > generate_bootsect(option_rom, gpr, seg, 0);
> > }
> >
> > -static void main_cpu_reset(void *opaque)
> > -{
> > - CPUState *env = opaque;
> > - cpu_reset(env);
> > -}
> > -
> > static const int ide_iobase[2] = { 0x1f0, 0x170 };
> > static const int ide_iobase2[2] = { 0x3f6, 0x376 };
> > static const int ide_irq[2] = { 14, 15 };
> > @@ -878,9 +872,11 @@ static void pc_init1(ram_addr_t ram_size,
> > }
> > if (i != 0)
> > env->halted = 1;
> > - qemu_register_reset(main_cpu_reset, 0, env);
> > if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
> > apic_init(env);
> > + } else {
> > + /* APIC reset callback resets cpu */
>
> That comment should rather go into the previous block (and please remove
> the tab).
>
> > + qemu_register_reset((QEMUResetHandler*)cpu_reset, 0, env);
> > }
> > }
> >
>
> Looks fine to me otherwise. Will give these patches a try later today.
>
Let me know when you tested it and if no additional fixes needed I'll resend
fixed version.
--
Gleb.