linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups
@ 2025-05-06 17:09 Ingo Molnar
  2025-05-06 17:09 ` [PATCH 01/15] x86/kconfig/64: Refresh defconfig Ingo Molnar
                   ` (14 more replies)
  0 siblings, 15 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar

Changes in -v2:

 - Switch from CONFIG_DEBUG_LIST=y to the lower-overhead
   CONFIG_LIST_HARDENING=y option

 - Add Hyper-V

 - Propagate the above changes to x86_32

 - Add review tags

Changes in -v1 (initial announcement):

Historically the x86 defconfigs aimed to be distro kernel
work-alikes with fewer drivers and a substantially shorter
build time. We regularly ask our contributors to test their
changes on x86 defconfigs, and we frequently analyze code
generation on such kernels as well.

In practice, over the past couple of years this goal has
diverged from what actual modern Linux distributions do
these days, and this series aims to correct that divergence.

Perform a thorough modernization of the x86 defconfigs, and
apply some cleanups to the x86 build system as well:

 - Enable various kernel features that the most popular
   Linux distributions have enabled in their generic
   kernels these days: KVM host, BPF support, UBSAN, various MM
   options, debugging options, various scheduler and cgroups
   options, support for a number of guest OS platforms,
   and other options.

 - More specifically, these changes enable a rough superset
   of the kernel features enabled by Ubuntu, Fedora/RHEL
   kernels.

 - Clean up the organization of the defconfig files as well.

 - Add the ARCH=x86_32 build target

 - Synchronize the x86_32 defconfig to the x86_64 defconfig:
   this file is really just a random set of options configured
   many years ago with no relevance to anything people are
   using today anymore. Just follow the 64-bit options to the
   extent possible, to have at least one modern frame of
   reference.

 - Clean up a number of kbuild details

This series can also be accessed through my Git tree:

  git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.x86/kconfig

Thanks,

	Ingo

================>
Ingo Molnar (15):
  x86/kconfig/64: Refresh defconfig
  x86/kconfig/32: Refresh defconfig
  x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386
  x86/kbuild: Introduce the 'x86_32' subarchitecture
  x86/kbuild: Remove ancient 'arch/i386/' and 'arch/x86_64/' directory removal 'archclean' target
  x86/tools: insn_decoder_test.c: Emit standard build success messages
  x86/tools: insn_sanity.c: Emit standard build success messages
  x86/kconfig/64: Enable the KVM host in the defconfig
  x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V
  x86/kconfig/64: Enable BPF support in the defconfig
  x86/kconfig/64: Enable popular MM options in the defconfig
  x86/kconfig/64: Enable popular kernel debugging options in the defconfig
  x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  x86/kconfig/64: Enable popular generic kernel options in the defconfig
  x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig

 .../verify-bugs-and-bisect-regressions.rst         |   2 +-
 Makefile                                           |   7 +-
 arch/x86/Kconfig                                   |   2 +-
 arch/x86/Makefile                                  |  18 +--
 .../configs/{i386_defconfig => defconfig.x86_32}   | 130 ++++++++++++++++++---
 .../configs/{x86_64_defconfig => defconfig.x86_64} | 128 +++++++++++++++++---
 arch/x86/tools/insn_decoder_test.c                 |   2 +-
 arch/x86/tools/insn_sanity.c                       |   4 +-
 drivers/gpu/drm/ci/build.yml                       |   2 +-
 tools/scripts/Makefile.arch                        |   7 +-
 10 files changed, 251 insertions(+), 51 deletions(-)
 rename arch/x86/configs/{i386_defconfig => defconfig.x86_32} (69%)
 rename arch/x86/configs/{x86_64_defconfig => defconfig.x86_64} (69%)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 01/15] x86/kconfig/64: Refresh defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-07  5:31   ` Arnd Bergmann
  2025-05-06 17:09 ` [PATCH 02/15] x86/kconfig/32: " Ingo Molnar
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

Refresh the x86-64 defconfig to pick up changes in the
general Kconfig environment: removed options, different
defaults, renames, etc.

No changes to the actual result of 'make ARCH=x86 defconfig'.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/configs/x86_64_defconfig | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index 61e25f6209ed..7d7310cdf8b0 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -27,6 +27,7 @@ CONFIG_CGROUP_DEBUG=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
+CONFIG_KEXEC=y
 CONFIG_SMP=y
 CONFIG_HYPERVISOR_GUEST=y
 CONFIG_PARAVIRT=y
@@ -40,8 +41,6 @@ CONFIG_EFI=y
 CONFIG_EFI_STUB=y
 CONFIG_EFI_MIXED=y
 CONFIG_HZ_1000=y
-CONFIG_KEXEC=y
-CONFIG_CRASH_DUMP=y
 CONFIG_HIBERNATION=y
 CONFIG_PM_DEBUG=y
 CONFIG_PM_TRACE_RTC=y
@@ -63,9 +62,7 @@ CONFIG_BINFMT_MISC=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
-CONFIG_UNIX=y
 CONFIG_XFRM_USER=y
-CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 CONFIG_IP_ADVANCED_ROUTER=y
 CONFIG_IP_MULTIPLE_TABLES=y
@@ -205,7 +202,6 @@ CONFIG_SND_HDA_INTEL=y
 CONFIG_SND_HDA_HWDEP=y
 CONFIG_HIDRAW=y
 CONFIG_HID_GYRATION=y
-CONFIG_LOGITECH_FF=y
 CONFIG_HID_NTRIG=y
 CONFIG_HID_PANTHERLORD=y
 CONFIG_PANTHERLORD_FF=y
@@ -239,7 +235,6 @@ CONFIG_EXT4_FS_POSIX_ACL=y
 CONFIG_EXT4_FS_SECURITY=y
 CONFIG_QUOTA=y
 CONFIG_QUOTA_NETLINK_INTERFACE=y
-# CONFIG_PRINT_QUOTA_WARNING is not set
 CONFIG_QFMT_V2=y
 CONFIG_AUTOFS_FS=y
 CONFIG_ISO9660_FS=y
@@ -264,13 +259,11 @@ CONFIG_SECURITY=y
 CONFIG_SECURITY_NETWORK=y
 CONFIG_SECURITY_SELINUX=y
 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
-CONFIG_SECURITY_SELINUX_DISABLE=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_WX=y
 CONFIG_DEBUG_STACK_USAGE=y
-# CONFIG_SCHED_DEBUG is not set
 CONFIG_SCHEDSTATS=y
 CONFIG_BLK_DEV_IO_TRACE=y
 CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 02/15] x86/kconfig/32: Refresh defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
  2025-05-06 17:09 ` [PATCH 01/15] x86/kconfig/64: Refresh defconfig Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 03/15] x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386 Ingo Molnar
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

Refresh the x86-32 defconfig to pick up changes in the
general Kconfig environment: removed options, different
defaults, renames, etc.

No changes to the actual result of 'make ARCH=i386 defconfig'.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/configs/i386_defconfig | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index 91801138b10b..e983f1db22dd 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -28,6 +28,7 @@ CONFIG_CGROUP_DEBUG=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
+CONFIG_KEXEC=y
 CONFIG_SMP=y
 CONFIG_HYPERVISOR_GUEST=y
 CONFIG_PARAVIRT=y
@@ -40,8 +41,6 @@ CONFIG_X86_CHECK_BIOS_CORRUPTION=y
 CONFIG_EFI=y
 CONFIG_EFI_STUB=y
 CONFIG_HZ_1000=y
-CONFIG_KEXEC=y
-CONFIG_CRASH_DUMP=y
 # CONFIG_MITIGATION_RETHUNK is not set
 CONFIG_HIBERNATION=y
 CONFIG_PM_DEBUG=y
@@ -64,9 +63,7 @@ CONFIG_BINFMT_MISC=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
-CONFIG_UNIX=y
 CONFIG_XFRM_USER=y
-CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 CONFIG_IP_ADVANCED_ROUTER=y
 CONFIG_IP_MULTIPLE_TABLES=y
@@ -138,6 +135,7 @@ CONFIG_CONNECTOR=y
 CONFIG_EFI_CAPSULE_LOADER=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_VIRTIO_BLK=y
+# CONFIG_INTEL_MEI is not set
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_CHR_DEV_SG=y
@@ -211,7 +209,6 @@ CONFIG_SND_HDA_INTEL=y
 CONFIG_SND_HDA_HWDEP=y
 CONFIG_HIDRAW=y
 CONFIG_HID_GYRATION=y
-CONFIG_LOGITECH_FF=y
 CONFIG_HID_NTRIG=y
 CONFIG_HID_PANTHERLORD=y
 CONFIG_PANTHERLORD_FF=y
@@ -242,7 +239,6 @@ CONFIG_EXT4_FS_POSIX_ACL=y
 CONFIG_EXT4_FS_SECURITY=y
 CONFIG_QUOTA=y
 CONFIG_QUOTA_NETLINK_INTERFACE=y
-# CONFIG_PRINT_QUOTA_WARNING is not set
 CONFIG_QFMT_V2=y
 CONFIG_AUTOFS_FS=y
 CONFIG_ISO9660_FS=y
@@ -267,19 +263,15 @@ CONFIG_SECURITY=y
 CONFIG_SECURITY_NETWORK=y
 CONFIG_SECURITY_SELINUX=y
 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
-CONFIG_SECURITY_SELINUX_DISABLE=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_FRAME_WARN=1024
 CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_WX=y
 CONFIG_DEBUG_STACK_USAGE=y
-# CONFIG_SCHED_DEBUG is not set
 CONFIG_SCHEDSTATS=y
 CONFIG_BLK_DEV_IO_TRACE=y
 CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
 CONFIG_EARLY_PRINTK_DBGP=y
 CONFIG_DEBUG_BOOT_PARAMS=y
-CONFIG_UNWINDER_FRAME_POINTER=y
 CONFIG_DEBUG_ENTRY=y
-# CONFIG_64BIT is not set
+CONFIG_UNWINDER_FRAME_POINTER=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 03/15] x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
  2025-05-06 17:09 ` [PATCH 01/15] x86/kconfig/64: Refresh defconfig Ingo Molnar
  2025-05-06 17:09 ` [PATCH 02/15] x86/kconfig/32: " Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-09 18:10   ` Arnd Bergmann
  2025-05-06 17:09 ` [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture Ingo Molnar
                   ` (11 subsequent siblings)
  14 siblings, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

Editing the defconfigs with shell filename completion is unnecessarily
hard due to bad naming: if one remembers 'arch/x86/config/defconfig',
it won't lead to the right files, because the defconfigs are
prefixed with $(ARCH)_.

Under the principle of 'higher order names should go first', prefix
them with 'defconfig' and postfix them with .$(ARCH), and thus make
all x86 configs match the arch/x86/config/defconfig.* pattern.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst | 2 +-
 arch/x86/Makefile                                                | 6 +++---
 arch/x86/configs/{i386_defconfig => defconfig.i386}              | 0
 arch/x86/configs/{x86_64_defconfig => defconfig.x86_64}          | 0
 drivers/gpu/drm/ci/build.yml                                     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
index 03c55151346c..bcd2bdf6c076 100644
--- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
+++ b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
@@ -426,7 +426,7 @@ machine; if you want to compile the kernel on another system, check
   Look out for a line starting with '# using defaults found in'. It should be
   followed by a path to a file in '/boot/' that contains the release identifier
   of your currently working kernel. If the line instead continues with something
-  like 'arch/x86/configs/x86_64_defconfig', then the build infra failed to find
+  like 'arch/x86/configs/defconfig.x86_64', then the build infra failed to find
   the .config file for your running kernel -- in which case you have to put one
   there manually, as explained in the reference section.
 
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 594723005d95..bae2c7bbb8db 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -4,12 +4,12 @@
 # select defconfig based on actual architecture
 ifeq ($(ARCH),x86)
   ifeq ($(shell uname -m | sed -e 's/i.86/i386/'),i386)
