qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.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, Frank Chang <frank.chang@sifive.com>
Subject: Re: [PATCH] target/riscv/tcg/tcg-cpu.c: consider MISA bit choice in implied rule
Date: Mon, 26 Aug 2024 10:15:03 +1000	[thread overview]
Message-ID: <CAKmqyKN6THm3yEYPB5g-65oz6Dv3R9upJwjfMSDgBARgerd1qQ@mail.gmail.com> (raw)
In-Reply-To: <20240824173338.316666-1-dbarboza@ventanamicro.com>

On Sun, Aug 25, 2024 at 3:34 AM Daniel Henrique Barboza
<dbarboza@ventanamicro.com> wrote:
>
> Gitlab issue [1] reports a misleading error when trying to run a 'rv64'
> cpu with 'zfinx' and without 'f':
>
> $ ./build/qemu-system-riscv64 -nographic -M virt -cpu rv64,zfinx=true,f=false
> qemu-system-riscv64: Zfinx cannot be supported together with F extension
>
> The user explicitly disabled F and the error message mentions a conflict
> with Zfinx and F.
>
> The problem isn't the error reporting, but the logic used when applying
> the implied ZFA rule that enables RVF unconditionally, without honoring
> user choice (i.e. keep F disabled).
>
> Change cpu_enable_implied_rule() to check if the user deliberately
> disabled a MISA bit. In this case we shouldn't either re-enable the bit
> nor apply any implied rules related to it.
>
> After this change the error message now shows:
>
> $ ./build/qemu-system-riscv64 -nographic -M virt -cpu rv64,zfinx=true,f=false
> qemu-system-riscv64: Zfa extension requires F extension
>
> Disabling 'zfa':
>
> $ ./build/qemu-system-riscv64 -nographic -M virt -cpu rv64,zfinx=true,f=false,zfa=false
> qemu-system-riscv64: D extension requires F extension
>
> And finally after disabling 'd':
>
> $ ./build/qemu-system-riscv64 -nographic -M virt -cpu rv64,zfinx=true,f=false,zfa=false,d=false
> (OpenSBI boots ...)
>
> [1] https://gitlab.com/qemu-project/qemu/-/issues/2486
>
> Cc: Frank Chang <frank.chang@sifive.com>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2486
> Fixes: 047da861f9 ("target/riscv: Introduce extension implied rule helpers")
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

Thanks!

Applied to riscv-to-apply.next

Alistair


      parent reply	other threads:[~2024-08-26  0:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-24 17:33 [PATCH] target/riscv/tcg/tcg-cpu.c: consider MISA bit choice in implied rule Daniel Henrique Barboza
2024-08-26  0:09 ` Alistair Francis
2024-08-26  0:15 ` Alistair Francis [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=CAKmqyKN6THm3yEYPB5g-65oz6Dv3R9upJwjfMSDgBARgerd1qQ@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=frank.chang@sifive.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).