From: Igor Mammedov <imammedo@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH for-1.2] cpus: Register reset callback centrally
Date: Thu, 02 Aug 2012 14:36:50 +0200 [thread overview]
Message-ID: <501A7462.3030606@redhat.com> (raw)
In-Reply-To: <1343855634-8779-1-git-send-email-afaerber@suse.de>
I'm ok with this patch.
It's reduces ugly ifdefs in wonderful realize function. :)
Hence,
Reviewed-By: Igor Mammedov <imammedo@redhat.com>
On 08/01/2012 11:13 PM, Andreas Färber wrote:
> Despite repeated protest commit 65dee38052597b6285eb208125369f01b29ba6c1
> (target-i386: move cpu_reset and reset callback to cpu.c) moved
> registration of a reset callback from hw/pc.c to target-i386/cpu.c
> while all other CPU reset handlers were still registered from machines.
>
> Instead, improve the situation by registering the callback in
> qemu_init_vcpu(). Now new machines or CPUs no longer need to register
> their own callbacks, and we can revert the code in target-i386/cpu.c.
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> Cc: Anthony Liguori <anthony@codemonkey.ws>
> Cc: Igor Mammedov <imammedo@redhat.com>
> ---
> cpus.c | 8 ++++++++
> target-i386/cpu.c | 11 -----------
> 2 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index 756e624..f717a61 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -1020,6 +1020,13 @@ static void qemu_dummy_start_vcpu(CPUArchState *env)
> }
> }
>
> +static void cpu_machine_reset(void *opaque)
> +{
> + CPUState *cpu = opaque;
> +
> + cpu_reset(cpu);
> +}
> +
> void qemu_init_vcpu(void *_env)
> {
> CPUArchState *env = _env;
> @@ -1027,6 +1034,7 @@ void qemu_init_vcpu(void *_env)
> env->nr_cores = smp_cores;
> env->nr_threads = smp_threads;
> env->stopped = 1;
> + qemu_register_reset(cpu_machine_reset, ENV_GET_CPU(env));
> if (kvm_enabled()) {
> qemu_kvm_start_vcpu(env);
> } else if (tcg_enabled()) {
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 857b94e..a511de9 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1704,13 +1704,6 @@ bool cpu_is_bsp(X86CPU *cpu)
> {
> return cpu_get_apic_base(cpu->env.apic_state) & MSR_IA32_APICBASE_BSP;
> }
> -
> -/* TODO: remove me, when reset over QOM tree is implemented */
> -static void x86_cpu_machine_reset_cb(void *opaque)
> -{
> - X86CPU *cpu = opaque;
> - cpu_reset(CPU(cpu));
> -}
> #endif
>
> static void mce_init(X86CPU *cpu)
> @@ -1733,10 +1726,6 @@ void x86_cpu_realize(Object *obj, Error **errp)
> {
> X86CPU *cpu = X86_CPU(obj);
>
> -#ifndef CONFIG_USER_ONLY
> - qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
> -#endif
> -
> mce_init(cpu);
> qemu_init_vcpu(&cpu->env);
> cpu_reset(CPU(cpu));
>
prev parent reply other threads:[~2012-08-02 12:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-01 21:13 [Qemu-devel] [PATCH for-1.2] cpus: Register reset callback centrally Andreas Färber
2012-08-01 22:44 ` Andreas Färber
2012-08-02 12:44 ` Igor Mammedov
2012-08-02 12:36 ` Igor Mammedov [this message]
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=501A7462.3030606@redhat.com \
--to=imammedo@redhat.com \
--cc=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--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.