-        KBUILD_DEFCONFIG := i386_defconfig
+        KBUILD_DEFCONFIG := defconfig.i386
   else
-        KBUILD_DEFCONFIG := x86_64_defconfig
+        KBUILD_DEFCONFIG := defconfig.x86_64
   endif
 else
-        KBUILD_DEFCONFIG := $(ARCH)_defconfig
+        KBUILD_DEFCONFIG := defconfig.$(ARCH)
 endif
 
 ifdef CONFIG_CC_IS_GCC
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/defconfig.i386
similarity index 100%
rename from arch/x86/configs/i386_defconfig
rename to arch/x86/configs/defconfig.i386
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/defconfig.x86_64
similarity index 100%
rename from arch/x86/configs/x86_64_defconfig
rename to arch/x86/configs/defconfig.x86_64
diff --git a/drivers/gpu/drm/ci/build.yml b/drivers/gpu/drm/ci/build.yml
index 274f118533a7..2e0ce38d73cd 100644
--- a/drivers/gpu/drm/ci/build.yml
+++ b/drivers/gpu/drm/ci/build.yml
@@ -35,7 +35,7 @@
     - .build
     - .use-debian/x86_64_build
   variables:
-    DEFCONFIG: "arch/x86/configs/x86_64_defconfig"
+    DEFCONFIG: "arch/x86/configs/defconfig.x86_64"
     KERNEL_IMAGE_NAME: "bzImage"
     KERNEL_ARCH: "x86_64"
 
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (2 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 03/15] x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386 Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-07  5:44   ` Arnd Bergmann
  2025-05-06 17:09 ` [PATCH 05/15] x86/kbuild: Remove ancient 'arch/i386/' and 'arch/x86_64/' directory removal 'archclean' target Ingo Molnar
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

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@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.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


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 05/15] x86/kbuild: Remove ancient 'arch/i386/' and 'arch/x86_64/' directory removal 'archclean' target
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (3 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 06/15] x86/tools: insn_decoder_test.c: Emit standard build success messages Ingo Molnar
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

We have to go back 17 years into Git history, to kernels that won't
even build or boot with modern build environments, to come across
the obsolete arch/i386/ and arch/x86_64/ directories.

Remove some of their last functional residuals in the 'archclean' target.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/Makefile | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index fb4f0f15d1df..6348782e1be0 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -352,10 +352,6 @@ $(orc_hash_h): $(srctree)/arch/x86/include/asm/orc_types.h $(orc_hash_sh) FORCE
 archprepare: $(orc_hash_h)
 endif
 
-archclean:
-	$(Q)rm -rf $(objtree)/arch/i386
-	$(Q)rm -rf $(objtree)/arch/x86_64
-
 define archhelp
   echo  '* bzImage		- Compressed kernel image (arch/x86/boot/bzImage)'
   echo  '  install		- Install kernel using (your) ~/bin/$(INSTALLKERNEL) or'
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 06/15] x86/tools: insn_decoder_test.c: Emit standard build success messages
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (4 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 05/15] x86/kbuild: Remove ancient 'arch/i386/' and 'arch/x86_64/' directory removal 'archclean' target Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 07/15] x86/tools: insn_sanity.c: " Ingo Molnar
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

The standard 'success' output of insn_decoder_test spams build logs with:

  arch/x86/tools/insn_decoder_test: success: Decoded and checked 8258521 instructions

Prefix the message with the standard '  ' (two spaces) used by kbuild to denote
regular build messages, making it easier for tools to filter out
warnings and errors.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/tools/insn_decoder_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/tools/insn_decoder_test.c b/arch/x86/tools/insn_decoder_test.c
index 08cd913cbd4e..8bf15c4aefa9 100644
--- a/arch/x86/tools/insn_decoder_test.c
+++ b/arch/x86/tools/insn_decoder_test.c
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
 		pr_warn("Decoded and checked %d instructions with %d "
 			"failures\n", insns, warnings);
 	else
-		fprintf(stdout, "%s: success: Decoded and checked %d"
+		fprintf(stdout, "  %s: success: Decoded and checked %d"
 			" instructions\n", prog, insns);
 	return 0;
 }
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 07/15] x86/tools: insn_sanity.c: Emit standard build success messages
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (5 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 06/15] x86/tools: insn_decoder_test.c: Emit standard build success messages Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 08/15] x86/kconfig/64: Enable the KVM host in the defconfig Ingo Molnar
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

The standard 'success' output of insn_decoder_test spams build logs with:

  arch/x86/tools/insn_sanity: Success: decoded and checked 1000000 random instructions with 0 errors (seed:0x2e263877)

Prefix the message with the standard '  ' (two spaces) used by kbuild
to denote regular build messages, making it easier for tools to
filter out warnings and errors.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/tools/insn_sanity.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/tools/insn_sanity.c b/arch/x86/tools/insn_sanity.c
index 213f35f94feb..e743f0ea01ee 100644
--- a/arch/x86/tools/insn_sanity.c
+++ b/arch/x86/tools/insn_sanity.c
@@ -253,9 +253,9 @@ int main(int argc, char **argv)
 	}
 
 	fprintf((errors) ? stderr : stdout,
-		"%s: %s: decoded and checked %d %s instructions with %d errors (seed:0x%x)\n",
+		"  %s: %s: Decoded and checked %d %s instructions with %d errors (seed:0x%x)\n",
 		prog,
-		(errors) ? "Failure" : "Success",
+		(errors) ? "failure" : "success",
 		insns,
 		(input_file) ? "given" : "random",
 		errors,
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 08/15] x86/kconfig/64: Enable the KVM host in the defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (6 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 07/15] x86/tools: insn_sanity.c: " Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 09/15] x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V Ingo Molnar
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

These days all distros enable KVM, and since the x86 defconfig
aims to be a distro kernel work-alike with fewer drivers and
a shorter build time, enable the KVM host in the defconfig too.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/configs/defconfig.x86_64 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/configs/defconfig.x86_64 b/arch/x86/configs/defconfig.x86_64
index 7d7310cdf8b0..156e9490e29b 100644
--- a/arch/x86/configs/defconfig.x86_64
+++ b/arch/x86/configs/defconfig.x86_64
@@ -50,6 +50,11 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_X86_ACPI_CPUFREQ=y
 CONFIG_IA32_EMULATION=y
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_KVM_XEN=y
+CONFIG_KVM_MAX_NR_VCPUS=4096
 CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 09/15] x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (7 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 08/15] x86/kconfig/64: Enable the KVM host in the defconfig Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-08  9:21   ` Jürgen Groß
  2025-05-06 17:09 ` [PATCH 10/15] x86/kconfig/64: Enable BPF support in the defconfig Ingo Molnar
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar,
	Kirill A . Shutemov, Ard Biesheuvel, Arnd Bergmann, Carlos Bilbao,
	David Woodhouse, Elena Reshetova, Fei Li, Jan Kiszka,
	Juergen Gross, Masahiro Yamada, Michal Marek, Paolo Bonzini,
	Sean Christopherson, Stefano Stabellini

Since the x86 defconfig aims to be a distro kernel work-alike with
fewer drivers and a shorter build time, refresh all the virtualization
guest Kconfig features, enabling paravirt spinlocks, and
enabling the guest support code for the following guests:

 - Xen
 - Xen_PVH
 - Jailhouse
 - ACRN
 - Intel TDX
 - Hyper-V

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Carlos Bilbao <carlos.bilbao@kernel.org>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Elena Reshetova <elena.reshetova@intel.com>
Cc: Fei Li <fei1.li@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 arch/x86/configs/defconfig.x86_64 | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/arch/x86/configs/defconfig.x86_64 b/arch/x86/configs/defconfig.x86_64
index 156e9490e29b..df786b8b4e85 100644
--- a/arch/x86/configs/defconfig.x86_64
+++ b/arch/x86/configs/defconfig.x86_64
@@ -30,7 +30,12 @@ CONFIG_PROFILING=y
 CONFIG_KEXEC=y
 CONFIG_SMP=y
 CONFIG_HYPERVISOR_GUEST=y
-CONFIG_PARAVIRT=y
+CONFIG_PARAVIRT_SPINLOCKS=y
+CONFIG_XEN=y
+CONFIG_XEN_PVH=y
+CONFIG_JAILHOUSE_GUEST=y
+CONFIG_ACRN_GUEST=y
+CONFIG_INTEL_TDX_GUEST=y
 CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
 CONFIG_X86_MSR=y
 CONFIG_X86_CPUID=y
@@ -128,6 +133,7 @@ CONFIG_NET_9P=y
 CONFIG_NET_9P_VIRTIO=y
 CONFIG_PCI=y
 CONFIG_PCIEPORTBUS=y
+CONFIG_PCI_HYPERV=y
 CONFIG_HOTPLUG_PCI=y
 CONFIG_PCCARD=y
 CONFIG_YENTA=y
@@ -168,6 +174,7 @@ CONFIG_SKY2=y
 CONFIG_FORCEDETH=y
 CONFIG_8139TOO=y
 CONFIG_R8169=y
+CONFIG_HYPERV_NET=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_JOYSTICK=y
 CONFIG_INPUT_TABLET=y
@@ -198,6 +205,7 @@ CONFIG_AGP_INTEL=y
 CONFIG_DRM=y
 CONFIG_DRM_I915=y
 CONFIG_DRM_VIRTIO_GPU=y
+CONFIG_DRM_HYPERV=y
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_HRTIMER=y
@@ -214,6 +222,7 @@ CONFIG_HID_PETALYNX=y
 CONFIG_HID_SAMSUNG=y
 CONFIG_HID_SONY=y
 CONFIG_HID_SUNPLUS=y
+CONFIG_HID_HYPERV_MOUSE=y
 CONFIG_HID_TOPSEED=y
 CONFIG_HID_PID=y
 CONFIG_USB_HIDDEV=y
@@ -231,6 +240,9 @@ CONFIG_RTC_CLASS=y
 CONFIG_DMADEVICES=y
 CONFIG_VIRTIO_PCI=y
 CONFIG_VIRTIO_INPUT=y
+CONFIG_HYPERV=y
+CONFIG_HYPERV_UTILS=y
+CONFIG_HYPERV_BALLOON=y
 CONFIG_EEEPC_LAPTOP=y
 CONFIG_AMD_IOMMU=y
 CONFIG_INTEL_IOMMU=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 10/15] x86/kconfig/64: Enable BPF support in the defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (8 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 09/15] x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 11/15] x86/kconfig/64: Enable popular MM options " Ingo Molnar
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko

Since the x86 defconfig aims to be a distro kernel work-alike with
fewer drivers and a shorter build time, enable BPF support, which
is enabled in all major Linux distributions.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>
---
 arch/x86/configs/defconfig.x86_64 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/x86/configs/defconfig.x86_64 b/arch/x86/configs/defconfig.x86_64
index df786b8b4e85..a32ed372e5bd 100644
--- a/arch/x86/configs/defconfig.x86_64
+++ b/arch/x86/configs/defconfig.x86_64
@@ -4,6 +4,12 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_AUDIT=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BPF_SYSCALL=y
+CONFIG_BPF_JIT=y
+CONFIG_BPF_JIT_ALWAYS_ON=y
+CONFIG_BPF_PRELOAD=y
+CONFIG_BPF_PRELOAD_UMD=y
+CONFIG_BPF_LSM=y
 CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_TASKSTATS=y
@@ -22,6 +28,7 @@ CONFIG_CPUSETS=y
 CONFIG_CGROUP_DEVICE=y
 CONFIG_CGROUP_CPUACCT=y
 CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_BPF=y
 CONFIG_CGROUP_MISC=y
 CONFIG_CGROUP_DEBUG=y
 CONFIG_BLK_DEV_INITRD=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 11/15] x86/kconfig/64: Enable popular MM options in the defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (9 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 10/15] x86/kconfig/64: Enable BPF support in the defconfig Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 12/15] x86/kconfig/64: Enable popular kernel debugging " Ingo Molnar
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Andrew Morton,
	Ard Biesheuvel, Arnd Bergmann, David Woodhouse, Masahiro Yamada,
	Michal Marek, Rik van Riel

