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,
liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com,
palmer@rivosinc.com
Subject: Re: [PATCH 2/3] target/riscv/cpu.c: create flag for ziccrse
Date: Fri, 21 Feb 2025 13:38:42 +0100 [thread overview]
Message-ID: <20250221-b980af795e562471da881f9d@orel> (raw)
In-Reply-To: <20250218163854.425607-3-dbarboza@ventanamicro.com>
On Tue, Feb 18, 2025 at 01:38:53PM -0300, Daniel Henrique Barboza wrote:
> At this moment ziccrse is a TCG always enable ext that has no flag. KVM
> will expose ziccrse to users, allowing them to turn it on/off.
KVM won't allow this to be disabled, since it can't be (there's no way
to turn off the behavior or fake that it's not there for the guest.)
The reason KVM has added it to its ISA extension list is to inform a
VMM that the extension is present on the current host, which may be
of interest when determining migration targets (especially since it
can't be disabled.)
>
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> ---
> target/riscv/cpu.c | 5 +++++
> target/riscv/cpu_cfg.h | 3 +++
> 2 files changed, 8 insertions(+)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index 522d6584e4..0b8d2c0c25 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -1711,6 +1711,11 @@ const RISCVCPUMultiExtConfig riscv_cpu_extensions[] = {
> MULTI_EXT_CFG_BOOL("zvksc", ext_zvksc, false),
> MULTI_EXT_CFG_BOOL("zvksg", ext_zvksg, false),
>
> + /*
> + * KVM can turn it on/off. For TCG this is always
> + * enabled if priv_ver >= 1.11.
> + */
> + MULTI_EXT_CFG_BOOL("ziccrse", ext_ziccrse, true),
> { },
> };
>
> diff --git a/target/riscv/cpu_cfg.h b/target/riscv/cpu_cfg.h
> index 3f3c1118c0..88565e29fd 100644
> --- a/target/riscv/cpu_cfg.h
> +++ b/target/riscv/cpu_cfg.h
> @@ -157,6 +157,9 @@ struct RISCVCPUConfig {
> bool ext_ssstateen;
> bool ext_sha;
>
> + /* Always enabled for TCG, KVM wants to switch it on/off */
> + bool ext_ziccrse;
> +
> /*
> * Always 'true' booleans for named features
> * TCG always implement/can't be user disabled,
> --
> 2.48.1
>
>
I would just drop all the comments from this patch and reword the commit
message to state something along the lines of what I did.
Thanks,
drew
next prev parent reply other threads:[~2025-02-21 12:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 16:38 [PATCH 0/3] target/riscv/kvm: update to Linux 6.14-rc3 Daniel Henrique Barboza
2025-02-18 16:38 ` [PATCH 1/3] linux-headers: Update to Linux v6.14-rc3 Daniel Henrique Barboza
2025-02-18 16:38 ` [PATCH 2/3] target/riscv/cpu.c: create flag for ziccrse Daniel Henrique Barboza
2025-02-21 12:38 ` Andrew Jones [this message]
2025-02-18 16:38 ` [PATCH 3/3] target/riscv/kvm: add extensions after 6.14-rc3 update Daniel Henrique Barboza
2025-02-21 12:41 ` 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=20250221-b980af795e562471da881f9d@orel \
--to=ajones@ventanamicro.com \
--cc=alistair.francis@wdc.com \
--cc=bmeng@tinylab.org \
--cc=dbarboza@ventanamicro.com \
--cc=liwei1518@gmail.com \
--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).