qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Alistair Francis <alistair23@gmail.com>
Cc: "Andrea Bolognani" <abologna@redhat.com>,
	qemu-devel@nongnu.org, "Laurent Vivier" <laurent@vivier.eu>,
	"David Abdurachmanov" <davidlt@rivosinc.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH] binfmt: Don't consider riscv{32, 64} part of the same family
Date: Mon, 6 Jan 2025 11:47:00 +0000	[thread overview]
Message-ID: <CAFEAcA97_XJNs=oZP2OUTsGdaEU0YD9_PFzucQO214+Vmo1mmQ@mail.gmail.com> (raw)
In-Reply-To: <CAKmqyKMkN7z51MoAeOK-buDZjKeEV7AjzviyVcZ_AyMEJPgg0w@mail.gmail.com>

On Mon, 6 Jan 2025 at 01:29, Alistair Francis <alistair23@gmail.com> wrote:
>
> On Fri, Jan 3, 2025 at 2:04 AM Andrea Bolognani <abologna@redhat.com> wrote:
> >
> > On Tue, Dec 03, 2024 at 10:47:02AM +0100, Andrea Bolognani wrote:
> > > Currently the script won't generate a configuration file that
> > > sets up qemu-user-riscv32 on riscv64, likely under the
> > > assumption that 64-bit RISC-V machines can natively run 32-bit
> > > RISC-V code.
> > >
> > > However this functionality, while theoretically possible, in
> > > practice is missing from most commonly available RISC-V hardware
> > > and not enabled at the distro level. So qemu-user-riscv32 really
> > > is the only option to run riscv32 binaries on riscv64.
> > >
> > > Make riscv32 and riscv64 each its own family, so that the
> > > configuration file we need to make 32-on-64 userspace emulation
> > > work gets generated.
> > >
> > > Link: https://src.fedoraproject.org/rpms/qemu/pull-request/72
> > > Thanks: David Abdurachmanov <davidlt@rivosinc.com>
> > > Thanks: Daniel P. Berrangé <berrange@redhat.com>
> > > Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> > > ---
> > >  scripts/qemu-binfmt-conf.sh | 7 ++-----
> > >  1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > ping
> >
> > There are already two ACKs so I think we just need a maintainer to
> > pick this up.
>
> We didn't get an answer to the issue of a CPU supporting RV32 and yet
> the kernel still calls QEMU.
>
> I understand this allows things to work out of the box, but seems like
> a disservice to any hardware that does support RV32

There's the same thing on Arm too -- we don't set up qemu-user
aarch32 binfmt-misc on an aarch64 system because the host might
be able to natively execute the aarch32 binary. This is becoming
less true, but we still don't want to silently downgrade
native execution to emulation on the hosts where native execution
used to work.

I'm not sure the best approach here -- ideally we would want to
be able to register a binfmt-misc to the host kernel with "only use
this if you could not already natively execute it", but AFAIK that's
not possible.

-- PMM


  reply	other threads:[~2025-01-06 11:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03  9:47 [PATCH] binfmt: Don't consider riscv{32,64} part of the same family Andrea Bolognani
2024-12-03  9:59 ` Philippe Mathieu-Daudé
2024-12-03 10:12   ` [PATCH] binfmt: Don't consider riscv{32, 64} " Andrea Bolognani
2024-12-03 10:18   ` [PATCH] binfmt: Don't consider riscv{32,64} " Daniel P. Berrangé
2024-12-03 10:35     ` [PATCH] binfmt: Don't consider riscv{32, 64} " Peter Maydell
2024-12-03 13:57       ` [PATCH] binfmt: Don't consider riscv{32,64} " Richard Henderson
2024-12-04 10:17         ` Daniel P. Berrangé
2024-12-05 17:15           ` Laurent Vivier
2024-12-04 10:03 ` Laurent Vivier
2025-01-02 16:02 ` [PATCH] binfmt: Don't consider riscv{32, 64} " Andrea Bolognani
2025-01-06  1:27   ` Alistair Francis
2025-01-06 11:47     ` Peter Maydell [this message]
2025-01-06 11:57       ` Daniel P. Berrangé
2025-01-06 12:01         ` Peter Maydell
2025-01-06 17:54         ` Andrea Bolognani
2025-01-07  1:29           ` Alistair Francis

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='CAFEAcA97_XJNs=oZP2OUTsGdaEU0YD9_PFzucQO214+Vmo1mmQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=abologna@redhat.com \
    --cc=alistair23@gmail.com \
    --cc=berrange@redhat.com \
    --cc=davidlt@rivosinc.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@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).