qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Andrea Bolognani" <abologna@redhat.com>,
	qemu-devel@nongnu.org, qemu-riscv <qemu-riscv@nongnu.org>,
	"David Abdurachmanov" <davidlt@rivosinc.com>,
	"Mark Corbin" <mark@dibsco.co.uk>
Subject: Re: [PATCH] binfmt: Don't consider riscv{32,64} part of the same family
Date: Thu, 5 Dec 2024 18:15:51 +0100	[thread overview]
Message-ID: <fd654e78-9995-4eb2-bbe5-573563cf34f7@vivier.eu> (raw)
In-Reply-To: <Z1AsKNcbY2I46Tx1@redhat.com>

Le 04/12/2024 à 11:17, Daniel P. Berrangé a écrit :
> On Tue, Dec 03, 2024 at 07:57:14AM -0600, Richard Henderson wrote:
>> On 12/3/24 04:35, Peter Maydell wrote:
>>> On Tue, 3 Dec 2024 at 10:19, Daniel P. Berrangé <berrange@redhat.com> wrote:
>>>> Separatley this from patch, we should also consider whether
>>>> it is time to do the same for aarch64/arm7.
>>>>
>>>> If I look at this page:
>>>>
>>>>     https://gpages.juszkiewicz.com.pl/arm-socs-table/arm-socs.html
>>>>
>>>> and sort by 'announced' to see msot recent CPUs first, then
>>>> almost all of them have "NO" in the "aarch32 support" column.
>>>>
>>>> IOW, on modern aarch64 CPUs, qemu-arm is the only viable way
>>>> to run 32-bit usermode binaries AFAICT, and suggests we ought
>>>> to be creating a binfmt rule for that on aarch64 hosts.
>>>
>>> What happens if you have a host CPU that *does* support 32-bit
>>> natively and you also register the binfmt rule? Does the
>>> host kernel prefer to execute natively or does it invoke
>>> QEMU? I don't think we want to roll out something that
>>> silently downgrades native execution to emulation...
>>
>> The registered rule applies and the kernel invokes qemu.
> 
> This is all quiet difficult from a distro POV, but not QEMU's fault.
> 
> We want to install the binfmt rules in a way that we "do the right thing"
> regardless of hardware out of the box.
> 
> The systemd logic for loading binfmt rules is unconditional, loading
> everything from /usr/lib/binfmt.d, but we need a way to make things
> conditional on the lack of support for aarch32 on the currently running
> platform.

Now, there is another alternative: binfmt_misc is now part of user namespace, so you can define a 
binfmt rule for a given namespace:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=21ca59b365c091d583f36ac753eaa8baf947be6f

I have added a new parameter to unshare to help to run a new namespace with binfmt_misc:

https://github.com/util-linux/util-linux/commit/9d55de0d0d5c6298b38b58c3f4dc876c56213f85

Thanks,
Laurent


  reply	other threads:[~2024-12-05 21:21 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 [this message]
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
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=fd654e78-9995-4eb2-bbe5-573563cf34f7@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=abologna@redhat.com \
    --cc=berrange@redhat.com \
    --cc=davidlt@rivosinc.com \
    --cc=mark@dibsco.co.uk \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.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).