From: Gleb Natapov <gleb@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH][RESEND] Don't register cpu reset handler for cpu with APIC.
Date: Thu, 18 Jun 2009 16:29:18 +0300 [thread overview]
Message-ID: <20090618132918.GF20289@redhat.com> (raw)
APIC reset handler already resets cpu, no need to reset it twice.
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 <gleb@redhat.com>
diff --git a/hw/pc.c b/hw/pc.c
index 160506f..db20501 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -962,12 +962,6 @@ static void load_linux(void *fw_cfg,
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 };
@@ -1095,9 +1089,11 @@ static void pc_init1(ram_addr_t ram_size,
}
if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
env->cpuid_apic_id = env->cpu_index;
+ /* APIC reset callback resets cpu */
apic_init(env);
+ } else {
+ qemu_register_reset((QEMUResetHandler*)cpu_reset, 0, env);
}
- qemu_register_reset(main_cpu_reset, 0, env);
}
vmport_init();
--
Gleb.
reply other threads:[~2009-06-18 13:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090618132918.GF20289@redhat.com \
--to=gleb@redhat.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.