Since the x86 defconfig aims to be a distro kernel work-alike with
fewer drivers and a shorter build time, enable the following
MM options that are typically enabled on major Linux distributions:

- ACPI_HOTPLUG_MEMORY, ZSWAP, SLAB hardening, MEMORY_HOTPLUG,
  MEMORY_HOTREMOVE, PAGE_REPORTING, KSM, higher DEFAULT_MMAP_MIN_ADDR,
  MEMORY_FAILURE, HWPOISON_INJECT, TRANSPARENT_HUGEPAGE,
  TRANSPARENT_HUGEPAGE_MADVISE, IDLE_PAGE_TRACKING, ZONE_DEVICE
  DEVICE_PRIVATE, ANON_VMA_NAME, USERFAULTFD, multi-gen LRU.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@surriel.com>
---
 arch/x86/configs/defconfig.x86_64 | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/x86/configs/defconfig.x86_64 b/arch/x86/configs/defconfig.x86_64
index a32ed372e5bd..02c4ba79946b 100644
--- a/arch/x86/configs/defconfig.x86_64
+++ b/arch/x86/configs/defconfig.x86_64
@@ -57,6 +57,7 @@ CONFIG_HIBERNATION=y
 CONFIG_PM_DEBUG=y
 CONFIG_PM_TRACE_RTC=y
 CONFIG_ACPI_DOCK=y
+CONFIG_ACPI_HOTPLUG_MEMORY=y
 CONFIG_ACPI_BGRT=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
@@ -76,7 +77,26 @@ CONFIG_BLK_CGROUP_IOLATENCY=y
 CONFIG_BLK_CGROUP_IOCOST=y
 CONFIG_BLK_CGROUP_IOPRIO=y
 CONFIG_BINFMT_MISC=y
+CONFIG_ZSWAP=y
+CONFIG_SLAB_FREELIST_RANDOM=y
+CONFIG_SLAB_FREELIST_HARDENED=y
 # CONFIG_COMPAT_BRK is not set
+CONFIG_MEMORY_HOTPLUG=y
+CONFIG_MEMORY_HOTREMOVE=y
+CONFIG_PAGE_REPORTING=y
+CONFIG_KSM=y
+CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
+CONFIG_MEMORY_FAILURE=y
+CONFIG_HWPOISON_INJECT=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
+CONFIG_IDLE_PAGE_TRACKING=y
+CONFIG_ZONE_DEVICE=y
+CONFIG_DEVICE_PRIVATE=y
+CONFIG_ANON_VMA_NAME=y
+CONFIG_USERFAULTFD=y
+CONFIG_LRU_GEN=y
+CONFIG_LRU_GEN_ENABLED=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_XFRM_USER=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 12/15] x86/kconfig/64: Enable popular kernel debugging options in the defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (10 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 11/15] x86/kconfig/64: Enable popular MM options " Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces " Ingo Molnar
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Ivan Shapovalov, Masahiro Yamada,
	Michal Marek

Since the x86 defconfig aims to be a distro kernel work-alike with
fewer drivers and a shorter build time, enable a handful of
kernel debugging options that are typically enabled on major Linux
distributions.

The options enabled is a superset of the latest Ubuntu and Fedora
kernel debugging configs, using Ubuntu's config-6.11.0-24-generic
file, Fedora's kernel-x86_64-fedora.config and RHEL's
kernel-x86_64-rhel.config from kernel-ark.git.

Notable features enabled:

 - CONFIG_UBSAN=y:

     Despite the runtime overhead, UBSAN is actively enabled
     in all 3 major Linux distros I checked, so we want it
     enabled in the defconfig as well - to better see the
     consequences.

 - CONFIG_DEBUG_SHIRQ=y:

     Fedora/RHEL have this enabled, while Ubuntu has it disabled.

 - CONFIG_LIST_HARDENED=y:

     Fedora/RHEL have CONFIG_DEBUG_LIST enabled, while Ubuntu has
     it disabled, so pick the lightweight LIST_HARDENED variant.

 - CONFIG_FUNCTION_PROFILER=y:

     This is enabled on all distros I checked as well.

DEBUGINFO is still disabled, despite enabled in all Linux distros,
because the ~10x .o bloat is still just so painful on anything
but the most powerful build boxes.

Note that while the following features seemingly get removed from
the defconfig :

  - CONFIG_BLK_DEV_INITRD=y
  - CONFIG_KPROBES=y
  - CONFIG_MAGIC_SYSRQ=y

they are actually still enabled in the actual .config, because they
get selected by other options indirectly.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ivan Shapovalov <intelfx@intelfx.name>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/configs/defconfig.x86_64 | 46 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 43 insertions(+), 3 deletions(-)

diff --git a/arch/x86/configs/defconfig.x86_64 b/arch/x86/configs/defconfig.x86_64
index 02c4ba79946b..3c4a03633328 100644
--- a/arch/x86/configs/defconfig.x86_64
+++ b/arch/x86/configs/defconfig.x86_64
@@ -31,7 +31,6 @@ CONFIG_CGROUP_PERF=y
 CONFIG_CGROUP_BPF=y
 CONFIG_CGROUP_MISC=y
 CONFIG_CGROUP_DEBUG=y
-CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
 CONFIG_KEXEC=y
@@ -68,7 +67,6 @@ CONFIG_KVM_INTEL=y
 CONFIG_KVM_AMD=y
 CONFIG_KVM_XEN=y
 CONFIG_KVM_MAX_NR_VCPUS=4096
-CONFIG_KPROBES=y
 CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
@@ -303,14 +301,56 @@ CONFIG_SECURITY=y
 CONFIG_SECURITY_NETWORK=y
 CONFIG_SECURITY_SELINUX=y
 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_LIST_HARDENED=y
 CONFIG_PRINTK_TIME=y
+CONFIG_BOOT_PRINTK_DELAY=y
+CONFIG_DYNAMIC_DEBUG=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_HEADERS_INSTALL=y
+CONFIG_DEBUG_SECTION_MISMATCH=y
+CONFIG_KGDB=y
+CONFIG_KGDB_TESTS=y
+CONFIG_KGDB_LOW_LEVEL_TRAP=y
+CONFIG_KGDB_KDB=y
+CONFIG_KDB_KEYBOARD=y
+CONFIG_UBSAN=y
+CONFIG_UBSAN_SHIFT=y
+CONFIG_PAGE_OWNER=y
+CONFIG_PAGE_POISONING=y
 CONFIG_DEBUG_WX=y
+CONFIG_PER_VMA_LOCK_STATS=y
 CONFIG_DEBUG_STACK_USAGE=y
+CONFIG_SCHED_STACK_END_CHECK=y
+CONFIG_KFENCE=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_PANIC_ON_OOPS=y
+CONFIG_HARDLOCKUP_DETECTOR=y
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
+CONFIG_WQ_CPU_INTENSIVE_REPORT=y
 CONFIG_SCHEDSTATS=y
+CONFIG_NMI_CHECK_CPU=y
+CONFIG_RCU_CPU_STALL_CPUTIME=y
+CONFIG_BOOTTIME_TRACING=y
+CONFIG_FUNCTION_GRAPH_RETVAL=y
+CONFIG_FPROBE=y
+CONFIG_FUNCTION_PROFILER=y
+CONFIG_STACK_TRACER=y
+CONFIG_SCHED_TRACER=y
+CONFIG_HWLAT_TRACER=y
+CONFIG_TIMERLAT_TRACER=y
+CONFIG_MMIOTRACE=y
+CONFIG_FTRACE_SYSCALLS=y
 CONFIG_BLK_DEV_IO_TRACE=y
+CONFIG_USER_EVENTS=y
+CONFIG_HIST_TRIGGERS=y
+CONFIG_TRACE_EVENT_INJECT=y
+CONFIG_RV=y
+CONFIG_RV_MON_WWNR=y
 CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
 CONFIG_EARLY_PRINTK_DBGP=y
+CONFIG_EARLY_PRINTK_USB_XDBC=y
 CONFIG_DEBUG_BOOT_PARAMS=y
 CONFIG_DEBUG_ENTRY=y
