[PATCH 11/11] kernel/x86: enable x32 support for amd64

Stefan Lippers-Hollmann s.l-h at gmx.de
Tue Nov 14 20:35:11 PST 2023


Hi

On 2023-11-14, Elliott Mitchell wrote:
> Date: Thu, 30 Mar 2023 16:30:49 -0700
>
> Full amd64 support isn't really appropriate for most situations
> OpenWRT is deployed.  Whereas x86-x32 seems extremely appropriate for
> these situations.  As such enable x86-x32 support.
>
> CONFIG_ARCH_MMAP_RND_COMPAT_BITS is required to follow along,
> otherwise the kernel build breaks.
>
> Signed-off-by: Elliott Mitchell <ehem+openwrt at m5p.com>
> ---
>
> I suggest OpenWRT should place some effort towards x86-x32.  x86-x32
> seems a rather superior generic target for OpenWRT.  Only issue is
> it could be valuable to have at least minimal amd64 userland support
> alongside the x86-x32 version.
>
> Note, this simply enables kernel support.  Until userspace building
> is added, this does almost nothing.

What would be the reason for enabling x32?
There is very little upstream buy-in for x32, when this question came
up for Debian, it was rejected to be enabled for -among other reasons-
concerns about the the system call ABI and its security hardening, as
well as concerns about the long term ABI compatibility (the later of
which probably not that relevant for OpenWrt, the former however is).

I do understand that this is a pet peeve among the high-density
virtualization crowd, but anywhere else, x32 as a concept is dead (and
never took off in the first place).

Talking about x86_64, as we have it right now, I don't see much of a
reason to change the current concept of 64-bit kernel and pure64
userland (and that's far from being a minimal setup, running on the
bare iron and having loaded quite bulky adblock lists):

# free -m
              total        used        free      shared  buff/cache   available
Mem:        3924052       75720     3640732        3424      207600     3768960
Swap:             0           0           0

*If* (and imho, again purely my own irrelevant opinion, that is a
big IF) x32 would really be deemed worthwhile for OpenWrt, it still
doesn't make sense to enable this whole userspace ABI for the x86_64
kernel now, before your desired additional patches are available
(and even then, you'd probably want a dedicated x32 subtarget instead
of  killing off the pure64 target for OpenWrt - something I'd
personally be even less in favour of).

What's the purpose for this patch now? OpenWrt doesn't ship anything
needing the x32 (yet), the only use for it would be running x32
binaries in a non-OpenWrt x32 chroot (and there aren't that many
general purpose distributions available to choose from) on top of
OpenWrt.

That aside, I may be confused by the config stacking order, but...
If I read it correctly, you enable CONFIG_X86_X32 in
target/linux/x86/config-*, while explicitly disabling it in the
only subtarget config (target/linux/x86/64/config-*) where it
would matter, is that really the intended way round and in line
with the commit description?

Regards
	Stefan Lippers-Hollmann



More information about the openwrt-devel mailing list