From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Blue Swirl <blauwirbel@gmail.com>
Subject: [Qemu-devel] [PATCH] x86: Clean up CPU reset
Date: Wed, 23 Jun 2010 08:20:54 +0200 [thread overview]
Message-ID: <4C21A7C6.1090504@web.de> (raw)
From: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/pc.c | 22 ++++------------------
1 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, int level)
}
}
-static void bsp_cpu_reset(void *opaque)
+static void pc_cpu_reset(void *opaque)
{
CPUState *env = opaque;
cpu_reset(env);
- env->halted = 0;
-}
-
-static void ap_cpu_reset(void *opaque)
-{
- CPUState *env = opaque;
-
- cpu_reset(env);
- env->halted = 1;
+ env->halted = !cpu_is_bsp(env);
}
static CPUState *pc_new_cpu(const char *cpu_model)
@@ -839,16 +831,10 @@ static CPUState *pc_new_cpu(const char *cpu_model)
}
if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
env->cpuid_apic_id = env->cpu_index;
- /* APIC reset callback resets cpu */
env->apic_state = apic_init(env, env->cpuid_apic_id);
}
- if (cpu_is_bsp(env)) {
- qemu_register_reset(bsp_cpu_reset, env);
- env->halted = 0;
- } else {
- qemu_register_reset(ap_cpu_reset, env);
- env->halted = 1;
- }
+ qemu_register_reset(pc_cpu_reset, env);
+ pc_cpu_reset(env);
return env;
}
--
1.6.0.2
next reply other threads:[~2010-06-23 6:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-23 6:20 Jan Kiszka [this message]
2010-06-27 20:23 ` [Qemu-devel] Re: [PATCH] x86: Clean up CPU reset Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C21A7C6.1090504@web.de \
--to=jan.kiszka@web.de \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.