From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] target-i386: Initialize CPUState::halted in cpu_reset
Date: Tue, 26 Apr 2011 10:50:48 +0200 [thread overview]
Message-ID: <4DB68768.3050700@siemens.com> (raw)
Instead of having an extra reset function at machine level and special
code for processing INIT, move the initialization of halted into the
cpu reset handler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/pc.c | 12 ++----------
target-i386/helper.c | 5 ++++-
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 6939c04..8ef86db 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -913,14 +913,6 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level)
}
}
-static void pc_cpu_reset(void *opaque)
-{
- CPUState *env = opaque;
-
- cpu_reset(env);
- env->halted = !cpu_is_bsp(env);
-}
-
static CPUState *pc_new_cpu(const char *cpu_model)
{
CPUState *env;
@@ -934,8 +926,8 @@ static CPUState *pc_new_cpu(const char *cpu_model)
env->cpuid_apic_id = env->cpu_index;
env->apic_state = apic_init(env, env->cpuid_apic_id);
}
- qemu_register_reset(pc_cpu_reset, env);
- pc_cpu_reset(env);
+ qemu_register_reset((QEMUResetHandler *)cpu_reset, env);
+ cpu_reset(env);
return env;
}
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 89df997..56cca96 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -106,6 +106,10 @@ void cpu_reset(CPUX86State *env)
env->dr[7] = DR7_FIXED_1;
cpu_breakpoint_remove_all(env, BP_CPU);
cpu_watchpoint_remove_all(env, BP_CPU);
+
+#if !defined(CONFIG_USER_ONLY)
+ env->halted = !cpu_is_bsp(env);
+#endif
}
void cpu_x86_close(CPUX86State *env)
@@ -1282,7 +1286,6 @@ void do_cpu_init(CPUState *env)
env->interrupt_request = sipi;
env->pat = pat;
apic_init_reset(env->apic_state);
- env->halted = !cpu_is_bsp(env);
}
void do_cpu_sipi(CPUState *env)
next reply other threads:[~2011-04-26 8:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-26 8:50 Jan Kiszka [this message]
2011-04-26 18:00 ` [Qemu-devel] [PATCH] target-i386: Initialize CPUState::halted in cpu_reset Blue Swirl
2011-04-26 18:55 ` Jan Kiszka
2011-04-26 19:59 ` Blue Swirl
2011-04-27 7:11 ` Jan Kiszka
2011-04-27 17:17 ` Blue Swirl
2011-04-27 17:32 ` Jan Kiszka
2011-04-27 18:29 ` 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=4DB68768.3050700@siemens.com \
--to=jan.kiszka@siemens.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.