[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250506170924.3513161-5-mingo@kernel.org>
Date: Tue, 6 May 2025 19:09:13 +0200
From: Ingo Molnar <mingo@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: "H . Peter Anvin" <hpa@...or.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Ingo Molnar <mingo@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
David Woodhouse <dwmw@...zon.co.uk>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Michal Marek <michal.lkml@...kovi.net>
Subject: [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture
These days the canonical counterpart to the x86_64 architecture
is the x86_32 architecture - except our Makefiles don't accept it
as an ARCH target.
Make it so.
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: Ard Biesheuvel <ardb@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: David Woodhouse <dwmw@...zon.co.uk>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: Michal Marek <michal.lkml@...kovi.net>
---
Makefile | 7 +++++--
arch/x86/Kconfig | 2 +-
arch/x86/Makefile | 10 +++++++---
arch/x86/configs/{defconfig.i386 => defconfig.x86_32} | 0
tools/scripts/Makefile.arch | 7 +++++--
5 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index b29cc321ffd9..84a4912f3343 100644
--- a/Makefile
+++ b/Makefile
@@ -407,10 +407,13 @@ UTS_MACHINE := $(ARCH)
SRCARCH := $(ARCH)
# Additional ARCH settings for x86
-ifeq ($(ARCH),i386)
+ifeq ($(ARCH),x86_64)
SRCARCH := x86
endif
-ifeq ($(ARCH),x86_64)
+ifeq ($(ARCH),x86_32)
+ SRCARCH := x86
+endif
+ifeq ($(ARCH),i386)
SRCARCH := x86
endif
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 4b9f378e05f6..3282638072b9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2,7 +2,7 @@
# Select 32 or 64 bit
config 64BIT
bool "64-bit kernel" if "$(ARCH)" = "x86"
- default "$(ARCH)" != "i386"
+ default "$(ARCH)" != "i386" && "$(ARCH)" != "x86_32"
help
Say yes to build a 64-bit kernel - formerly known as x86_64
Say no to build a 32-bit kernel - formerly known as i386
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index bae2c7bbb8db..fb4f0f15d1df 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -1,15 +1,19 @@
# SPDX-License-Identifier: GPL-2.0
-# Unified Makefile for i386 and x86_64
+# Unified Makefile for x86_64 and x86_32
-# select defconfig based on actual architecture
+# When in doubt, select defconfig based on host architecture:
ifeq ($(ARCH),x86)
ifeq ($(shell uname -m | sed -e 's/i.86/i386/'),i386)
- KBUILD_DEFCONFIG := defconfig.i386
+ KBUILD_DEFCONFIG := defconfig.x86_32
else
KBUILD_DEFCONFIG := defconfig.x86_64
endif
else
+ ifeq ($(ARCH),i386)
+ KBUILD_DEFCONFIG := defconfig.x86_32
+ else
KBUILD_DEFCONFIG := defconfig.$(ARCH)
+ endif
endif
ifdef CONFIG_CC_IS_GCC
diff --git a/arch/x86/configs/defconfig.i386 b/arch/x86/configs/defconfig.x86_32
similarity index 100%
rename from arch/x86/configs/defconfig.i386
rename to arch/x86/configs/defconfig.x86_32
diff --git a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch
index eabfe9f411d9..9aedca27ac9a 100644
--- a/tools/scripts/Makefile.arch
+++ b/tools/scripts/Makefile.arch
@@ -14,10 +14,13 @@ endif
SRCARCH := $(ARCH)
# Additional ARCH settings for x86
-ifeq ($(ARCH),i386)
+ifeq ($(ARCH),x86_64)
SRCARCH := x86
endif
-ifeq ($(ARCH),x86_64)
+ifeq ($(ARCH),x86_32)
+ SRCARCH := x86
+endif
+ifeq ($(ARCH),i386)
SRCARCH := x86
endif
--
2.45.2
Powered by blists - more mailing lists