qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 6/6] target-ppc: demonstrate new "vsx" proper


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v3 6/6] target-ppc: demonstrate new "vsx" property
Date: Mon, 11 Nov 2013 14:31:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

Am 11.11.2013 08:44, schrieb Alexey Kardashevskiy:
> This patch is to demonstrate a static property handling in PowerPC.
> Running QEMU with -cpu host,-vsx disables VSX bit in
> PowerPCCPU::env::flags.
> 
> Signed-off-by: Alexey Kardashevskiy <address@hidden>
> ---
>  target-ppc/translate_init.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index df0d81c..60ea235 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -29,6 +29,7 @@
>  #include "mmu-hash64.h"
>  #include "qemu/error-report.h"
>  #include "qapi/visitor.h"
> +#include "hw/qdev-properties.h"
>  
>  //#define PPC_DUMP_CPU
>  //#define PPC_DEBUG_SPR
> @@ -8740,6 +8741,12 @@ static void ppc_cpu_class_init(ObjectClass *oc, void 
> *data)
>  
>      dc->fw_name = "PowerPC,UNKNOWN";
>      cc->parse_options = cpu_default_parse_options_func;
> +
> +    static Property powerpc_properties[] = {
> +        DEFINE_PROP_BIT("vsx", PowerPCCPU, env.flags, 
> BITNR(POWERPC_FLAG_VSX), false),
> +        DEFINE_PROP_END_OF_LIST(),
> +    };
> +    dc->props = powerpc_properties;
>  }
>  
>  static const TypeInfo ppc_cpu_type_info = {

This type of static property looks good to me, but two problems apart
from the BITNR() discussed elsewhere:

1) Won't the default value of false always disable VSX for all models
including POWER7 and higher?

2) Please move the array out of the function to just before the
containing function.

Igor has been facing a similar issue in his refactoring of x86 models
and I believe evaluated to define the properties per model so that they
have different defaults. Another way is overwriting that default in the
model's instance_init or via globals specific to the subtype.

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]