qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <ajones@ventanamicro.com>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	alistair.francis@wdc.com,  bmeng@tinylab.org,
	liweiwei@iscas.ac.cn, zhiwei_liu@linux.alibaba.com,
	 palmer@rivosinc.com
Subject: Re: [PATCH RESEND v8 18/20] target/riscv: use isa_ext_update_enabled() in init_max_cpu_extensions()
Date: Thu, 31 Aug 2023 15:56:53 +0200	[thread overview]
Message-ID: <20230831-f38837e8878b942e5056299f@orel> (raw)
In-Reply-To: <20230824221440.484675-19-dbarboza@ventanamicro.com>

On Thu, Aug 24, 2023 at 07:14:38PM -0300, Daniel Henrique Barboza wrote:
> Before adding support to detect if an extension was user set we need to
> handle how we're enabling extensions in riscv_init_max_cpu_extensions().
> object_property_set_bool() calls the set() callback for the property,
> and we're going to use this callback to set the 'multi_ext_user_opts'
> hash.
> 
> This means that, as is today, all extensions we're setting for the 'max'
> CPU will be seen as user set in the future. Let's change set_bool() to
> isa_ext_update_enabled() that will just enable/disable the flag on a
> certain offset.
> 
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  target/riscv/cpu.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index adfe671bd4..ae8c35402f 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -2163,24 +2163,24 @@ static void riscv_init_max_cpu_extensions(Object *obj)
>      set_misa(env, env->misa_mxl, env->misa_ext | RVG | RVJ | RVV);
>  
>      for (prop = riscv_cpu_extensions; prop && prop->name; prop++) {
> -        object_property_set_bool(obj, prop->name, true, NULL);
> +        isa_ext_update_enabled(cpu, prop->offset, true);
>      }
>  
>      /* set vector version */
>      env->vext_ver = VEXT_VERSION_1_00_0;
>  
>      /* Zfinx is not compatible with F. Disable it */
> -    object_property_set_bool(obj, "zfinx", false, NULL);
> -    object_property_set_bool(obj, "zdinx", false, NULL);
> -    object_property_set_bool(obj, "zhinx", false, NULL);
> -    object_property_set_bool(obj, "zhinxmin", false, NULL);
> +    isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zfinx), false);
> +    isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zdinx), false);
> +    isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zhinx), false);
> +    isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zhinxmin), false);
>  
> -    object_property_set_bool(obj, "zce", false, NULL);
> -    object_property_set_bool(obj, "zcmp", false, NULL);
> -    object_property_set_bool(obj, "zcmt", false, NULL);
> +    isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zce), false);
> +    isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zcmp), false);
> +    isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zcmt), false);
>  
>      if (env->misa_mxl != MXL_RV32) {
> -        object_property_set_bool(obj, "zcf", false, NULL);
> +        isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zcf), false);
>      }
>  }
>  
> -- 
> 2.41.0
> 
>

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>


  reply	other threads:[~2023-08-31 13:58 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 22:14 [PATCH RESEND v8 00/20] riscv: 'max' CPU, detect user choice in TCG Daniel Henrique Barboza
2023-08-24 22:14 ` [PATCH RESEND v8 01/20] target/riscv/cpu.c: split CPU options from riscv_cpu_extensions[] Daniel Henrique Barboza
2023-08-31 12:49   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 02/20] target/riscv/cpu.c: skip 'bool' check when filtering KVM props Daniel Henrique Barboza
2023-08-31 12:49   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 03/20] target/riscv/cpu.c: split kvm prop handling to its own helper Daniel Henrique Barboza
2023-08-31 12:51   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 04/20] target/riscv: add DEFINE_PROP_END_OF_LIST() to riscv_cpu_options[] Daniel Henrique Barboza
2023-08-31 12:54   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 05/20] target/riscv/cpu.c: split non-ratified exts from riscv_cpu_extensions[] Daniel Henrique Barboza
2023-08-31 12:56   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 06/20] target/riscv/cpu.c: split vendor " Daniel Henrique Barboza
2023-08-31 12:57   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 07/20] target/riscv/cpu.c: add riscv_cpu_add_qdev_prop_array() Daniel Henrique Barboza
2023-08-31 13:01   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 08/20] target/riscv/cpu.c: add riscv_cpu_add_kvm_unavail_prop_array() Daniel Henrique Barboza
2023-08-31 13:03   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 09/20] target/riscv/cpu.c: limit cfg->vext_spec log message Daniel Henrique Barboza
2023-08-24 22:14 ` [PATCH RESEND v8 10/20] target/riscv: add 'max' CPU type Daniel Henrique Barboza
2023-08-31 13:11   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 11/20] avocado, risc-v: add opensbi tests for 'max' CPU Daniel Henrique Barboza
2023-08-31 13:16   ` Andrew Jones
2023-08-31 14:20     ` Daniel Henrique Barboza
2023-08-24 22:14 ` [PATCH RESEND v8 12/20] target/riscv: deprecate the 'any' CPU type Daniel Henrique Barboza
2023-08-31 13:19   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 13/20] target/riscv/cpu.c: use offset in isa_ext_is_enabled/update_enabled Daniel Henrique Barboza
2023-08-31 13:20   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 14/20] target/riscv: make CPUCFG() macro public Daniel Henrique Barboza
2023-08-31 13:22   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 15/20] target/riscv/cpu.c: introduce cpu_cfg_ext_auto_update() Daniel Henrique Barboza
2023-08-31 13:33   ` Andrew Jones
2023-08-31 14:12     ` Daniel Henrique Barboza
2023-08-24 22:14 ` [PATCH RESEND v8 16/20] target/riscv/cpu.c: use cpu_cfg_ext_auto_update() during realize() Daniel Henrique Barboza
2023-08-31 13:37   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 17/20] target/riscv/cpu.c: introduce RISCVCPUMultiExtConfig Daniel Henrique Barboza
2023-08-31 13:43   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 18/20] target/riscv: use isa_ext_update_enabled() in init_max_cpu_extensions() Daniel Henrique Barboza
2023-08-31 13:56   ` Andrew Jones [this message]
2023-08-24 22:14 ` [PATCH RESEND v8 19/20] target/riscv/cpu.c: honor user choice in cpu_cfg_ext_auto_update() Daniel Henrique Barboza
2023-08-31 13:58   ` Andrew Jones
2023-08-24 22:14 ` [PATCH RESEND v8 20/20] target/riscv/cpu.c: consider user option with RVG Daniel Henrique Barboza
2023-08-31 14:02   ` Andrew Jones
2023-08-31 15:43     ` Daniel Henrique Barboza
2023-08-31 14:05 ` [PATCH RESEND v8 00/20] riscv: 'max' CPU, detect user choice in TCG Andrew Jones

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=20230831-f38837e8878b942e5056299f@orel \
    --to=ajones@ventanamicro.com \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=liweiwei@iscas.ac.cn \
    --cc=palmer@rivosinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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).