qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] binfmt: Don't consider riscv{32,64} part of the same family


From: Laurent Vivier
Subject: Re: [PATCH] binfmt: Don't consider riscv{32,64} part of the same family
Date: Thu, 5 Dec 2024 18:15:51 +0100
User-agent: Mozilla Thunderbird

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 via email to

[Prev in Thread] Current Thread [Next in Thread]