[PATCH 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups

Ingo Molnar posted 15 patches 9 months, 1 week ago
There is a newer version of this series
.../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} | 120 ++++++++++++++++---
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, 244 insertions(+), 50 deletions(-)
rename arch/x86/configs/{i386_defconfig => defconfig.x86_32} (69%)
rename arch/x86/configs/{x86_64_defconfig => defconfig.x86_64} (70%)
[PATCH 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups
Posted by Ingo Molnar 9 months, 1 week ago
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 and Intel TDX
  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} | 120 ++++++++++++++++---
 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, 244 insertions(+), 50 deletions(-)
 rename arch/x86/configs/{i386_defconfig => defconfig.x86_32} (69%)
 rename arch/x86/configs/{x86_64_defconfig => defconfig.x86_64} (70%)

-- 
2.45.2
Re: [PATCH 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups
Posted by Peter Zijlstra 9 months, 1 week ago
On Mon, May 05, 2025 at 01:09:31PM +0200, Ingo Molnar wrote:
> 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

One thing I'd been pondering for a while, but have absolutely no
bandwidth for what so ever, is a more fragment based config setup.

Much like we now have defconfig, kvm_guest.config, debug.config
and xen.config etc..

My main 'complain' is more that defconfig is too fat already, and here
you are making it fatter still -- notably, I don't need i915 in most of
the kernels I build (my test machines are all headless).

Could we not instead move things out into fragments, so that people can
compose the bits they need?

The other day, I was looking for a kvm_host.config fragment, to pair with
the kvm_guest.config we do have.

Similarly, all that UBSAN, MM and assorted debug cruft is already in
debug.config (although I do think debug.config is *too* heavy).
Re: [PATCH 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups
Posted by Ingo Molnar 9 months, 1 week ago
* Peter Zijlstra <peterz@infradead.org> wrote:

> One thing I'd been pondering for a while, but have absolutely no 
> bandwidth for what so ever, is a more fragment based config setup.
> 
> Much like we now have defconfig, kvm_guest.config, debug.config and 
> xen.config etc..
> 
> My main 'complain' is more that defconfig is too fat already, and 
> here you are making it fatter still -- notably, I don't need i915 in 
> most of the kernels I build (my test machines are all headless).
> 
> Could we not instead move things out into fragments, so that people 
> can compose the bits they need?
> 
> The other day, I was looking for a kvm_host.config fragment, to pair 
> with the kvm_guest.config we do have.
> 
> Similarly, all that UBSAN, MM and assorted debug cruft is already in 
> debug.config (although I do think debug.config is *too* heavy).

Yeah, so I don't disagree with the 'fragment' approach in principle, 
although I don't have the bandwidth either right now. :)

I do have a 'fulldebug' 'fragment' myself, enabled externally via a 
script that uses the 'scripts/config -e' flag to enable individual 
options:

	DYNAMIC_DEBUG=y
	DYNAMIC_DEBUG_CORE=y
	SYMBOLIC_ERRNAME=y
	DEBUG_BUGVERBOSE=y
	DEBUG_KERNEL=y
	DEBUG_MISC=y
	AS_HAS_NON_CONST_ULEB128=y
	DEBUG_INFO_COMPRESSED_NONE=y
	PAHOLE_HAS_SPLIT_BTF=y
	PAHOLE_HAS_LANG_EXCLUDE=y
	GDB_SCRIPTS=y
	SECTION_MISMATCH_WARN_ONLY=y
	OBJTOOL=y
	NOINSTR_VALIDATION=y
	MAGIC_SYSRQ=y
	MAGIC_SYSRQ_SERIAL=y
	DEBUG_FS=y
	DEBUG_FS_ALLOW_ALL=y
	HAVE_ARCH_KGDB=y
	KGDB=y
	KGDB_HONOUR_BLOCKLIST=y
	KGDB_SERIAL_CONSOLE=y
	KGDB_LOW_LEVEL_TRAP=y
	KGDB_KDB=y
	KDB_KEYBOARD=y
	ARCH_HAS_EARLY_DEBUG=y
	ARCH_HAS_UBSAN=y
	HAVE_ARCH_KCSAN=y
	HAVE_KCSAN_COMPILER=y
	PAGE_EXTENSION=y
	SLUB_DEBUG=y
	PAGE_TABLE_CHECK=y
	PAGE_TABLE_CHECK_ENFORCED=y
	PAGE_POISONING=y
	ARCH_HAS_DEBUG_WX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UG_LOCKING_API_SELFTESTS=y
	CSD_LOCK_WAIT_DEBUG=y
	CSD_LOCK_WAIT_DEBUG_DEFAULT=y
	TRACE_IRQFLAGS=y
	TRACE_IRQFLAGS_NMI=y
	NMI_CHECK_CPU=y
	DEBUG_IRQFLAGS=y
	STACKTRACE=y
	DEBUG_LIST=y
	DEBUG_PLIST=y
	DEBUG_SG=y
	DEBUG_NOTIFIERS=y
	DEBUG_MAPLE_TREE=y
	PROVE_RCU=y
	RCU_CPU_STALL_CPUTIME=y
	USER_STACKTRACE_SUPPORT=y
	NOP_TRACER=y
	HAVE_RETHOOK=y
	RETHOOK=y
	HAVE_FUNCTION_TRACER=y
	HAVE_FUNCTION_GRAPH_TRACER=y
	HAVE_FUNCTION_GRAPH_FREGS=y
	HAVE_FTRACE_GRAPH_FUNC=y
	HAVE_DYNAMIC_FTRACE=y
	HAVE_DYNAMIC_FTRACE_WITH_REGS=y
	HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
	HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
	HAVE_FTRACE_REGS_HAVING_PT_REGS=y
	HAVE_DYNAMIC_FTRACE_NO_PATCHABLE=y
	HAVE_FTRACE_MCOUNT_RECORD=y
	HAVE_SYSCALL_TRACEPOINTS=y
	HAVE_FENTRY=y
	HAVE_OBJTOOL_MCOUNT=y
	HAVE_OBJTOOL_NOP_MCOUNT=y
	HAVE_C_RECORDMCOUNT=y
	HAVE_BUILDTIME_MCOUNT_SORT=y
	BUILDTIME_MCOUNT_SORT=y
	TRACER_MAX_TRACE=y
	TRACE_CLOCK=y
	RING_BUFFER=y
	EVENT_TRACING=y
	CONTEXT_SWITCH_TRACER=y
	PREEMPTIRQ_TRACEPOINTS=y
	TRACING=y
	GENERIC_TRACER=y
	TRACING_SUPPORT=y
	FTRACE=y
	BOOTTIME_TRACING=y
	FUNCTION_TRACER=y
	FUNCTION_GRAPH_TRACER=y
	FUNCTION_GRAPH_RETVAL=y
	DYNAMIC_FTRACE=y
	DYNAMIC_FTRACE_WITH_REGS=y
	DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
	DYNAMIC_FTRACE_WITH_ARGS=y
	FPROBE=y
	FUNCTION_PROFILER=y
	STACK_TRACER=y
	SCHED_TRACER=y
	HWLAT_TRACER=y
	OSNOISE_TRACER=y
	TIMERLAT_TRACER=y
	MMIOTRACE=y
	FTRACE_SYSCALLS=y
	TRACER_SNAPSHOT=y
	BRANCH_PROFILE_NONE=y
	BLK_DEV_IO_TRACE=y
	FPROBE_EVENTS=y
	KPROBE_EVENTS=y
	UPROBE_EVENTS=y
	DYNAMIC_EVENTS=y
	PROBE_EVENTS=y
	FTRACE_MCOUNT_RECORD=y
	FTRACE_MCOUNT_USE_CC=y
	TRACING_MAP=y
	SYNTH_EVENTS=y
	USER_EVENTS=y
	HIST_TRIGGERS=y
	TRACE_EVENT_INJECT=y
	DA_MON_EVENTS=y
	DA_MON_EVENTS_ID=y
	RV=y
	RV_MON_WWNR=y
	RV_REACTORS=y
	RV_REACT_PRINTK=y
	RV_REACT_PANIC=y
	SAMPLES=y
	HAVE_SAMPLE_FTRACE_DIRECT=y
	HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y
	ARCH_HAS_DEVMEM_IS_ALLOWED=y
	STRICT_DEVMEM=y
	EARLY_PRINTK_USB=y
	EARLY_PRINTK=y
	EARLY_PRINTK_DBGP=y
	EARLY_PRINTK_USB_XDBC=y
	HAVE_MMIOTRACE_SUPPORT=y
	IO_DELAY_0XED=y
	DEBUG_ENTRY=y
	X86_DEBUG_FPU=y
	UNWINDER_ORC=y
	FUNCTION_ERROR_INJECTION=y
	ARCH_HAS_KCOV=y
	CC_HAS_SANCOV_TRACE_PC=y
	RUNTIME_TESTING_MENU=y
	ARCH_USE_MEMTEST=y
	MEMTEST=y

These are all the debug options that don't reasult in an unusable 
kernel (such as they don't spam the syslog, etc.).

Also note that the goal of 'defconfig' is to provide something that is 
relevant to 99.9% of our users: ie. something reasonably close to what 
actual Linux distributions in the field are using, minus (most) driver 
noise. Ie. in a way it's the 'community default' in essence, following 
the choices of the wider kernel community that end up being used by the 
majority of our users, with judgement calls when an option isn't 
universally enabled.

Thanks,

	Ingo