qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v6 2/2] target-ppc: spapr: e500: fix to use cpu_


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v6 2/2] target-ppc: spapr: e500: fix to use cpu_dt_id
Date: Sat, 01 Feb 2014 09:06:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Am 01.02.2014 01:24, schrieb Alexey Kardashevskiy:
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index 1cb276d..4e0a70e 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -131,7 +131,7 @@ static void rtas_query_cpu_stopped_state(PowerPCCPU *cpu_,
>                                           uint32_t nret, target_ulong rets)
>  {
>      target_ulong id;
> -    CPUState *cpu;
> +    PowerPCCPU *cpu;
>  
>      if (nargs != 1 || nret != 2) {
>          rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR);
> @@ -139,9 +139,9 @@ static void rtas_query_cpu_stopped_state(PowerPCCPU *cpu_,
>      }
>  
>      id = rtas_ld(args, 0);
> -    cpu = qemu_get_cpu(id);
> +    cpu = ppc_get_vcpu_by_dt_id(id);
>      if (cpu != NULL) {
> -        if (cpu->halted) {
> +        if (cpu->parent_obj.halted) {

Sorry for not noticing this earlier, but the purpose of "parent_obj" is
to make it a checkpatch error at some point - it should not be accessed
by regular code. Use CPU(cpu) to access the parent's fields, and to
avoid CPU(cpu)->halted, use a local variable please.

>              rtas_st(rets, 1, 0);
>          } else {
>              rtas_st(rets, 1, 2);
[snip]

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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