+CONFIG_FUNCTION_ERROR_INJECTION=y
+CONFIG_MEMTEST=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (11 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 12/15] x86/kconfig/64: Enable popular kernel debugging " Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-07  3:00   ` Yafang Shao
                     ` (2 more replies)
  2025-05-06 17:09 ` [PATCH 14/15] x86/kconfig/64: Enable popular generic kernel " Ingo Molnar
  2025-05-06 17:09 ` [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig Ingo Molnar
  14 siblings, 3 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

Since the x86 defconfig aims to be a distro kernel work-alike with
fewer drivers and a shorter build time, enable a handful of
popular scheduler and cgroups options that are typically enabled
on major Linux distributions.

The options enabled is a superset of the latest Ubuntu and Fedora
kernel debugging configs, using Ubuntu's config-6.11.0-24-generic
file, Fedora's kernel-x86_64-fedora.config and RHEL's
kernel-x86_64-rhel.config from kernel-ark.git.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/configs/defconfig.x86_64 | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/arch/x86/configs/defconfig.x86_64 b/arch/x86/configs/defconfig.x86_64
index 3c4a03633328..225aed921e21 100644
--- a/arch/x86/configs/defconfig.x86_64
+++ b/arch/x86/configs/defconfig.x86_64
@@ -2,6 +2,7 @@ CONFIG_WERROR=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_AUDIT=y
+# CONFIG_CONTEXT_TRACKING_USER_FORCE is not set
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BPF_SYSCALL=y
@@ -11,26 +12,45 @@ CONFIG_BPF_PRELOAD=y
 CONFIG_BPF_PRELOAD_UMD=y
 CONFIG_BPF_LSM=y
 CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_SCHED_CORE=y
+CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_IRQ_TIME_ACCOUNTING=y
 CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_TASKSTATS=y
 CONFIG_TASK_DELAY_ACCT=y
 CONFIG_TASK_XACCT=y
 CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_PSI=y
+CONFIG_PSI_DEFAULT_DISABLED=y
 CONFIG_LOG_BUF_SHIFT=18
-CONFIG_CGROUPS=y
+CONFIG_PRINTK_INDEX=y
+CONFIG_UCLAMP_TASK=y
+CONFIG_NUMA_BALANCING=y
+CONFIG_MEMCG=y
+CONFIG_MEMCG_V1=y
 CONFIG_BLK_CGROUP=y
-CONFIG_CGROUP_SCHED=y
+CONFIG_CFS_BANDWIDTH=y
+CONFIG_UCLAMP_TASK_GROUP=y
 CONFIG_CGROUP_PIDS=y
 CONFIG_CGROUP_RDMA=y
+CONFIG_CGROUP_DMEM=y
 CONFIG_CGROUP_FREEZER=y
 CONFIG_CGROUP_HUGETLB=y
 CONFIG_CPUSETS=y
+CONFIG_CPUSETS_V1=y
 CONFIG_CGROUP_DEVICE=y
 CONFIG_CGROUP_CPUACCT=y
 CONFIG_CGROUP_PERF=y
 CONFIG_CGROUP_BPF=y
 CONFIG_CGROUP_MISC=y
 CONFIG_CGROUP_DEBUG=y
+CONFIG_NAMESPACES=y
+CONFIG_USER_NS=y
+CONFIG_CHECKPOINT_RESTORE=y
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_SYSFS_SYSCALL=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
 CONFIG_KEXEC=y
@@ -305,7 +325,6 @@ CONFIG_LIST_HARDENED=y
 CONFIG_PRINTK_TIME=y
 CONFIG_BOOT_PRINTK_DELAY=y
 CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_HEADERS_INSTALL=y
 CONFIG_DEBUG_SECTION_MISMATCH=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 14/15] x86/kconfig/64: Enable popular generic kernel options in the defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (12 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces " Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-06 17:09 ` [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig Ingo Molnar
  14 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

This is the last set of options picked up from major Linux distributions:

 - CONFIG_UAPI_HEADER_TEST=y

    x86 developers frequently modify UAPI headers during development,
    make sure they get tested.

 - CONFIG_WATCH_QUEUE=y

    All major distros have general notification queue support enabled.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/configs/defconfig.x86_64 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/configs/defconfig.x86_64 b/arch/x86/configs/defconfig.x86_64
index 225aed921e21..11095e7569a8 100644
--- a/arch/x86/configs/defconfig.x86_64
+++ b/arch/x86/configs/defconfig.x86_64
@@ -1,6 +1,8 @@
 CONFIG_WERROR=y
+CONFIG_UAPI_HEADER_TEST=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_WATCH_QUEUE=y
 CONFIG_AUDIT=y
 # CONFIG_CONTEXT_TRACKING_USER_FORCE is not set
 CONFIG_NO_HZ=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig
  2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
                   ` (13 preceding siblings ...)
  2025-05-06 17:09 ` [PATCH 14/15] x86/kconfig/64: Enable popular generic kernel " Ingo Molnar
@ 2025-05-06 17:09 ` Ingo Molnar
  2025-05-07  5:27   ` Arnd Bergmann
  14 siblings, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2025-05-06 17:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ingo Molnar, Ard Biesheuvel,
	Arnd Bergmann, David Woodhouse, Masahiro Yamada, Michal Marek

Just a mechanic synchronization of kernel options enabled: nobody
really develops kernel features on x86-32 anymore, so make sure the
defconfig is roughly equivalent to the 64-bit one, so that testing
doesn't cover some combination that nobody cares about.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
---
 arch/x86/configs/defconfig.x86_32 | 116 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 110 insertions(+), 6 deletions(-)

diff --git a/arch/x86/configs/defconfig.x86_32 b/arch/x86/configs/defconfig.x86_32
index e983f1db22dd..26a0fc03d642 100644
--- a/arch/x86/configs/defconfig.x86_32
+++ b/arch/x86/configs/defconfig.x86_32
@@ -1,37 +1,63 @@
 CONFIG_WERROR=y
+CONFIG_UAPI_HEADER_TEST=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_WATCH_QUEUE=y
 CONFIG_USELIB=y
 CONFIG_AUDIT=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_BPF_SYSCALL=y
+CONFIG_BPF_JIT=y
+CONFIG_BPF_JIT_ALWAYS_ON=y
+CONFIG_BPF_PRELOAD=y
+CONFIG_BPF_PRELOAD_UMD=y
+CONFIG_BPF_LSM=y
 CONFIG_PREEMPT_VOLUNTARY=y
+CONFIG_SCHED_CORE=y
+CONFIG_IRQ_TIME_ACCOUNTING=y
 CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_TASKSTATS=y
 CONFIG_TASK_DELAY_ACCT=y
 CONFIG_TASK_XACCT=y
 CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_PSI=y
+CONFIG_PSI_DEFAULT_DISABLED=y
 CONFIG_LOG_BUF_SHIFT=18
-CONFIG_CGROUPS=y
+CONFIG_PRINTK_INDEX=y
+CONFIG_UCLAMP_TASK=y
+CONFIG_MEMCG=y
+CONFIG_MEMCG_V1=y
 CONFIG_BLK_CGROUP=y
-CONFIG_CGROUP_SCHED=y
+CONFIG_CFS_BANDWIDTH=y
+CONFIG_UCLAMP_TASK_GROUP=y
 CONFIG_CGROUP_PIDS=y
 CONFIG_CGROUP_RDMA=y
+CONFIG_CGROUP_DMEM=y
 CONFIG_CGROUP_FREEZER=y
 CONFIG_CGROUP_HUGETLB=y
 CONFIG_CPUSETS=y
+CONFIG_CPUSETS_V1=y
 CONFIG_CGROUP_DEVICE=y
 CONFIG_CGROUP_CPUACCT=y
 CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_BPF=y
 CONFIG_CGROUP_MISC=y
 CONFIG_CGROUP_DEBUG=y
-CONFIG_BLK_DEV_INITRD=y
+CONFIG_NAMESPACES=y
+CONFIG_USER_NS=y
+CONFIG_CHECKPOINT_RESTORE=y
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_SYSFS_SYSCALL=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_PROFILING=y
 CONFIG_KEXEC=y
 CONFIG_SMP=y
 CONFIG_HYPERVISOR_GUEST=y
 CONFIG_PARAVIRT=y
+CONFIG_PARAVIRT_SPINLOCKS=y
 CONFIG_NR_CPUS=8
 CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
 CONFIG_X86_MSR=y
@@ -50,7 +76,11 @@ CONFIG_ACPI_BGRT=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_X86_ACPI_CPUFREQ=y
-CONFIG_KPROBES=y
+CONFIG_KVM=y
+CONFIG_KVM_INTEL=y
+CONFIG_KVM_AMD=y
+CONFIG_KVM_XEN=y
+CONFIG_KVM_MAX_NR_VCPUS=4096
 CONFIG_JUMP_LABEL=y
 CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_MODULES=y
@@ -60,7 +90,23 @@ CONFIG_BLK_CGROUP_IOLATENCY=y
 CONFIG_BLK_CGROUP_IOCOST=y
 CONFIG_BLK_CGROUP_IOPRIO=y
 CONFIG_BINFMT_MISC=y
+CONFIG_ZSWAP=y
+CONFIG_SLAB_FREELIST_RANDOM=y
+CONFIG_SLAB_FREELIST_HARDENED=y
+# CONFIG_SLAB_BUCKETS is not set
 # CONFIG_COMPAT_BRK is not set
+CONFIG_PAGE_REPORTING=y
+CONFIG_KSM=y
+CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
+CONFIG_MEMORY_FAILURE=y
+CONFIG_HWPOISON_INJECT=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
+CONFIG_IDLE_PAGE_TRACKING=y
+CONFIG_ANON_VMA_NAME=y
+CONFIG_USERFAULTFD=y
+CONFIG_LRU_GEN=y
+CONFIG_LRU_GEN_ENABLED=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_XFRM_USER=y
@@ -120,6 +166,7 @@ CONFIG_CFG80211=y
 CONFIG_MAC80211=y
 CONFIG_MAC80211_LEDS=y
 CONFIG_RFKILL=y
+CONFIG_RFKILL_INPUT=y
 CONFIG_NET_9P=y
 CONFIG_NET_9P_VIRTIO=y
 CONFIG_PCI=y
@@ -189,6 +236,8 @@ CONFIG_SERIAL_8250_RSA=y
 CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_VIRTIO_CONSOLE=y
 CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_INTEL is not set
+# CONFIG_HW_RANDOM_AMD is not set
 CONFIG_NVRAM=y
 CONFIG_HPET=y
 # CONFIG_HPET_MMAP is not set
@@ -208,7 +257,19 @@ CONFIG_SND_SEQ_DUMMY=y
 CONFIG_SND_HDA_INTEL=y
 CONFIG_SND_HDA_HWDEP=y
 CONFIG_HIDRAW=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_EZKEY=y
 CONFIG_HID_GYRATION=y
+CONFIG_HID_ITE=y
+CONFIG_HID_KENSINGTON=y
+CONFIG_HID_REDRAGON=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
 CONFIG_HID_NTRIG=y
 CONFIG_HID_PANTHERLORD=y
 CONFIG_PANTHERLORD_FF=y
@@ -234,6 +295,8 @@ CONFIG_DMADEVICES=y
 CONFIG_VIRTIO_PCI=y
 CONFIG_VIRTIO_INPUT=y
 CONFIG_EEEPC_LAPTOP=y
+CONFIG_INTEL_IOMMU=y
+# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
 CONFIG_EXT4_FS=y
 CONFIG_EXT4_FS_POSIX_ACL=y
 CONFIG_EXT4_FS_SECURITY=y
@@ -264,14 +327,55 @@ CONFIG_SECURITY_NETWORK=y
 CONFIG_SECURITY_SELINUX=y
 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_KERNEL=y
+CONFIG_BOOT_PRINTK_DELAY=y
+CONFIG_DYNAMIC_DEBUG=y
 CONFIG_FRAME_WARN=1024
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_HEADERS_INSTALL=y
+CONFIG_DEBUG_SECTION_MISMATCH=y
+CONFIG_KGDB=y
+CONFIG_KGDB_TESTS=y
+CONFIG_KGDB_LOW_LEVEL_TRAP=y
+CONFIG_KGDB_KDB=y
+CONFIG_KDB_KEYBOARD=y
+CONFIG_UBSAN=y
+CONFIG_UBSAN_SHIFT=y
+CONFIG_PAGE_OWNER=y
+CONFIG_PAGE_POISONING=y
 CONFIG_DEBUG_STACK_USAGE=y
+CONFIG_SCHED_STACK_END_CHECK=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_KFENCE=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_PANIC_ON_OOPS=y
+CONFIG_HARDLOCKUP_DETECTOR=y
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC=y
+# CONFIG_DETECT_HUNG_TASK is not set
+CONFIG_WQ_CPU_INTENSIVE_REPORT=y
 CONFIG_SCHEDSTATS=y
+CONFIG_NMI_CHECK_CPU=y
+CONFIG_DEBUG_LIST=y
+CONFIG_RCU_CPU_STALL_CPUTIME=y
+CONFIG_BOOTTIME_TRACING=y
+CONFIG_FUNCTION_GRAPH_RETVAL=y
+CONFIG_FUNCTION_PROFILER=y
+CONFIG_STACK_TRACER=y
+CONFIG_SCHED_TRACER=y
+CONFIG_HWLAT_TRACER=y
+CONFIG_TIMERLAT_TRACER=y
+CONFIG_MMIOTRACE=y
+CONFIG_FTRACE_SYSCALLS=y
 CONFIG_BLK_DEV_IO_TRACE=y
+CONFIG_USER_EVENTS=y
+CONFIG_HIST_TRIGGERS=y
+CONFIG_TRACE_EVENT_INJECT=y
+CONFIG_RV=y
+CONFIG_RV_MON_WWNR=y
 CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
 CONFIG_EARLY_PRINTK_DBGP=y
+CONFIG_EARLY_PRINTK_USB_XDBC=y
 CONFIG_DEBUG_BOOT_PARAMS=y
 CONFIG_DEBUG_ENTRY=y
 CONFIG_UNWINDER_FRAME_POINTER=y
+CONFIG_FUNCTION_ERROR_INJECTION=y
+CONFIG_MEMTEST=y
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-06 17:09 ` [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces " Ingo Molnar
@ 2025-05-07  3:00   ` Yafang Shao
  2025-05-07  7:06     ` Ingo Molnar
  2025-05-07  5:11   ` Arnd Bergmann
  2025-05-28 17:22   ` Michal Koutný
  2 siblings, 1 reply; 39+ messages in thread
From: Yafang Shao @ 2025-05-07  3:00 UTC (permalink / raw)
  To: mingo
  Cc: ardb, arnd, bp, dwmw, hpa, linux-kernel, michal.lkml, peterz,
	tglx, torvalds, vkuznets, yamada.masahiro

Hello Mingo,

 > +CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
 > +CONFIG_IRQ_TIME_ACCOUNTING=y

Enabling CONFIG_IRQ_TIME_ACCOUNTING=y can lead to user-visible 
behavioral changes. For more context, please refer to the related 
discussion here: 
https://lore.kernel.org/all/20241222024734.63894-1-laoar.shao@gmail.com/ .

If we decide to enable it by default, we should clearly document this 
behavior change. Below is the patch I wrote earlier but haven’t sent out 
for review yet.

----

Subject: [PATCH] init/Kconfig: document behavior change when enabling
  IRQ_TIME_ACCOUNTING

After we enabled CONFIG_IRQ_TIME_ACCOUNTING, we noticed that the IRQ
usage is not accounted to the tasks and thus not accounted to the CPU
cgroup neither. This behavior change results in issues [0] in our
production servers and finally we have to revert it.

We'd better clearly document this behavior change in case it might
matter to the user.

Link: 
https://lore.kernel.org/all/20241222024734.63894-1-laoar.shao@gmail.com/ [0]
Suggested-by: "Michal Koutný" <mkoutny@suse.com>
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
---
  init/Kconfig | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/init/Kconfig b/init/Kconfig
index a20e6efd3f0f..191df0b5cf1c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -563,6 +563,14 @@ config IRQ_TIME_ACCOUNTING
        transitions between softirq and hardirq state, so there can be a
        small performance impact.

+      Enabling IRQ_TIME_ACCOUNTING excludes IRQ usage from the CPU usage
+      statistics of individual tasks and, consequently, it is not accounted
+      for in CPU cgroups. As a result, a task's CPU usage will accurately
+      reflect only its user time and system time. IRQ usage is instead
+      attributed at the global level and can be observed in metrics such as
+      /proc/stat or, potentially, at the cgroup level in files like
+      irq.pressure.
+
        If in doubt, say N here.

  config HAVE_SCHED_AVG_IRQ

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-06 17:09 ` [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces " Ingo Molnar
  2025-05-07  3:00   ` Yafang Shao
@ 2025-05-07  5:11   ` Arnd Bergmann
  2025-05-07 16:09     ` Ingo Molnar
  2025-05-28 17:22   ` Michal Koutný
  2 siblings, 1 reply; 39+ messages in thread
From: Arnd Bergmann @ 2025-05-07  5:11 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: H. Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ard Biesheuvel,
	David Woodhouse, Masahiro Yamada, Michal Marek

On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
> Since the x86 defconfig aims to be a distro kernel work-alike with
> fewer drivers and a shorter build time, enable a handful of
> popular scheduler and cgroups options that are typically enabled
> on major Linux distributions.
>
> The options enabled is a superset of the latest Ubuntu and Fedora
> kernel debugging configs, using Ubuntu's config-6.11.0-24-generic
> file, Fedora's kernel-x86_64-fedora.config and RHEL's
> kernel-x86_64-rhel.config from kernel-ark.git.

I think having a way to get something close to a distro config
is super userful for common options like this, but I wonder if
we could turn this into a kernel/configs/*.config fragment
instead that gets shared across architectures.

> +CONFIG_SYSFS_SYSCALL=y
> +CONFIG_EXPERT=y
>  CONFIG_KALLSYMS_ALL=y
>  CONFIG_PROFILING=y

I really don't like enabling CONFIG_EXPERT=y in a generic
defconfig. What changes if you turn this off?

Based on the help text for CONFIG_EXPERT, nothing we
consider the default should ever be guarded by it. If there
is something that distros commonly that is prevented by
EXPERT=n, it would be better to relay the dependency on that
particular thing.

    Arnd

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig
  2025-05-06 17:09 ` [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig Ingo Molnar
@ 2025-05-07  5:27   ` Arnd Bergmann
  2025-05-07 17:41     ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnd Bergmann @ 2025-05-07  5:27 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: H. Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ard Biesheuvel,
	David Woodhouse, Masahiro Yamada, Michal Marek

On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
> Just a mechanic synchronization of kernel options enabled: nobody
> really develops kernel features on x86-32 anymore, so make sure the
> defconfig is roughly equivalent to the 64-bit one, so that testing
> doesn't cover some combination that nobody cares about.

What is the size increase here? Some of the options you enable
look like they might add a lot of code to the vmlinux binary,
and 32-bit are often might more limited than 64-bit ones.

IOW, is your goal here to keep something that works on actual
32-bit machines, or do you want something that will in practice
run on 64-bit machines and have a comparable feature set?

> @@ -50,7 +76,11 @@ CONFIG_ACPI_BGRT=y
>  CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
>  CONFIG_CPU_FREQ_GOV_ONDEMAND=y
>  CONFIG_X86_ACPI_CPUFREQ=y
> -CONFIG_KPROBES=y
> +CONFIG_KVM=y
> +CONFIG_KVM_INTEL=y
> +CONFIG_KVM_AMD=y
> +CONFIG_KVM_XEN=y
> +CONFIG_KVM_MAX_NR_VCPUS=4096
>  CONFIG_JUMP_LABEL=y
>  CONFIG_COMPAT_32BIT_TIME=y
>  CONFIG_MODULES=y

I have a series to completely remove KVM support for 32-bit. There
is one powerpc platform that may keep it, but there is really
no point in enabling it here when there are practically zero
32-bit machines that can use it.

> @@ -234,6 +295,8 @@ CONFIG_DMADEVICES=y
>  CONFIG_VIRTIO_PCI=y
>  CONFIG_VIRTIO_INPUT=y
>  CONFIG_EEEPC_LAPTOP=y
> +CONFIG_INTEL_IOMMU=y
> +# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set

I'm pretty sure the Intel IOMMU was only in 64-bit chips.

    Arnd

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 01/15] x86/kconfig/64: Refresh defconfig
  2025-05-06 17:09 ` [PATCH 01/15] x86/kconfig/64: Refresh defconfig Ingo Molnar
@ 2025-05-07  5:31   ` Arnd Bergmann
  2025-05-07  6:22     ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnd Bergmann @ 2025-05-07  5:31 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: H. Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ard Biesheuvel,
	David Woodhouse, Masahiro Yamada, Michal Marek

On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
> @@ -63,9 +62,7 @@ CONFIG_BINFMT_MISC=y
>  # CONFIG_COMPAT_BRK is not set
>  CONFIG_NET=y
>  CONFIG_PACKET=y
> -CONFIG_UNIX=y
>  CONFIG_XFRM_USER=y
> -CONFIG_INET=y
>  CONFIG_IP_MULTICAST=y
>  CONFIG_IP_ADVANCED_ROUTER=y
>  CONFIG_IP_MULTIPLE_TABLES=y

Any idea what happened here? I don't see anything selecting UNIX
and INET, and leaving them at the default-off state seems like a
bad idea.

      Arnd

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture
  2025-05-06 17:09 ` [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture Ingo Molnar
@ 2025-05-07  5:44   ` Arnd Bergmann
  2025-05-07  6:35     ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnd Bergmann @ 2025-05-07  5:44 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: H. Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ard Biesheuvel,
	David Woodhouse, Masahiro Yamada, Michal Marek

On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
> 
>  # 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

Would it be possible to just remove the entire SRCARCH hack
for x86? It's not clear from the changelog what the intention
was in 2007 when it was added, but my impression was that
this should be a temporary workaround to users doing
'make defconfig' on i386 would still get a 32-bit config
by default and didn't have to change there scripts.

I would guess that even in a 'setarch --32bit' environment,
most users today would want to build a 64-bit kernel, having
the special case for that seems to add more confusion that
it avoids.

Also, I don't think there are any systems that return
'x86_32' from 'uname -m', so your added special case
would never be used by default, only when cross-compiling
from some other architecture.

      Arnd

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 01/15] x86/kconfig/64: Refresh defconfig
  2025-05-07  5:31   ` Arnd Bergmann
@ 2025-05-07  6:22     ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-07  6:22 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kernel, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, David Woodhouse, Masahiro Yamada, Michal Marek


* Arnd Bergmann <arnd@arndb.de> wrote:

> On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
> > @@ -63,9 +62,7 @@ CONFIG_BINFMT_MISC=y
> >  # CONFIG_COMPAT_BRK is not set
> >  CONFIG_NET=y
> >  CONFIG_PACKET=y
> > -CONFIG_UNIX=y
> >  CONFIG_XFRM_USER=y
> > -CONFIG_INET=y
> >  CONFIG_IP_MULTICAST=y
> >  CONFIG_IP_ADVANCED_ROUTER=y
> >  CONFIG_IP_MULTIPLE_TABLES=y
> 
> Any idea what happened here? I don't see anything selecting UNIX
> and INET, and leaving them at the default-off state seems like a
> bad idea.

I think this is a side effect of having NET_9P support enabled, which 
option comes with:

        imply INET
        imply UNIX

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture
  2025-05-07  5:44   ` Arnd Bergmann
@ 2025-05-07  6:35     ` Ingo Molnar
  2025-05-09 12:04       ` David Laight
  2025-05-09 18:05       ` Arnd Bergmann
  0 siblings, 2 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-07  6:35 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kernel, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, David Woodhouse, Masahiro Yamada, Michal Marek


* Arnd Bergmann <arnd@arndb.de> wrote:

> On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
> > 
> >  # 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
> 
> Would it be possible to just remove the entire SRCARCH hack for x86? 
> It's not clear from the changelog what the intention was in 2007 when 
> it was added, but my impression was that this should be a temporary 
> workaround to users doing 'make defconfig' on i386 would still get a 
> 32-bit config by default and didn't have to change there scripts.

Correct, this was done during the x86 unification: a significant number 
of kernel developers were still using 32-bit x86 systems, and they 
expected the host architecture to be used by default like it was when 
it lived in arch/i386/.

Ie. it was a 'seamless x86 unification' build feature.

I'd be glad to add a tested patch for SRCARCH hack removal, which 
should simplify things a bit.

> Also, I don't think there are any systems that return 'x86_32' from 
> 'uname -m', so your added special case would never be used by 
> default, only when cross-compiling from some other architecture.

No, on most 32-bit systems 'uname -m' returns 'i686', which we cannot 
use straight away anyway. And it looked a bit silly to me for us to 
fudge over the architecture from 'i686' to 'i386', when we haven't 
supported i386 for quite some while and are now working on i486 
removal...

Let's just have x86_32 as the internal primary subarchitecture name, 
with support for historic aliases like 'i386'. That it cleans up things 
for defconfig naming is a bonus.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-07  3:00   ` Yafang Shao
@ 2025-05-07  7:06     ` Ingo Molnar
  2025-05-07 11:42       ` Yafang Shao
  0 siblings, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2025-05-07  7:06 UTC (permalink / raw)
  To: Yafang Shao, Peter Zijlstra
  Cc: ardb, arnd, bp, dwmw, hpa, linux-kernel, michal.lkml, peterz,
	tglx, torvalds, vkuznets, yamada.masahiro


* Yafang Shao <laoar.shao@gmail.com> wrote:

> Hello Mingo,
> 
> > +CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
> > +CONFIG_IRQ_TIME_ACCOUNTING=y
> 
> Enabling CONFIG_IRQ_TIME_ACCOUNTING=y can lead to user-visible behavioral
> changes. For more context, please refer to the related discussion here:
> https://lore.kernel.org/all/20241222024734.63894-1-laoar.shao@gmail.com/ .

Yeah. I actually agree with your series. It (re-)includes IRQ/softirq 
time in task CPU usage statistics even under IRQ_TIME_ACCOUNTING=y, 
while still keeping the finegrained IRQ/softirq statistics as well, 
correct?

The Kconfig option is also arguably rather misleading:

config IRQ_TIME_ACCOUNTING
        bool "Fine granularity task level IRQ time accounting"
        depends on HAVE_IRQ_TIME_ACCOUNTING && !VIRT_CPU_ACCOUNTING_NATIVE
        help
          Select this option to enable fine granularity task irq time
          accounting. This is done by reading a timestamp on each
          transitions between softirq and hardirq state, so there can be a
          small performance impact.

It only warns about a small performance impact, but doesn't warn that 
CPU accounting is changed in an incompatible fashion that surprises 
tooling...

But I think we should probably treat this as a bug, not as lack of 
documentation. Peter, do you concur?

> If we decide to enable it by default, we should clearly document this 
> behavior change. Below is the patch I wrote earlier but haven’t sent 
> out for review yet.

Note that it's not enabled by default - this patch is just about the 
x86 defconfig.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-07  7:06     ` Ingo Molnar
@ 2025-05-07 11:42       ` Yafang Shao
  2025-05-07 16:22         ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Yafang Shao @ 2025-05-07 11:42 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Peter Zijlstra, ardb, arnd, bp, dwmw, hpa, linux-kernel,
	michal.lkml, tglx, torvalds, vkuznets, yamada.masahiro

On Wed, May 7, 2025 at 3:06 PM Ingo Molnar <mingo@kernel.org> wrote:
>
>
> * Yafang Shao <laoar.shao@gmail.com> wrote:
>
> > Hello Mingo,
> >
> > > +CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
> > > +CONFIG_IRQ_TIME_ACCOUNTING=y
> >
> > Enabling CONFIG_IRQ_TIME_ACCOUNTING=y can lead to user-visible behavioral
> > changes. For more context, please refer to the related discussion here:
> > https://lore.kernel.org/all/20241222024734.63894-1-laoar.shao@gmail.com/ .
>
> Yeah. I actually agree with your series. It (re-)includes IRQ/softirq
> time in task CPU usage statistics even under IRQ_TIME_ACCOUNTING=y,
> while still keeping the finegrained IRQ/softirq statistics as well,
> correct?

Correct.

>
> The Kconfig option is also arguably rather misleading:
>
> config IRQ_TIME_ACCOUNTING
>         bool "Fine granularity task level IRQ time accounting"
>         depends on HAVE_IRQ_TIME_ACCOUNTING && !VIRT_CPU_ACCOUNTING_NATIVE
>         help
>           Select this option to enable fine granularity task irq time
>           accounting. This is done by reading a timestamp on each
>           transitions between softirq and hardirq state, so there can be a
>           small performance impact.
>
> It only warns about a small performance impact, but doesn't warn that
> CPU accounting is changed in an incompatible fashion that surprises
> tooling...

Yes, this breaks our userspace tools.


>
> But I think we should probably treat this as a bug, not as lack of
> documentation. Peter, do you concur?
>
> > If we decide to enable it by default, we should clearly document this
> > behavior change. Below is the patch I wrote earlier but haven’t sent
> > out for review yet.
>
> Note that it's not enabled by default - this patch is just about the
> x86 defconfig.
>
> Thanks,
>
>         Ingo



--
Regards
Yafang

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-07  5:11   ` Arnd Bergmann
@ 2025-05-07 16:09     ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-07 16:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kernel, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, David Woodhouse, Masahiro Yamada, Michal Marek


* Arnd Bergmann <arnd@arndb.de> wrote:

> > +CONFIG_SYSFS_SYSCALL=y
> > +CONFIG_EXPERT=y
> >  CONFIG_KALLSYMS_ALL=y
> >  CONFIG_PROFILING=y
> 
> I really don't like enabling CONFIG_EXPERT=y in a generic
> defconfig. What changes if you turn this off?

That's a good question.

Disabling it gives me material changes for 4 options:

	--- .config.before
	+++ .config.after
	-CONFIG_EXPERT=y
	-CONFIG_ARCH_HAS_ZONE_DMA_SET=y
	+CONFIG_RFKILL_INPUT=y
	-CONFIG_PCIE_BUS_DEFAULT=y
	+CONFIG_DEBUG_MEMORY_INIT=y

1) CONFIG_DEBUG_MEMORY_INIT

The CONFIG_DEBUG_MEMORY_INIT default is super weird:

  config DEBUG_MEMORY_INIT
        bool "Debug memory initialisation" if EXPERT
        default !EXPERT

I this might in fact be a bug, and Ubuntu might have fallen victim to 
it:

  .config.fedora: CONFIG_DEBUG_MEMORY_INIT=y
  .config.ubuntu: # CONFIG_DEBUG_MEMORY_INIT is not set

I believe this should be 'default y', or 'default n'.

2) CONFIG_ARCH_HAS_ZONE_DMA_SET

This one is an interim Kconfig helper flag, and it's a bit weird as 
well:

  arch/x86/Kconfig:       select ARCH_HAS_ZONE_DMA_SET if EXPERT

I *think* the intent here is to make configurability of ZONE_DMA and 
ZONE_DMA32 dependent on EXPERT, while still giving architectures an 
opt-in as well:

 config ZONE_DMA
        bool "Support DMA zone" if ARCH_HAS_ZONE_DMA_SET
        default y if ARM64 || X86

 config ZONE_DMA32
        bool "Support DMA32 zone" if ARCH_HAS_ZONE_DMA_SET
        depends on !X86_32
        default y if ARM64

I think the better approach would be to make the EXPERT policy at the 
ZONE_DMA and ZONE_DMA32 level:

        bool "Support DMA zone" if ARCH_HAS_ZONE_DMA_SET && EXPERT

but it should be functionally equivalent.

3) RFKILL_INPUT

I think this one's a bug too:

 config RFKILL_INPUT
        bool "RF switch input support" if EXPERT
        depends on RFKILL
        depends on INPUT = y || RFKILL = INPUT
        default y if !EXPERT

Basically if you turn on EXPERT, the default changes from Y to N.

I think this should be a plain 'default y'.

4) CONFIG_PCIE_BUS_DEFAULT

I think this is quite confusing code as well:

  choice
        prompt "PCI Express hierarchy optimization setting"
        default PCIE_BUS_DEFAULT
        depends on PCI && EXPERT
        help
  ...

  config PCIE_BUS_DEFAULT
        bool "Default"
        depends on PCI
        help
          Default choice; ensure that the MPS matches upstream bridge.

  ...
  endchoice

So the intent here is clearly to steer users towards picking 
PCIE_BUS_DEFAULT.

But the 'depends' line turns off the option entirely on !EXPERT.

Which happens to work due to how the config options are used by the PCI 
code:

  #ifdef CONFIG_PCIE_BUS_TUNE_OFF
  enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF;
  #elif defined CONFIG_PCIE_BUS_SAFE
  enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_SAFE;
  #elif defined CONFIG_PCIE_BUS_PERFORMANCE
  enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PERFORMANCE;
  #elif defined CONFIG_PCIE_BUS_PEER2PEER
  enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PEER2PEER;
  #else
  enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_DEFAULT;
  #endif

But this is highly unintuitive IMO. A cleaner implementation would be 
to always have CONFIG_PCIE_BUS_DEFAULT enabled on !EXPERT, which can be 
done by making the configurability of the choice-list depend on EXPERT:

  choice
        prompt "PCI Express hierarchy optimization setting" if EXPERT
        default PCIE_BUS_DEFAULT
        depends on PCI

> Based on the help text for CONFIG_EXPERT, nothing we
> consider the default should ever be guarded by it. If there
> is something that distros commonly that is prevented by
> EXPERT=n, it would be better to relay the dependency on that
> particular thing.

I think distro kernel maintainers mainly inherited their old configs 
and aren't afraid of CONFIG_EXPERT.

Thus *all* major distros I checked have CONFIG_EXPERT enabled: Ubuntu, 
Fedora, Debian, you name it. So literally over 99% of our users use a 
kernel that has CONFIG_EXPERT=y in it. Which is perfectly fine, distro 
kernel maintainers *are* the ultimate experts in this matter - but 
their choices inevitably make it to users configuring their own 
kernels: if users type 'make localmodconfig' they'll have 
CONFIG_EXPERT=y.

So I don't think we should ostracize CONFIG_EXPERT too much. :)

Otherwise I think you were right: 2 out of 4 of the configuration 
settings that change due to EXPERT are outright bugs IMO, the other 2 
are weird code that could be done in a more standard fashion, resulting 
in an invariant .config when EXPERT is toggled on/off.

Also, I kinda don't mind having CONFIG_EXPERT=y in the kernel 
defconfig: it's a helper config for *kernel developers* who want to 
have finegrained control over debug facilities and other details, it's 
not something for users - the resulting kernels won't result in a fully 
working system on modern x86 systems.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-07 11:42       ` Yafang Shao
@ 2025-05-07 16:22         ` Ingo Molnar
  2025-05-08  5:56           ` Yafang Shao
  2025-05-22  5:49           ` Yafang Shao
  0 siblings, 2 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-07 16:22 UTC (permalink / raw)
  To: Yafang Shao
  Cc: Peter Zijlstra, ardb, arnd, bp, dwmw, hpa, linux-kernel,
	michal.lkml, tglx, torvalds, vkuznets, yamada.masahiro


* Yafang Shao <laoar.shao@gmail.com> wrote:

> On Wed, May 7, 2025 at 3:06 PM Ingo Molnar <mingo@kernel.org> wrote:
> >
> >
> > * Yafang Shao <laoar.shao@gmail.com> wrote:
> >
> > > Hello Mingo,
> > >
> > > > +CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
> > > > +CONFIG_IRQ_TIME_ACCOUNTING=y
> > >
> > > Enabling CONFIG_IRQ_TIME_ACCOUNTING=y can lead to user-visible behavioral
> > > changes. For more context, please refer to the related discussion here:
> > > https://lore.kernel.org/all/20241222024734.63894-1-laoar.shao@gmail.com/ .
> >
> > Yeah. I actually agree with your series. It (re-)includes IRQ/softirq
> > time in task CPU usage statistics even under IRQ_TIME_ACCOUNTING=y,
> > while still keeping the finegrained IRQ/softirq statistics as well,
> > correct?
> 
> Correct.
> 
> >
> > The Kconfig option is also arguably rather misleading:
> >
> > config IRQ_TIME_ACCOUNTING
> >         bool "Fine granularity task level IRQ time accounting"
> >         depends on HAVE_IRQ_TIME_ACCOUNTING && !VIRT_CPU_ACCOUNTING_NATIVE
> >         help
> >           Select this option to enable fine granularity task irq time
> >           accounting. This is done by reading a timestamp on each
> >           transitions between softirq and hardirq state, so there can be a
> >           small performance impact.
> >
> > It only warns about a small performance impact, but doesn't warn that
> > CPU accounting is changed in an incompatible fashion that surprises
> > tooling...
> 
> Yes, this breaks our userspace tools.

Okay, so 2 out of your 3 fixes are upstream already:

  763a744e24a8 ("sched: Don't account irq time if sched_clock_irqtime is disabled")
  a6fd16148fdd ("sched, psi: Don't account irq time if sched_clock_irqtime is disabled")

But we don't have this one yet:

  [PATCH v8 4/4] sched: Fix cgroup irq time for CONFIG_IRQ_TIME_ACCOUNTING

  https://lore.kernel.org/r/20250103022409.2544-5-laoar.shao@gmail.com

which is also essential to fully fix the tooling regression, right?

I think this last patch fell between the cracks, I didn't see any 
fundamental objections against the fix.

Since the patch does not apply cleanly anymore, mind sending a fresh 
-v9 version against v6.15-rc5 or so?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig
  2025-05-07  5:27   ` Arnd Bergmann
@ 2025-05-07 17:41     ` Ingo Molnar
  2025-05-07 17:55       ` Arnd Bergmann
  0 siblings, 1 reply; 39+ messages in thread
From: Ingo Molnar @ 2025-05-07 17:41 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kernel, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, David Woodhouse, Masahiro Yamada, Michal Marek


* Arnd Bergmann <arnd@arndb.de> wrote:

> On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
>
> > Just a mechanic synchronization of kernel options enabled: nobody 
> > really develops kernel features on x86-32 anymore, so make sure the 
> > defconfig is roughly equivalent to the 64-bit one, so that testing 
> > doesn't cover some combination that nobody cares about.
> 
> What is the size increase here?
>
> Some of the options you enable look like they might add a lot of code 
> to the vmlinux binary, and 32-bit are often might more limited than 
> 64-bit ones.

16.5MB -> 20.8MB, so well within usual RAM limits of x86-32 testing.

As a comparison, the last x86-32 Debian version's kernel, based on 
v6.1, has a vmlinux with 12.2MB .text and 4.2MB of modules loaded when 
booted into text mode, so 16.4MB total. This goes up substantially if 
any graphics is loaded.

> IOW, is your goal here to keep something that works on actual 32-bit 
> machines, or do you want something that will in practice run on 
> 64-bit machines and have a comparable feature set?

This will work on the vast majority of actual 32-bit machines in the 
i686 class and above, but the primary users are kernel developers doing 
test-runs on x86-64. For those who have less than 1GB of RAM, there's 
always tiny-base.config.

> > @@ -50,7 +76,11 @@ CONFIG_ACPI_BGRT=y
> >  CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
> >  CONFIG_CPU_FREQ_GOV_ONDEMAND=y
> >  CONFIG_X86_ACPI_CPUFREQ=y
> > -CONFIG_KPROBES=y
> > +CONFIG_KVM=y
> > +CONFIG_KVM_INTEL=y
> > +CONFIG_KVM_AMD=y
> > +CONFIG_KVM_XEN=y
> > +CONFIG_KVM_MAX_NR_VCPUS=4096
> >  CONFIG_JUMP_LABEL=y
> >  CONFIG_COMPAT_32BIT_TIME=y
> >  CONFIG_MODULES=y
> 
> I have a series to completely remove KVM support for 32-bit. There is 
> one powerpc platform that may keep it, but there is really no point 
> in enabling it here when there are practically zero 32-bit machines 
> that can use it.

That's OK, it will go away once it's removed.

This is an intentionally mechanical mirroring of the 64-bit Kconfig 
over to 32-bit, we've done this in the past as well.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig
  2025-05-07 17:41     ` Ingo Molnar
@ 2025-05-07 17:55       ` Arnd Bergmann
  0 siblings, 0 replies; 39+ messages in thread
From: Arnd Bergmann @ 2025-05-07 17:55 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, David Woodhouse, Masahiro Yamada, Michal Marek

On Wed, May 7, 2025, at 19:41, Ingo Molnar wrote:
> * Arnd Bergmann <arnd@arndb.de> wrote:
>
>> On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
>>
>> > Just a mechanic synchronization of kernel options enabled: nobody 
>> > really develops kernel features on x86-32 anymore, so make sure the 
>> > defconfig is roughly equivalent to the 64-bit one, so that testing 
>> > doesn't cover some combination that nobody cares about.
>> 
>> What is the size increase here?
>>
>> Some of the options you enable look like they might add a lot of code 
>> to the vmlinux binary, and 32-bit are often might more limited than 
>> 64-bit ones.
>
> 16.5MB -> 20.8MB, so well within usual RAM limits of x86-32 testing.

Right, that seems fine.

>> > @@ -50,7 +76,11 @@ CONFIG_ACPI_BGRT=y
>> >  CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
>> >  CONFIG_CPU_FREQ_GOV_ONDEMAND=y
>> >  CONFIG_X86_ACPI_CPUFREQ=y
>> > -CONFIG_KPROBES=y
>> > +CONFIG_KVM=y
>> > +CONFIG_KVM_INTEL=y
>> > +CONFIG_KVM_AMD=y
>> > +CONFIG_KVM_XEN=y
>> > +CONFIG_KVM_MAX_NR_VCPUS=4096
>> >  CONFIG_JUMP_LABEL=y
>> >  CONFIG_COMPAT_32BIT_TIME=y
>> >  CONFIG_MODULES=y
>> 
>> I have a series to completely remove KVM support for 32-bit. There is 
>> one powerpc platform that may keep it, but there is really no point 
>> in enabling it here when there are practically zero 32-bit machines 
>> that can use it.
>
> That's OK, it will go away once it's removed.
>
> This is an intentionally mechanical mirroring of the 64-bit Kconfig 
> over to 32-bit, we've done this in the past as well.

ok.

      Arnd

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-07 16:22         ` Ingo Molnar
@ 2025-05-08  5:56           ` Yafang Shao
  2025-05-22  5:49           ` Yafang Shao
  1 sibling, 0 replies; 39+ messages in thread
From: Yafang Shao @ 2025-05-08  5:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Peter Zijlstra, ardb, arnd, bp, dwmw, hpa, linux-kernel,
	michal.lkml, tglx, torvalds, vkuznets, yamada.masahiro

On Thu, May 8, 2025 at 12:23 AM Ingo Molnar <mingo@kernel.org> wrote:
>
>
> * Yafang Shao <laoar.shao@gmail.com> wrote:
>
> > On Wed, May 7, 2025 at 3:06 PM Ingo Molnar <mingo@kernel.org> wrote:
> > >
> > >
> > > * Yafang Shao <laoar.shao@gmail.com> wrote:
> > >
> > > > Hello Mingo,
> > > >
> > > > > +CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
> > > > > +CONFIG_IRQ_TIME_ACCOUNTING=y
> > > >
> > > > Enabling CONFIG_IRQ_TIME_ACCOUNTING=y can lead to user-visible behavioral
> > > > changes. For more context, please refer to the related discussion here:
> > > > https://lore.kernel.org/all/20241222024734.63894-1-laoar.shao@gmail.com/ .
> > >
> > > Yeah. I actually agree with your series. It (re-)includes IRQ/softirq
> > > time in task CPU usage statistics even under IRQ_TIME_ACCOUNTING=y,
> > > while still keeping the finegrained IRQ/softirq statistics as well,
> > > correct?
> >
> > Correct.
> >
> > >
> > > The Kconfig option is also arguably rather misleading:
> > >
> > > config IRQ_TIME_ACCOUNTING
> > >         bool "Fine granularity task level IRQ time accounting"
> > >         depends on HAVE_IRQ_TIME_ACCOUNTING && !VIRT_CPU_ACCOUNTING_NATIVE
> > >         help
> > >           Select this option to enable fine granularity task irq time
> > >           accounting. This is done by reading a timestamp on each
> > >           transitions between softirq and hardirq state, so there can be a
> > >           small performance impact.
> > >
> > > It only warns about a small performance impact, but doesn't warn that
> > > CPU accounting is changed in an incompatible fashion that surprises
> > > tooling...
> >
> > Yes, this breaks our userspace tools.
>
> Okay, so 2 out of your 3 fixes are upstream already:
>
>   763a744e24a8 ("sched: Don't account irq time if sched_clock_irqtime is disabled")
>   a6fd16148fdd ("sched, psi: Don't account irq time if sched_clock_irqtime is disabled")

Right.

>
> But we don't have this one yet:
>
>   [PATCH v8 4/4] sched: Fix cgroup irq time for CONFIG_IRQ_TIME_ACCOUNTING
>
>   https://lore.kernel.org/r/20250103022409.2544-5-laoar.shao@gmail.com
>
> which is also essential to fully fix the tooling regression, right?

This patch resolves the container tooling regression but does not
address tools depending on getrusage() for CPU measurement. The
getrusage() fix will be implemented in a subsequent patch.

>
> I think this last patch fell between the cracks, I didn't see any
> fundamental objections against the fix.
>
> Since the patch does not apply cleanly anymore, mind sending a fresh
> -v9 version against v6.15-rc5 or so?

I will send a new version.

-- 
Regards
Yafang

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 09/15] x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V
  2025-05-06 17:09 ` [PATCH 09/15] x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V Ingo Molnar
@ 2025-05-08  9:21   ` Jürgen Groß
  2025-05-15 13:19     ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Jürgen Groß @ 2025-05-08  9:21 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: H . Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Kirill A . Shutemov,
	Ard Biesheuvel, Arnd Bergmann, Carlos Bilbao, David Woodhouse,
	Elena Reshetova, Fei Li, Jan Kiszka, Masahiro Yamada,
	Michal Marek, Paolo Bonzini, Sean Christopherson,
	Stefano Stabellini


[-- Attachment #1.1.1: Type: text/plain, Size: 495 bytes --]

On 06.05.25 19:09, Ingo Molnar wrote:
> Since the x86 defconfig aims to be a distro kernel work-alike with
> fewer drivers and a shorter build time, refresh all the virtualization
> guest Kconfig features, enabling paravirt spinlocks, and
> enabling the guest support code for the following guests:
> 
>   - Xen
>   - Xen_PVH

With those it might be a good idea to add:

CONFIG_XEN_BLKDEV_FRONTEND=m
CONFIG_XEN_NETDEV_FRONTEND=m
CONFIG_HVC_XEN=y
CONFIG_XEN_BALLOON=y


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture
  2025-05-07  6:35     ` Ingo Molnar
@ 2025-05-09 12:04       ` David Laight
  2025-05-09 18:00         ` H. Peter Anvin
  2025-05-09 18:05       ` Arnd Bergmann
  1 sibling, 1 reply; 39+ messages in thread
From: David Laight @ 2025-05-09 12:04 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arnd Bergmann, linux-kernel, H. Peter Anvin, Linus Torvalds,
	Peter Zijlstra, Borislav Petkov, Thomas Gleixner,
	Vitaly Kuznetsov, Ard Biesheuvel, David Woodhouse,
	Masahiro Yamada, Michal Marek

On Wed, 7 May 2025 08:35:05 +0200
Ingo Molnar <mingo@kernel.org> wrote:

...
> Let's just have x86_32 as the internal primary subarchitecture name, 
> with support for historic aliases like 'i386'. That it cleans up things 
> for defconfig naming is a bonus.

Aren't there 3 variants?
Although the 3rd x32? running ILP32 in 'long mode' isn't used much
(if at all?)

	David

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture
  2025-05-09 12:04       ` David Laight
@ 2025-05-09 18:00         ` H. Peter Anvin
  0 siblings, 0 replies; 39+ messages in thread
From: H. Peter Anvin @ 2025-05-09 18:00 UTC (permalink / raw)
  To: David Laight, Ingo Molnar
  Cc: Arnd Bergmann, linux-kernel, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, David Woodhouse, Masahiro Yamada, Michal Marek

On May 9, 2025 5:04:38 AM PDT, David Laight <david.laight.linux@gmail.com> wrote:
>On Wed, 7 May 2025 08:35:05 +0200
>Ingo Molnar <mingo@kernel.org> wrote:
>
>...
>> Let's just have x86_32 as the internal primary subarchitecture name, 
>> with support for historic aliases like 'i386'. That it cleans up things 
>> for defconfig naming is a bonus.
>
>Aren't there 3 variants?
>Although the 3rd x32? running ILP32 in 'long mode' isn't used much
>(if at all?)
>
>	David

x32 is user space only.

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture
  2025-05-07  6:35     ` Ingo Molnar
  2025-05-09 12:04       ` David Laight
@ 2025-05-09 18:05       ` Arnd Bergmann
  1 sibling, 0 replies; 39+ messages in thread
From: Arnd Bergmann @ 2025-05-09 18:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, David Woodhouse, Masahiro Yamada, Michal Marek

On Wed, May 7, 2025, at 08:35, Ingo Molnar wrote:
> * Arnd Bergmann <arnd@arndb.de> wrote:
>> On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:


>> Also, I don't think there are any systems that return 'x86_32' from 
>> 'uname -m', so your added special case would never be used by 
>> default, only when cross-compiling from some other architecture.
>
> No, on most 32-bit systems 'uname -m' returns 'i686', which we cannot 
> use straight away anyway. And it looked a bit silly to me for us to 
> fudge over the architecture from 'i686' to 'i386', when we haven't 
> supported i386 for quite some while and are now working on i486 
> removal...
>
> Let's just have x86_32 as the internal primary subarchitecture name, 
> with support for historic aliases like 'i386'. That it cleans up things 
> for defconfig naming is a bonus.

If we're going to remove the ARCH=i386 stuff anyway, I wouldn't add
x86_32 now, what I suggested was to  remove both i386 and x86_64 as
identifiers here and just keep ARCH=x86 internally. It's only used
in two places anyway: the 'make defconfig' and the CONFIG_64BIT
selection.

The SUBARCH= logic is independent of that, this bit is only used
for arch/um/, though that would have to change the same way as
arch/x86

      Arnd

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 03/15] x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386
  2025-05-06 17:09 ` [PATCH 03/15] x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386 Ingo Molnar
@ 2025-05-09 18:10   ` Arnd Bergmann
  2025-05-15 13:16     ` Ingo Molnar
  0 siblings, 1 reply; 39+ messages in thread
From: Arnd Bergmann @ 2025-05-09 18:10 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: H. Peter Anvin, Linus Torvalds, Peter Zijlstra, Borislav Petkov,
	Thomas Gleixner, Vitaly Kuznetsov, Ard Biesheuvel,
	David Woodhouse, Masahiro Yamada, Michal Marek

On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
> Editing the defconfigs with shell filename completion is unnecessarily
> hard due to bad naming: if one remembers 'arch/x86/config/defconfig',
> it won't lead to the right files, because the defconfigs are
> prefixed with $(ARCH)_.
>
> Under the principle of 'higher order names should go first', prefix
> them with 'defconfig' and postfix them with .$(ARCH), and thus make
> all x86 configs match the arch/x86/config/defconfig.* pattern.

I think this patch should be dropped completely, it as it causes
multiple problems:

- it breaks existing scripts that use 'make x86_64_defconfig'
- it breaks 'make help' automatically printing the names
  of the defconfigs
- it's inconsistent with the other architectures

       Arnd

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 03/15] x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386
  2025-05-09 18:10   ` Arnd Bergmann
@ 2025-05-15 13:16     ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-15 13:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kernel, H. Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, David Woodhouse, Masahiro Yamada, Michal Marek


* Arnd Bergmann <arnd@arndb.de> wrote:

> On Tue, May 6, 2025, at 19:09, Ingo Molnar wrote:
> > Editing the defconfigs with shell filename completion is unnecessarily
> > hard due to bad naming: if one remembers 'arch/x86/config/defconfig',
> > it won't lead to the right files, because the defconfigs are
> > prefixed with $(ARCH)_.
> >
> > Under the principle of 'higher order names should go first', prefix
> > them with 'defconfig' and postfix them with .$(ARCH), and thus make
> > all x86 configs match the arch/x86/config/defconfig.* pattern.
> 
> I think this patch should be dropped completely, it as it causes
> multiple problems:
> 
> - it breaks existing scripts that use 'make x86_64_defconfig'
> - it breaks 'make help' automatically printing the names
>   of the defconfigs
> - it's inconsistent with the other architectures

Oh well, I've removed patches #3 and #4.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 09/15] x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V
  2025-05-08  9:21   ` Jürgen Groß
@ 2025-05-15 13:19     ` Ingo Molnar
  0 siblings, 0 replies; 39+ messages in thread
From: Ingo Molnar @ 2025-05-15 13:19 UTC (permalink / raw)
  To: Jürgen Groß
  Cc: linux-kernel, H . Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Kirill A . Shutemov, Ard Biesheuvel, Arnd Bergmann, Carlos Bilbao,
	David Woodhouse, Elena Reshetova, Fei Li, Jan Kiszka,
	Masahiro Yamada, Michal Marek, Paolo Bonzini, Sean Christopherson,
	Stefano Stabellini


* Jürgen Groß <jgross@suse.com> wrote:

> On 06.05.25 19:09, Ingo Molnar wrote:
> > Since the x86 defconfig aims to be a distro kernel work-alike with
> > fewer drivers and a shorter build time, refresh all the virtualization
> > guest Kconfig features, enabling paravirt spinlocks, and
> > enabling the guest support code for the following guests:
> > 
> >   - Xen
> >   - Xen_PVH
> 
> With those it might be a good idea to add:
> 
> CONFIG_XEN_BLKDEV_FRONTEND=m
> CONFIG_XEN_NETDEV_FRONTEND=m
> CONFIG_HVC_XEN=y
> CONFIG_XEN_BALLOON=y

Yeah, and these already get enabled automatically, due to their 
defaults:

 starship:~/mingo.tip.git> grep -E 'CONFIG_XEN_BLKDEV_FRONTEND|CONFIG_XEN_NETDEV_FRONTEND|CONFIG_HVC_XEN|CONFIG_XEN_BALLOON' .config
 CONFIG_XEN_BLKDEV_FRONTEND=y
 CONFIG_XEN_NETDEV_FRONTEND=y
 CONFIG_HVC_XEN=y
 CONFIG_HVC_XEN_FRONTEND=y
 CONFIG_XEN_BALLOON=y

defconfig files do not include entries that get enabled anyway - this 
compresses defconfig files substantially.

Thanks,

	Ingo


^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-07 16:22         ` Ingo Molnar
  2025-05-08  5:56           ` Yafang Shao
@ 2025-05-22  5:49           ` Yafang Shao
  1 sibling, 0 replies; 39+ messages in thread
From: Yafang Shao @ 2025-05-22  5:49 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Peter Zijlstra, ardb, arnd, bp, dwmw, hpa, linux-kernel,
	michal.lkml, tglx, torvalds, vkuznets, yamada.masahiro

On Thu, May 8, 2025 at 12:23 AM Ingo Molnar <mingo@kernel.org> wrote:
>
>
> * Yafang Shao <laoar.shao@gmail.com> wrote:
>
> > On Wed, May 7, 2025 at 3:06 PM Ingo Molnar <mingo@kernel.org> wrote:
> > >
> > >
> > > * Yafang Shao <laoar.shao@gmail.com> wrote:
> > >
> > > > Hello Mingo,
> > > >
> > > > > +CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
> > > > > +CONFIG_IRQ_TIME_ACCOUNTING=y
> > > >
> > > > Enabling CONFIG_IRQ_TIME_ACCOUNTING=y can lead to user-visible behavioral
> > > > changes. For more context, please refer to the related discussion here:
> > > > https://lore.kernel.org/all/20241222024734.63894-1-laoar.shao@gmail.com/ .
> > >
> > > Yeah. I actually agree with your series. It (re-)includes IRQ/softirq
> > > time in task CPU usage statistics even under IRQ_TIME_ACCOUNTING=y,
> > > while still keeping the finegrained IRQ/softirq statistics as well,
> > > correct?
> >
> > Correct.
> >
> > >
> > > The Kconfig option is also arguably rather misleading:
> > >
> > > config IRQ_TIME_ACCOUNTING
> > >         bool "Fine granularity task level IRQ time accounting"
> > >         depends on HAVE_IRQ_TIME_ACCOUNTING && !VIRT_CPU_ACCOUNTING_NATIVE
> > >         help
> > >           Select this option to enable fine granularity task irq time
> > >           accounting. This is done by reading a timestamp on each
> > >           transitions between softirq and hardirq state, so there can be a
> > >           small performance impact.
> > >
> > > It only warns about a small performance impact, but doesn't warn that
> > > CPU accounting is changed in an incompatible fashion that surprises
> > > tooling...
> >
> > Yes, this breaks our userspace tools.
>
> Okay, so 2 out of your 3 fixes are upstream already:
>
>   763a744e24a8 ("sched: Don't account irq time if sched_clock_irqtime is disabled")
>   a6fd16148fdd ("sched, psi: Don't account irq time if sched_clock_irqtime is disabled")
>
> But we don't have this one yet:
>
>   [PATCH v8 4/4] sched: Fix cgroup irq time for CONFIG_IRQ_TIME_ACCOUNTING
>
>   https://lore.kernel.org/r/20250103022409.2544-5-laoar.shao@gmail.com
>
> which is also essential to fully fix the tooling regression, right?
>
> I think this last patch fell between the cracks, I didn't see any
> fundamental objections against the fix.
>
> Since the patch does not apply cleanly anymore, mind sending a fresh
> -v9 version against v6.15-rc5 or so?

Hello Ingo,

I have sent the v9:
https://lore.kernel.org/all/20250511030800.1900-1-laoar.shao@gmail.com/

Could you please help review this? I’d appreciate your feedback.

-- 
Regards
Yafang

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
  2025-05-06 17:09 ` [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces " Ingo Molnar
  2025-05-07  3:00   ` Yafang Shao
  2025-05-07  5:11   ` Arnd Bergmann
@ 2025-05-28 17:22   ` Michal Koutný
  2 siblings, 0 replies; 39+ messages in thread
From: Michal Koutný @ 2025-05-28 17:22 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, H . Peter Anvin, Linus Torvalds, Peter Zijlstra,
	Borislav Petkov, Thomas Gleixner, Vitaly Kuznetsov,
	Ard Biesheuvel, Arnd Bergmann, David Woodhouse, Masahiro Yamada,
	Michal Marek

[-- Attachment #1: Type: text/plain, Size: 362 bytes --]

On Tue, May 06, 2025 at 07:09:22PM +0200, Ingo Molnar <mingo@kernel.org> wrote:
> +CONFIG_MEMCG_V1=y

Ugh.

> +CONFIG_CPUSETS_V1=y

Ugh.

Those config options were introduced to retire old code (their Kconfig
defaults are N).

I'd prefer if these defaults matched the Kconfig ones (and leave it up
to distros if they need them some time longer).

Thanks,
Michal

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2025-05-28 17:22 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
2025-05-06 17:09 ` [PATCH 01/15] x86/kconfig/64: Refresh defconfig Ingo Molnar
2025-05-07  5:31   ` Arnd Bergmann
2025-05-07  6:22     ` Ingo Molnar
2025-05-06 17:09 ` [PATCH 02/15] x86/kconfig/32: " Ingo Molnar
2025-05-06 17:09 ` [PATCH 03/15] x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386 Ingo Molnar
2025-05-09 18:10   ` Arnd Bergmann
2025-05-15 13:16     ` Ingo Molnar
2025-05-06 17:09 ` [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture Ingo Molnar
2025-05-07  5:44   ` Arnd Bergmann
2025-05-07  6:35     ` Ingo Molnar
2025-05-09 12:04       ` David Laight
2025-05-09 18:00         ` H. Peter Anvin
2025-05-09 18:05       ` Arnd Bergmann
2025-05-06 17:09 ` [PATCH 05/15] x86/kbuild: Remove ancient 'arch/i386/' and 'arch/x86_64/' directory removal 'archclean' target Ingo Molnar
2025-05-06 17:09 ` [PATCH 06/15] x86/tools: insn_decoder_test.c: Emit standard build success messages Ingo Molnar
2025-05-06 17:09 ` [PATCH 07/15] x86/tools: insn_sanity.c: " Ingo Molnar
2025-05-06 17:09 ` [PATCH 08/15] x86/kconfig/64: Enable the KVM host in the defconfig Ingo Molnar
2025-05-06 17:09 ` [PATCH 09/15] x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V Ingo Molnar
2025-05-08  9:21   ` Jürgen Groß
2025-05-15 13:19     ` Ingo Molnar
2025-05-06 17:09 ` [PATCH 10/15] x86/kconfig/64: Enable BPF support in the defconfig Ingo Molnar
2025-05-06 17:09 ` [PATCH 11/15] x86/kconfig/64: Enable popular MM options " Ingo Molnar
2025-05-06 17:09 ` [PATCH 12/15] x86/kconfig/64: Enable popular kernel debugging " Ingo Molnar
2025-05-06 17:09 ` [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces " Ingo Molnar
2025-05-07  3:00   ` Yafang Shao
2025-05-07  7:06     ` Ingo Molnar
2025-05-07 11:42       ` Yafang Shao
2025-05-07 16:22         ` Ingo Molnar
2025-05-08  5:56           ` Yafang Shao
2025-05-22  5:49           ` Yafang Shao
2025-05-07  5:11   ` Arnd Bergmann
2025-05-07 16:09     ` Ingo Molnar
2025-05-28 17:22   ` Michal Koutný
2025-05-06 17:09 ` [PATCH 14/15] x86/kconfig/64: Enable popular generic kernel " Ingo Molnar
2025-05-06 17:09 ` [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig Ingo Molnar
2025-05-07  5:27   ` Arnd Bergmann
2025-05-07 17:41     ` Ingo Molnar
2025-05-07 17:55       ` Arnd Bergmann

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).