qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 3/4] move halted state setting to inside of cpu_


From: Jan Kiszka
Subject: [Qemu-devel] Re: [PATCH 3/4] move halted state setting to inside of cpu_x86_init
Date: Wed, 06 May 2009 17:45:57 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Glauber Costa wrote:
> cpus other than the first one starting at the halted state
> is a safe assumption to anyone. Move it to where it belongs.
> 
> Signed-off-by: Glauber Costa <address@hidden>
> ---
>  hw/pc.c              |    2 --
>  target-i386/helper.c |    3 +++
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/pc.c b/hw/pc.c
> index b726c17..06d1fca 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -849,8 +849,6 @@ static void pc_init1(ram_addr_t ram_size, int 
> vga_ram_size,
>              fprintf(stderr, "Unable to find x86 CPU definition\n");
>              exit(1);
>          }
> -        if (i != 0)
> -            env->halted = 1;
>          if (pci_enabled) {
>              apic_init(env);
>          }
> diff --git a/target-i386/helper.c b/target-i386/helper.c
> index 2c11cd3..a0d0273 100644
> --- a/target-i386/helper.c
> +++ b/target-i386/helper.c
> @@ -1694,6 +1694,9 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
>          cpu_x86_close(env);
>          return NULL;
>      }
> +
> +    /* cpu 0 can run, others start at halted state */
> +    env->halted = !!env->cpu_index;
>      cpu_reset(env);
>      qemu_register_reset(main_cpu_reset, env);
>  

That looks good to me.

Jan


-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux




reply via email to

[Prev in Thread] Current Thread [Next in Thread]