qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com,
	bmeng@tinylab.org, liweiwei@iscas.ac.cn,
	zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com,
	ajones@ventanamicro.com
Subject: Re: [PATCH v7 11/20] target/riscv/cpu: add misa_ext_info_arr[]
Date: Fri, 30 Jun 2023 12:15:42 +0200	[thread overview]
Message-ID: <d1367b5b-c432-5939-6af1-c279617fa4b9@linaro.org> (raw)
In-Reply-To: <20230630100811.287315-12-dbarboza@ventanamicro.com>

On 30/6/23 12:08, Daniel Henrique Barboza wrote:
> Next patch will add KVM specific user properties for both MISA and
> multi-letter extensions. For MISA extensions we want to make use of what
> is already available in misa_ext_cfgs[] to avoid code repetition.
> 
> misa_ext_info_arr[] array will hold name and description for each MISA
> extension that misa_ext_cfgs[] is declaring. We'll then use this new
> array in KVM code to avoid duplicating strings. Two getters were added
> to allow KVM to retrieve the 'name' and 'description' for each MISA
> property.
> 
> There's nothing holding us back from doing the same with multi-letter
> extensions. For now doing just with MISA extensions is enough.
> 
> It is worth documenting that even using the __bultin_ctz() directive to
> populate the misa_ext_info_arr[] we are forced to assign 'name' and
> 'description' during runtime in riscv_cpu_add_misa_properties(). The
> reason is that some Gitlab runners ('clang-user' and 'tsan-build') will
> throw errors like this if we fetch 'name' and 'description' from the
> array in the MISA_CFG() macro:
> 
> ../target/riscv/cpu.c:1624:5: error: initializer element is not a
>                                compile-time constant
>      MISA_CFG(RVA, true),
>      ^~~~~~~~~~~~~~~~~~~
> ../target/riscv/cpu.c:1619:53: note: expanded from macro 'MISA_CFG'
>      {.name = misa_ext_info_arr[MISA_INFO_IDX(_bit)].name, \
>               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> 
> gcc and others compilers/builders were fine with that change. We can't
> ignore failures in the Gitlab pipeline though, so code was changed to
> make every runner happy.
> 
> As a side effect, misa_ext_cfg[] is no longer a 'const' array because
> it must be set during runtime.
> 
> Suggested-by: Andrew Jones <ajones@ventanamicro.com>
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> ---
>   target/riscv/cpu.c | 110 +++++++++++++++++++++++++++++++++------------
>   target/riscv/cpu.h |   7 ++-
>   2 files changed, 88 insertions(+), 29 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



  reply	other threads:[~2023-06-30 10:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30 10:07 [PATCH v7 00/20] target/riscv, KVM: fixes and enhancements Daniel Henrique Barboza
2023-06-30 10:07 ` [PATCH v7 01/20] target/riscv: skip features setup for KVM CPUs Daniel Henrique Barboza
2023-06-30 10:07 ` [PATCH v7 02/20] hw/riscv/virt.c: skip 'mmu-type' FDT if satp mode not set Daniel Henrique Barboza
2023-06-30 10:07 ` [PATCH v7 03/20] target/riscv/cpu.c: restrict 'mvendorid' value Daniel Henrique Barboza
2023-06-30 10:07 ` [PATCH v7 04/20] target/riscv/cpu.c: restrict 'mimpid' value Daniel Henrique Barboza
2023-06-30 10:07 ` [PATCH v7 05/20] target/riscv/cpu.c: restrict 'marchid' value Daniel Henrique Barboza
2023-06-30 10:07 ` [PATCH v7 06/20] target/riscv: use KVM scratch CPUs to init KVM properties Daniel Henrique Barboza
2023-06-30 10:07 ` [PATCH v7 07/20] target/riscv: read marchid/mimpid in kvm_riscv_init_machine_ids() Daniel Henrique Barboza
2023-06-30 10:07 ` [PATCH v7 08/20] target/riscv: handle mvendorid/marchid/mimpid for KVM CPUs Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 09/20] linux-headers: Update to v6.4-rc1 Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 10/20] target/riscv/kvm.c: init 'misa_ext_mask' with scratch CPU Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 11/20] target/riscv/cpu: add misa_ext_info_arr[] Daniel Henrique Barboza
2023-06-30 10:15   ` Philippe Mathieu-Daudé [this message]
2023-06-30 11:27   ` Andrew Jones
2023-06-30 10:08 ` [PATCH v7 12/20] target/riscv: add KVM specific MISA properties Daniel Henrique Barboza
2023-06-30 11:29   ` Andrew Jones
2023-06-30 10:08 ` [PATCH v7 13/20] target/riscv/kvm.c: update KVM MISA bits Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 14/20] target/riscv/kvm.c: add multi-letter extension KVM properties Daniel Henrique Barboza
2023-07-05 13:41   ` Andrew Jones
2023-07-05 19:47     ` Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 15/20] target/riscv/cpu.c: add satp_mode properties earlier Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 16/20] target/riscv/cpu.c: remove priv_ver check from riscv_isa_string_ext() Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 17/20] target/riscv/cpu.c: create KVM mock properties Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 18/20] target/riscv: update multi-letter extension KVM properties Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 19/20] target/riscv/kvm.c: add kvmconfig_get_cfg_addr() helper Daniel Henrique Barboza
2023-06-30 10:08 ` [PATCH v7 20/20] target/riscv/kvm.c: read/write (cbom|cboz)_blocksize in KVM Daniel Henrique Barboza

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=d1367b5b-c432-5939-6af1-c279617fa4b9@linaro.org \
    --to=philmd@linaro.org \
    --cc=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).