From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/2] Don't register cpu reset handler for cpu with APIC.
Date: Tue, 09 Jun 2009 12:21:09 +0200 [thread overview]
Message-ID: <4A2E3795.6020404@siemens.com> (raw)
In-Reply-To: <1244538657-7878-2-git-send-email-gleb@redhat.com>
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 <gleb@redhat.com>
> ---
> 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.
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2009-06-09 10:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 9:10 [Qemu-devel] [PATCH 1/2] Apic creation should not depend on pci Gleb Natapov
2009-06-09 9:10 ` [Qemu-devel] [PATCH 2/2] Don't register cpu reset handler for cpu with APIC Gleb Natapov
2009-06-09 10:21 ` Jan Kiszka [this message]
2009-06-09 10:41 ` [Qemu-devel] " Gleb Natapov
2009-06-09 21:56 ` Jan Kiszka
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=4A2E3795.6020404@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).