From: Richard Henderson <richard.henderson@linaro.org>
To: Palmer Dabbelt <palmer@rivosinc.com>,
qemu-devel@nongnu.org, qemu-riscv@nongnu.org
Subject: Re: [PATCH] target/riscv: Don't start user-mode with VILL
Date: Fri, 22 Nov 2024 09:36:27 -0600 [thread overview]
Message-ID: <a6dd816e-9d7f-4a69-8ce3-b60b07a3d297@linaro.org> (raw)
In-Reply-To: <20241122003247.8955-1-palmer@rivosinc.com>
On 11/21/24 18:32, Palmer Dabbelt wrote:
> This is still under discussion in the psABI, but it's looking like we're
> going to forbid VILL in userspace in order to maintain compatibility
> with binaries that don't expect implementations to trap whole register
> moves under VILL (as in QEMU before 4eff52cd46 ("target/riscv: Add vill
> check for whole vector register move instructions"), for example).
>
> Fixes: f8c1f36a2e ("target/riscv: Set vtype.vill on CPU reset")
> Link: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/454
> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
> ---
> target/riscv/cpu.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
> index f219f0c3b5..d19a44de99 100644
> --- a/target/riscv/cpu.c
> +++ b/target/riscv/cpu.c
> @@ -1022,7 +1022,11 @@ static void riscv_cpu_reset_hold(Object *obj, ResetType type)
> cs->exception_index = RISCV_EXCP_NONE;
> env->load_res = -1;
> set_default_nan_mode(1, &env->fp_status);
> +#ifdef CONFIG_USER_ONLY
> + env->vill = false;
> +#else
> env->vill = true;
> +#endif
>
> #ifndef CONFIG_USER_ONLY
> if (cpu->cfg.debug) {
This suggests that vtype_check() in tcg/riscv/tcg-target.c.inc needs modification. If the
probe fails, we need to set vtype back to any valid value (e.g. 0).
Also, may I suggest stronger guidelines about which VSEW are required to be supported in
various configurations. Right now, it appears as if the static compilers simply assume
all combinations of SEW/LMUL work.
r~
prev parent reply other threads:[~2024-11-22 15:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 0:32 [PATCH] target/riscv: Don't start user-mode with VILL Palmer Dabbelt
2024-11-22 15:36 ` Richard Henderson [this message]
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=a6dd816e-9d7f-4a69-8ce3-b60b07a3d297@linaro.org \
--to=richard.henderson@linaro.org \
--cc=palmer@rivosinc.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
/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).