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

Elliott Mitchell ehem+openwrt at m5p.com
Sun Oct 29 18:04:29 PDT 2023


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.
---
 target/linux/x86/64/config-5.15 | 1 -
 target/linux/x86/64/config-6.1  | 2 --
 target/linux/x86/config-5.15    | 2 ++
 target/linux/x86/config-6.1     | 3 +++
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/target/linux/x86/64/config-5.15 b/target/linux/x86/64/config-5.15
index 28a4758e57..3c60769a85 100644
--- a/target/linux/x86/64/config-5.15
+++ b/target/linux/x86/64/config-5.15
@@ -503,7 +503,6 @@ CONFIG_X86_PM_TIMER=y
 # CONFIG_X86_POWERNOW_K8 is not set
 # CONFIG_X86_VSYSCALL_EMULATION is not set
 CONFIG_X86_X2APIC=y
-# CONFIG_X86_X32 is not set
 CONFIG_XEN=y
 CONFIG_XENFS=y
 CONFIG_XEN_512GB=y
diff --git a/target/linux/x86/64/config-6.1 b/target/linux/x86/64/config-6.1
index 66ae3e35f0..812fa0cfa6 100644
--- a/target/linux/x86/64/config-6.1
+++ b/target/linux/x86/64/config-6.1
@@ -558,8 +558,6 @@ CONFIG_X86_PM_TIMER=y
 # CONFIG_X86_POWERNOW_K8 is not set
 # CONFIG_X86_VSYSCALL_EMULATION is not set
 CONFIG_X86_X2APIC=y
-# CONFIG_X86_X32 is not set
-# CONFIG_X86_X32_ABI is not set
 CONFIG_XEN=y
 CONFIG_XENFS=y
 CONFIG_XEN_512GB=y
diff --git a/target/linux/x86/config-5.15 b/target/linux/x86/config-5.15
index 71f06ad470..e93e46414a 100644
--- a/target/linux/x86/config-5.15
+++ b/target/linux/x86/config-5.15
@@ -13,6 +13,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
 CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8
 CONFIG_ARCH_NR_GPIO=512
 CONFIG_ARCH_RANDOM=y
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
@@ -429,6 +430,7 @@ CONFIG_X86_UP_IOAPIC=y
 CONFIG_X86_USE_PPRO_CHECKSUM=y
 CONFIG_X86_VERBOSE_BOOTUP=y
 CONFIG_X86_VMX_FEATURE_NAMES=y
+CONFIG_X86_X32=y
 CONFIG_XZ_DEC_BCJ=y
 CONFIG_XZ_DEC_X86=y
 CONFIG_ZLIB_INFLATE=y
diff --git a/target/linux/x86/config-6.1 b/target/linux/x86/config-6.1
index d6f8f6180b..a7affa9e56 100644
--- a/target/linux/x86/config-6.1
+++ b/target/linux/x86/config-6.1
@@ -14,6 +14,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
 CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8
 CONFIG_ARCH_NR_GPIO=512
 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
 CONFIG_ARCH_SPARSEMEM_ENABLE=y
@@ -451,6 +452,8 @@ CONFIG_X86_UP_IOAPIC=y
 CONFIG_X86_USE_PPRO_CHECKSUM=y
 CONFIG_X86_VERBOSE_BOOTUP=y
 CONFIG_X86_VMX_FEATURE_NAMES=y
+CONFIG_X86_X32=y
+CONFIG_X86_X32_ABI=y
 CONFIG_XZ_DEC_BCJ=y
 CONFIG_XZ_DEC_X86=y
 CONFIG_ZLIB_INFLATE=y
-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |       ehem+openwrt at m5p.com     PGP 87145445       |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445





-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg at m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445





More information about the openwrt-devel mailing list