From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53537 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSyOn-0004e3-EH for qemu-devel@nongnu.org; Sun, 27 Jun 2010 16:24:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OSyOm-0003BS-Ct for qemu-devel@nongnu.org; Sun, 27 Jun 2010 16:24:17 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:64289) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSyOm-0003BK-8S for qemu-devel@nongnu.org; Sun, 27 Jun 2010 16:24:16 -0400 Received: by pwi8 with SMTP id 8so164557pwi.4 for ; Sun, 27 Jun 2010 13:24:15 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4C21A7C6.1090504@web.de> References: <4C21A7C6.1090504@web.de> From: Blue Swirl Date: Sun, 27 Jun 2010 20:23:55 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] x86: Clean up CPU reset List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel Thanks, applied. On Wed, Jun 23, 2010 at 6:20 AM, Jan Kiszka wrote: > From: Jan Kiszka > > Signed-off-by: Jan Kiszka > --- > =C2=A0hw/pc.c | =C2=A0 22 ++++------------------ > =C2=A01 files changed, 4 insertions(+), 18 deletions(-) > > diff --git a/hw/pc.c b/hw/pc.c > index 1848151..8b9e70a 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -812,20 +812,12 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, i= nt level) > =C2=A0 =C2=A0 } > =C2=A0} > > -static void bsp_cpu_reset(void *opaque) > +static void pc_cpu_reset(void *opaque) > =C2=A0{ > =C2=A0 =C2=A0 CPUState *env =3D opaque; > > =C2=A0 =C2=A0 cpu_reset(env); > - =C2=A0 =C2=A0env->halted =3D 0; > -} > - > -static void ap_cpu_reset(void *opaque) > -{ > - =C2=A0 =C2=A0CPUState *env =3D opaque; > - > - =C2=A0 =C2=A0cpu_reset(env); > - =C2=A0 =C2=A0env->halted =3D 1; > + =C2=A0 =C2=A0env->halted =3D !cpu_is_bsp(env); > =C2=A0} > > =C2=A0static CPUState *pc_new_cpu(const char *cpu_model) > @@ -839,16 +831,10 @@ static CPUState *pc_new_cpu(const char *cpu_model) > =C2=A0 =C2=A0 } > =C2=A0 =C2=A0 if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 env->cpuid_apic_id =3D env->cpu_index; > - =C2=A0 =C2=A0 =C2=A0 =C2=A0/* APIC reset callback resets cpu */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 env->apic_state =3D apic_init(env, env->cpuid= _apic_id); > =C2=A0 =C2=A0 } > - =C2=A0 =C2=A0if (cpu_is_bsp(env)) { > - =C2=A0 =C2=A0 =C2=A0 =C2=A0qemu_register_reset(bsp_cpu_reset, env); > - =C2=A0 =C2=A0 =C2=A0 =C2=A0env->halted =3D 0; > - =C2=A0 =C2=A0} else { > - =C2=A0 =C2=A0 =C2=A0 =C2=A0qemu_register_reset(ap_cpu_reset, env); > - =C2=A0 =C2=A0 =C2=A0 =C2=A0env->halted =3D 1; > - =C2=A0 =C2=A0} > + =C2=A0 =C2=A0qemu_register_reset(pc_cpu_reset, env); > + =C2=A0 =C2=A0pc_cpu_reset(env); > =C2=A0 =C2=A0 return env; > =C2=A0} > > -- > 1.6.0.2 >