2022-03-23 22:00:55

by Borislav Petkov

[permalink] [raw]
Subject: [PATCH] x86/defconfig: Enable WERROR

From: Borislav Petkov <[email protected]>

To quote Linus:

"EVERYBODY should have CONFIG_WERROR=y on at least x86-64 and other
serious architectures, unless you have some completely random
experimental (and broken) compiler.

New compiler warnings are not acceptable."

So this should make at least the most obvious and common ones not go
unnoticed.

Signed-off-by: Borislav Petkov <[email protected]>
---
arch/x86/configs/i386_defconfig | 1 +
arch/x86/configs/x86_64_defconfig | 1 +
2 files changed, 2 insertions(+)

diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index 71124cf8630c..4b2085243aa3 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -262,3 +262,4 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_EARLY_PRINTK_DBGP=y
CONFIG_DEBUG_BOOT_PARAMS=y
CONFIG_KALLSYMS_ALL=y
+CONFIG_WERROR=y
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index 92b1169ec90b..38c52e4eb30b 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -258,3 +258,4 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_EARLY_PRINTK_DBGP=y
CONFIG_DEBUG_BOOT_PARAMS=y
CONFIG_KALLSYMS_ALL=y
+CONFIG_WERROR=y
--
2.29.2


--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette


2022-03-23 23:40:54

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] x86/defconfig: Enable WERROR

On Wed, Mar 23, 2022 at 4:21 AM Borislav Petkov <[email protected]> wrote:
>
> So this should make at least the most obvious and common ones not go
> unnoticed.

Ack. I'm actually surprised people use "defconfig". It's kind of
pointless and unreal on x86 where there is no realistic "default". I'm
sorry it exists at all.

But since people clearly use it - presumably for testing - I very much
think it should have WERROR on.

Linus

2022-03-25 15:11:17

by Ingo Molnar

[permalink] [raw]
Subject: [PATCH] x86/config: Make the x86 defconfigs a bit more usable


* Linus Torvalds <[email protected]> wrote:

> On Wed, Mar 23, 2022 at 4:21 AM Borislav Petkov <[email protected]> wrote:
> >
> > So this should make at least the most obvious and common ones not go
> > unnoticed.
>
> Ack. I'm actually surprised people use "defconfig". It's kind of
> pointless and unreal on x86 where there is no realistic "default". I'm
> sorry it exists at all.
>
> But since people clearly use it - presumably for testing - I very much
> think it should have WERROR on.

Hm, I never saw the warning you got - I test 8 main configs on x86:

- {x86_64|i386} X {allnoconfig,defconfig,allmodconfig,allyesconfig}

Plus an unlimited number of randconfigs. Normally no warnings are permitted
in any of the 8 base configs - regardless of whether WERROR is enabled or
not.

I'm using x86 defconfig as:

- A quick to build, bootable config (on KVM) with settings that are
supposed to be pretty close to how the bigger x86 distros set up their
kernels. Defconfig builds ~5x faster than allmodconfig.

- Reference config for kernel bloat measurements. Empirically the text
section of its vmlinux shrinks roughly as well as a full distro kernel
build - with a fraction of a build time.

- Developer reference point & minimal test requirements. If an incoming
patch doesn't even build on defconfig that's a serious red flag.

- I also use defconfig when applying individual patches or series when I
cannot do a full allmodconfig build for the entire series.

- I also have kconfig scripts that enable all of the (practical...) debug
options in a kernel. So I often boot x86-64 defconfig, then
defconfig+fulldebug. Again this is much faster & practical to do than
allmod or allyes configs.

But beyond the WERROR oversight, bitrot has gotten to defconfig a bit - see
attached patch. My test scripts usually enable these - but it's better to
formalize it.

Anyway, I've put Boris's patch into x86/urgent with your Acked-by, then my
bigger defconfig cleanup patch. We'll send a pull request for these ASAP,
plus the local_lock cleanup once there's consensus.

Thanks,

Ingo

================>

From: Ingo Molnar <[email protected]>
Date: Thu, 24 Mar 2022 09:18:36 +0100
Subject: [PATCH] x86/config: Make the x86 defconfigs a bit more usable

- Use 'make savedefconfig' to refresh & regenerate the files
- Add in KVM boot enablers
- Enable the cgroup features most distros rely on

Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/configs/i386_defconfig | 50 ++++++++++++++++++++++++++-------------
arch/x86/configs/x86_64_defconfig | 38 +++++++++++++++++++++--------
2 files changed, 62 insertions(+), 26 deletions(-)

diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index 4b2085243aa3..fde771df72cc 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -1,5 +1,7 @@
+CONFIG_WERROR=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
+CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
@@ -11,23 +13,30 @@ CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_CGROUPS=y
+CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_SCHED=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
+CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_MISC=y
+CONFIG_CGROUP_DEBUG=y
CONFIG_BLK_DEV_INITRD=y
+CONFIG_KALLSYMS_ALL=y
# CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y
-# CONFIG_64BIT is not set
CONFIG_SMP=y
-CONFIG_X86_GENERIC=y
-CONFIG_HPET_TIMER=y
+CONFIG_HYPERVISOR_GUEST=y
+CONFIG_PARAVIRT=y
+CONFIG_NR_CPUS=8
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
-CONFIG_X86_REBOOTFIXUPS=y
CONFIG_MICROCODE_AMD=y
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
-CONFIG_HIGHPTE=y
CONFIG_X86_CHECK_BIOS_CORRUPTION=y
# CONFIG_MTRR_SANITIZER is not set
CONFIG_EFI=y
@@ -43,12 +52,15 @@ CONFIG_ACPI_BGRT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_X86_ACPI_CPUFREQ=y
-CONFIG_EFI_VARS=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
+CONFIG_COMPAT_32BIT_TIME=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_BLK_CGROUP_IOLATENCY=y
+CONFIG_BLK_CGROUP_IOCOST=y
+CONFIG_BLK_CGROUP_IOPRIO=y
CONFIG_BINFMT_MISC=y
CONFIG_NET=y
CONFIG_PACKET=y
@@ -103,12 +115,16 @@ CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_NET_SCHED=y
+CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_EMATCH=y
CONFIG_NET_CLS_ACT=y
+CONFIG_CGROUP_NET_PRIO=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_RFKILL=y
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_MSI=y
@@ -119,13 +135,16 @@ CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_DEBUG_DEVRES=y
CONFIG_CONNECTOR=y
+CONFIG_EFI_VARS=y
+CONFIG_EFI_CAPSULE_LOADER=y
CONFIG_BLK_DEV_LOOP=y
+CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_LOWLEVEL is not set
+CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_ATA_PIIX=y
@@ -143,6 +162,7 @@ CONFIG_MACINTOSH_DRIVERS=y
CONFIG_MAC_EMUMOUSEBTN=y
CONFIG_NETDEVICES=y
CONFIG_NETCONSOLE=y
+CONFIG_VIRTIO_NET=y
CONFIG_BNX2=y
CONFIG_TIGON3=y
CONFIG_NET_TULIP=y
@@ -170,6 +190,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM=y
CONFIG_NVRAM=y
CONFIG_HPET=y
@@ -181,12 +202,7 @@ CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
CONFIG_DRM=y
CONFIG_DRM_I915=y
-CONFIG_FB_MODE_HELPERS=y
-CONFIG_FB_TILEBLITTING=y
-CONFIG_FB_EFI=y
-CONFIG_LOGO=y
-# CONFIG_LOGO_LINUX_MONO is not set
-# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_DRM_VIRTIO_GPU=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_HRTIMER=y
@@ -219,6 +235,8 @@ CONFIG_USB_STORAGE=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_DMADEVICES=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_INPUT=y
CONFIG_EEEPC_LAPTOP=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
@@ -240,6 +258,7 @@ CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
+CONFIG_9P_FS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ASCII=y
@@ -251,15 +270,14 @@ CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_PRINTK_TIME=y
+CONFIG_FRAME_WARN=1024
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_STACK_USAGE=y
-CONFIG_DEBUG_STACKOVERFLOW=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_KALLSYMS_ALL=y
-CONFIG_WERROR=y
+CONFIG_UNWINDER_FRAME_POINTER=y
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index 38c52e4eb30b..69784505a7a8 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -1,3 +1,4 @@
+CONFIG_WERROR=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
@@ -11,14 +12,25 @@ CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_CGROUPS=y
+CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_SCHED=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
+CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_MISC=y
+CONFIG_CGROUP_DEBUG=y
CONFIG_BLK_DEV_INITRD=y
+CONFIG_KALLSYMS_ALL=y
# CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y
CONFIG_SMP=y
+CONFIG_HYPERVISOR_GUEST=y
+CONFIG_PARAVIRT=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_MICROCODE_AMD=y
CONFIG_X86_MSR=y
@@ -41,12 +53,14 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_IA32_EMULATION=y
-CONFIG_EFI_VARS=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_BLK_CGROUP_IOLATENCY=y
+CONFIG_BLK_CGROUP_IOCOST=y
+CONFIG_BLK_CGROUP_IOPRIO=y
CONFIG_BINFMT_MISC=y
CONFIG_NET=y
CONFIG_PACKET=y
@@ -101,12 +115,16 @@ CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_NET_SCHED=y
+CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_EMATCH=y
CONFIG_NET_CLS_ACT=y
+CONFIG_CGROUP_NET_PRIO=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_RFKILL=y
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI=y
@@ -116,13 +134,15 @@ CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_DEBUG_DEVRES=y
CONFIG_CONNECTOR=y
+CONFIG_EFI_VARS=y
CONFIG_BLK_DEV_LOOP=y
+CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_LOWLEVEL is not set
+CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_ATA_PIIX=y
@@ -138,6 +158,7 @@ CONFIG_MACINTOSH_DRIVERS=y
CONFIG_MAC_EMUMOUSEBTN=y
CONFIG_NETDEVICES=y
CONFIG_NETCONSOLE=y
+CONFIG_VIRTIO_NET=y
CONFIG_TIGON3=y
CONFIG_NET_TULIP=y
CONFIG_E100=y
@@ -162,6 +183,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
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
@@ -175,12 +197,7 @@ CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
CONFIG_DRM=y
CONFIG_DRM_I915=y
-CONFIG_FB_MODE_HELPERS=y
-CONFIG_FB_TILEBLITTING=y
-CONFIG_FB_EFI=y
-CONFIG_LOGO=y
-# CONFIG_LOGO_LINUX_MONO is not set
-# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_DRM_VIRTIO_GPU=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_HRTIMER=y
@@ -213,6 +230,8 @@ CONFIG_USB_STORAGE=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_DMADEVICES=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_INPUT=y
CONFIG_EEEPC_LAPTOP=y
CONFIG_AMD_IOMMU=y
CONFIG_INTEL_IOMMU=y
@@ -237,6 +256,7 @@ CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
+CONFIG_9P_FS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ASCII=y
@@ -257,5 +277,3 @@ CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_EARLY_PRINTK_DBGP=y
CONFIG_DEBUG_BOOT_PARAMS=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_WERROR=y

2022-03-25 18:16:57

by Nathan Chancellor

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable

Hi Ingo,

On Thu, Mar 24, 2022 at 09:31:13AM +0100, Ingo Molnar wrote:

<snip>

> ================>
>
> From: Ingo Molnar <[email protected]>
> Date: Thu, 24 Mar 2022 09:18:36 +0100
> Subject: [PATCH] x86/config: Make the x86 defconfigs a bit more usable
>
> - Use 'make savedefconfig' to refresh & regenerate the files
> - Add in KVM boot enablers
> - Enable the cgroup features most distros rely on
>
> Signed-off-by: Ingo Molnar <[email protected]>

This should be super helpful, especially for the "reference point and
minimal test requirements" that you mentioned above, along with being
able to boot more distributions in QEMU without fiddling with
kvm_guest.config and menuconfig.

> ---
> arch/x86/configs/i386_defconfig | 50 ++++++++++++++++++++++++++-------------
> arch/x86/configs/x86_64_defconfig | 38 +++++++++++++++++++++--------
> 2 files changed, 62 insertions(+), 26 deletions(-)
>
> diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
> index 4b2085243aa3..fde771df72cc 100644
> --- a/arch/x86/configs/i386_defconfig
> +++ b/arch/x86/configs/i386_defconfig
> @@ -1,5 +1,7 @@
> +CONFIG_WERROR=y
> CONFIG_SYSVIPC=y
> CONFIG_POSIX_MQUEUE=y
> +CONFIG_USELIB=y
> CONFIG_AUDIT=y
> CONFIG_NO_HZ=y
> CONFIG_HIGH_RES_TIMERS=y
> @@ -11,23 +13,30 @@ CONFIG_TASK_XACCT=y
> CONFIG_TASK_IO_ACCOUNTING=y
> CONFIG_LOG_BUF_SHIFT=18
> CONFIG_CGROUPS=y
> +CONFIG_BLK_CGROUP=y
> CONFIG_CGROUP_SCHED=y
> +CONFIG_CGROUP_PIDS=y
> +CONFIG_CGROUP_RDMA=y
> CONFIG_CGROUP_FREEZER=y
> +CONFIG_CGROUP_HUGETLB=y
> CONFIG_CPUSETS=y
> +CONFIG_CGROUP_DEVICE=y
> CONFIG_CGROUP_CPUACCT=y
> +CONFIG_CGROUP_PERF=y
> +CONFIG_CGROUP_MISC=y
> +CONFIG_CGROUP_DEBUG=y
> CONFIG_BLK_DEV_INITRD=y
> +CONFIG_KALLSYMS_ALL=y
> # CONFIG_COMPAT_BRK is not set
> CONFIG_PROFILING=y
> -# CONFIG_64BIT is not set

I don't think this is right, this is repeating the problem that was
fixed by commit 76366050eb1b ("x86/defconfigs: Explicitly unset
CONFIG_64BIT in i386_defconfig").

$ make ARCH=i386 savedefconfig

?

> CONFIG_SMP=y
> -CONFIG_X86_GENERIC=y
> -CONFIG_HPET_TIMER=y
> +CONFIG_HYPERVISOR_GUEST=y
> +CONFIG_PARAVIRT=y
> +CONFIG_NR_CPUS=8
> CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
> -CONFIG_X86_REBOOTFIXUPS=y
> CONFIG_MICROCODE_AMD=y
> CONFIG_X86_MSR=y
> CONFIG_X86_CPUID=y
> -CONFIG_HIGHPTE=y
> CONFIG_X86_CHECK_BIOS_CORRUPTION=y
> # CONFIG_MTRR_SANITIZER is not set
> CONFIG_EFI=y
> @@ -43,12 +52,15 @@ CONFIG_ACPI_BGRT=y
> CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
> CONFIG_CPU_FREQ_GOV_ONDEMAND=y
> CONFIG_X86_ACPI_CPUFREQ=y
> -CONFIG_EFI_VARS=y
> CONFIG_KPROBES=y
> CONFIG_JUMP_LABEL=y
> +CONFIG_COMPAT_32BIT_TIME=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
> +CONFIG_BLK_CGROUP_IOLATENCY=y
> +CONFIG_BLK_CGROUP_IOCOST=y
> +CONFIG_BLK_CGROUP_IOPRIO=y
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
> @@ -103,12 +115,16 @@ CONFIG_IP6_NF_FILTER=y
> CONFIG_IP6_NF_TARGET_REJECT=y
> CONFIG_IP6_NF_MANGLE=y
> CONFIG_NET_SCHED=y
> +CONFIG_NET_CLS_CGROUP=y
> CONFIG_NET_EMATCH=y
> CONFIG_NET_CLS_ACT=y
> +CONFIG_CGROUP_NET_PRIO=y
> CONFIG_CFG80211=y
> CONFIG_MAC80211=y
> CONFIG_MAC80211_LEDS=y
> CONFIG_RFKILL=y
> +CONFIG_NET_9P=y
> +CONFIG_NET_9P_VIRTIO=y
> CONFIG_PCI=y
> CONFIG_PCIEPORTBUS=y
> CONFIG_PCI_MSI=y
> @@ -119,13 +135,16 @@ CONFIG_DEVTMPFS=y
> CONFIG_DEVTMPFS_MOUNT=y
> CONFIG_DEBUG_DEVRES=y
> CONFIG_CONNECTOR=y
> +CONFIG_EFI_VARS=y
> +CONFIG_EFI_CAPSULE_LOADER=y
> CONFIG_BLK_DEV_LOOP=y
> +CONFIG_VIRTIO_BLK=y
> CONFIG_BLK_DEV_SD=y
> CONFIG_BLK_DEV_SR=y
> CONFIG_CHR_DEV_SG=y
> CONFIG_SCSI_CONSTANTS=y
> CONFIG_SCSI_SPI_ATTRS=y
> -# CONFIG_SCSI_LOWLEVEL is not set
> +CONFIG_SCSI_VIRTIO=y
> CONFIG_ATA=y
> CONFIG_SATA_AHCI=y
> CONFIG_ATA_PIIX=y
> @@ -143,6 +162,7 @@ CONFIG_MACINTOSH_DRIVERS=y
> CONFIG_MAC_EMUMOUSEBTN=y
> CONFIG_NETDEVICES=y
> CONFIG_NETCONSOLE=y
> +CONFIG_VIRTIO_NET=y
> CONFIG_BNX2=y
> CONFIG_TIGON3=y
> CONFIG_NET_TULIP=y
> @@ -170,6 +190,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
> CONFIG_SERIAL_8250_DETECT_IRQ=y
> CONFIG_SERIAL_8250_RSA=y
> CONFIG_SERIAL_NONSTANDARD=y
> +CONFIG_VIRTIO_CONSOLE=y
> CONFIG_HW_RANDOM=y
> CONFIG_NVRAM=y
> CONFIG_HPET=y
> @@ -181,12 +202,7 @@ CONFIG_AGP_AMD64=y
> CONFIG_AGP_INTEL=y
> CONFIG_DRM=y
> CONFIG_DRM_I915=y
> -CONFIG_FB_MODE_HELPERS=y
> -CONFIG_FB_TILEBLITTING=y
> -CONFIG_FB_EFI=y
> -CONFIG_LOGO=y
> -# CONFIG_LOGO_LINUX_MONO is not set
> -# CONFIG_LOGO_LINUX_VGA16 is not set
> +CONFIG_DRM_VIRTIO_GPU=y
> CONFIG_SOUND=y
> CONFIG_SND=y
> CONFIG_SND_HRTIMER=y
> @@ -219,6 +235,8 @@ CONFIG_USB_STORAGE=y
> CONFIG_RTC_CLASS=y
> # CONFIG_RTC_HCTOSYS is not set
> CONFIG_DMADEVICES=y
> +CONFIG_VIRTIO_PCI=y
> +CONFIG_VIRTIO_INPUT=y
> CONFIG_EEEPC_LAPTOP=y
> CONFIG_EXT4_FS=y
> CONFIG_EXT4_FS_POSIX_ACL=y
> @@ -240,6 +258,7 @@ CONFIG_NFS_FS=y
> CONFIG_NFS_V3_ACL=y
> CONFIG_NFS_V4=y
> CONFIG_ROOT_NFS=y
> +CONFIG_9P_FS=y
> CONFIG_NLS_DEFAULT="utf8"
> CONFIG_NLS_CODEPAGE_437=y
> CONFIG_NLS_ASCII=y
> @@ -251,15 +270,14 @@ CONFIG_SECURITY_SELINUX=y
> CONFIG_SECURITY_SELINUX_BOOTPARAM=y
> CONFIG_SECURITY_SELINUX_DISABLE=y
> CONFIG_PRINTK_TIME=y
> +CONFIG_FRAME_WARN=1024
> CONFIG_MAGIC_SYSRQ=y
> CONFIG_DEBUG_KERNEL=y
> CONFIG_DEBUG_STACK_USAGE=y
> -CONFIG_DEBUG_STACKOVERFLOW=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_KALLSYMS_ALL=y
> -CONFIG_WERROR=y
> +CONFIG_UNWINDER_FRAME_POINTER=y
> diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
> index 38c52e4eb30b..69784505a7a8 100644
> --- a/arch/x86/configs/x86_64_defconfig
> +++ b/arch/x86/configs/x86_64_defconfig
> @@ -1,3 +1,4 @@
> +CONFIG_WERROR=y
> CONFIG_SYSVIPC=y
> CONFIG_POSIX_MQUEUE=y
> CONFIG_AUDIT=y
> @@ -11,14 +12,25 @@ CONFIG_TASK_XACCT=y
> CONFIG_TASK_IO_ACCOUNTING=y
> CONFIG_LOG_BUF_SHIFT=18
> CONFIG_CGROUPS=y
> +CONFIG_BLK_CGROUP=y
> CONFIG_CGROUP_SCHED=y
> +CONFIG_CGROUP_PIDS=y
> +CONFIG_CGROUP_RDMA=y
> CONFIG_CGROUP_FREEZER=y
> +CONFIG_CGROUP_HUGETLB=y
> CONFIG_CPUSETS=y
> +CONFIG_CGROUP_DEVICE=y
> CONFIG_CGROUP_CPUACCT=y
> +CONFIG_CGROUP_PERF=y
> +CONFIG_CGROUP_MISC=y
> +CONFIG_CGROUP_DEBUG=y
> CONFIG_BLK_DEV_INITRD=y
> +CONFIG_KALLSYMS_ALL=y
> # CONFIG_COMPAT_BRK is not set
> CONFIG_PROFILING=y
> CONFIG_SMP=y
> +CONFIG_HYPERVISOR_GUEST=y
> +CONFIG_PARAVIRT=y
> CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
> CONFIG_MICROCODE_AMD=y
> CONFIG_X86_MSR=y
> @@ -41,12 +53,14 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
> CONFIG_CPU_FREQ_GOV_ONDEMAND=y
> CONFIG_X86_ACPI_CPUFREQ=y
> CONFIG_IA32_EMULATION=y
> -CONFIG_EFI_VARS=y
> CONFIG_KPROBES=y
> CONFIG_JUMP_LABEL=y
> CONFIG_MODULES=y
> CONFIG_MODULE_UNLOAD=y
> CONFIG_MODULE_FORCE_UNLOAD=y
> +CONFIG_BLK_CGROUP_IOLATENCY=y
> +CONFIG_BLK_CGROUP_IOCOST=y
> +CONFIG_BLK_CGROUP_IOPRIO=y
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
> @@ -101,12 +115,16 @@ CONFIG_IP6_NF_FILTER=y
> CONFIG_IP6_NF_TARGET_REJECT=y
> CONFIG_IP6_NF_MANGLE=y
> CONFIG_NET_SCHED=y
> +CONFIG_NET_CLS_CGROUP=y
> CONFIG_NET_EMATCH=y
> CONFIG_NET_CLS_ACT=y
> +CONFIG_CGROUP_NET_PRIO=y
> CONFIG_CFG80211=y
> CONFIG_MAC80211=y
> CONFIG_MAC80211_LEDS=y
> CONFIG_RFKILL=y
> +CONFIG_NET_9P=y
> +CONFIG_NET_9P_VIRTIO=y
> CONFIG_PCI=y
> CONFIG_PCIEPORTBUS=y
> CONFIG_HOTPLUG_PCI=y
> @@ -116,13 +134,15 @@ CONFIG_DEVTMPFS=y
> CONFIG_DEVTMPFS_MOUNT=y
> CONFIG_DEBUG_DEVRES=y
> CONFIG_CONNECTOR=y
> +CONFIG_EFI_VARS=y
> CONFIG_BLK_DEV_LOOP=y
> +CONFIG_VIRTIO_BLK=y
> CONFIG_BLK_DEV_SD=y
> CONFIG_BLK_DEV_SR=y
> CONFIG_CHR_DEV_SG=y
> CONFIG_SCSI_CONSTANTS=y
> CONFIG_SCSI_SPI_ATTRS=y
> -# CONFIG_SCSI_LOWLEVEL is not set
> +CONFIG_SCSI_VIRTIO=y
> CONFIG_ATA=y
> CONFIG_SATA_AHCI=y
> CONFIG_ATA_PIIX=y
> @@ -138,6 +158,7 @@ CONFIG_MACINTOSH_DRIVERS=y
> CONFIG_MAC_EMUMOUSEBTN=y
> CONFIG_NETDEVICES=y
> CONFIG_NETCONSOLE=y
> +CONFIG_VIRTIO_NET=y
> CONFIG_TIGON3=y
> CONFIG_NET_TULIP=y
> CONFIG_E100=y
> @@ -162,6 +183,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
> CONFIG_SERIAL_8250_DETECT_IRQ=y
> 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
> @@ -175,12 +197,7 @@ CONFIG_AGP_AMD64=y
> CONFIG_AGP_INTEL=y
> CONFIG_DRM=y
> CONFIG_DRM_I915=y
> -CONFIG_FB_MODE_HELPERS=y
> -CONFIG_FB_TILEBLITTING=y
> -CONFIG_FB_EFI=y
> -CONFIG_LOGO=y
> -# CONFIG_LOGO_LINUX_MONO is not set
> -# CONFIG_LOGO_LINUX_VGA16 is not set
> +CONFIG_DRM_VIRTIO_GPU=y
> CONFIG_SOUND=y
> CONFIG_SND=y
> CONFIG_SND_HRTIMER=y
> @@ -213,6 +230,8 @@ CONFIG_USB_STORAGE=y
> CONFIG_RTC_CLASS=y
> # CONFIG_RTC_HCTOSYS is not set
> CONFIG_DMADEVICES=y
> +CONFIG_VIRTIO_PCI=y
> +CONFIG_VIRTIO_INPUT=y
> CONFIG_EEEPC_LAPTOP=y
> CONFIG_AMD_IOMMU=y
> CONFIG_INTEL_IOMMU=y
> @@ -237,6 +256,7 @@ CONFIG_NFS_FS=y
> CONFIG_NFS_V3_ACL=y
> CONFIG_NFS_V4=y
> CONFIG_ROOT_NFS=y
> +CONFIG_9P_FS=y
> CONFIG_NLS_DEFAULT="utf8"
> CONFIG_NLS_CODEPAGE_437=y
> CONFIG_NLS_ASCII=y
> @@ -257,5 +277,3 @@ CONFIG_BLK_DEV_IO_TRACE=y
> CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
> CONFIG_EARLY_PRINTK_DBGP=y
> CONFIG_DEBUG_BOOT_PARAMS=y
> -CONFIG_KALLSYMS_ALL=y
> -CONFIG_WERROR=y
>

2022-03-25 19:09:21

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable

On Thu, Mar 24, 2022 at 08:47:27AM -0700, Nathan Chancellor wrote:
> On Thu, Mar 24, 2022 at 09:31:13AM +0100, Ingo Molnar wrote:

> > --- a/arch/x86/configs/i386_defconfig
> > +++ b/arch/x86/configs/i386_defconfig

> > -# CONFIG_64BIT is not set
>
> I don't think this is right, this is repeating the problem that was
> fixed by commit 76366050eb1b ("x86/defconfigs: Explicitly unset
> CONFIG_64BIT in i386_defconfig").
>
> $ make ARCH=i386 savedefconfig
>
> ?

+1 here, there are still branches in use that have i386 defconfig as
as base and making this problem again is not okay.

--
With Best Regards,
Andy Shevchenko


2022-03-25 19:38:16

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] x86/defconfig: Enable WERROR

On Wed, Mar 23, 2022 at 10:19:39AM -0700, Linus Torvalds wrote:
> Ack. I'm actually surprised people use "defconfig". It's kind of
> pointless and unreal on x86 where there is no realistic "default". I'm
> sorry it exists at all.

Yeah, it has been there since forever and peterz and mingo use it from
time to time, AFAIK. Also, I know people start from a defconfig and add
additional stuff they need.

Oh, and it is part of the smoke build-tests we're doing so...

> But since people clearly use it - presumably for testing - I very much
> think it should have WERROR on.

Yeah, I am aiming for a "this should be always enabled in your config
so you could use this defconfig as a start"-thing, in the hope that
WERROR=y would proliferate then.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Subject: [tip: x86/urgent] x86/defconfig: Enable WERROR

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: b9080ba4a6ec56447f263082825a4fddb873316b
Gitweb: https://git.kernel.org/tip/b9080ba4a6ec56447f263082825a4fddb873316b
Author: Borislav Petkov <[email protected]>
AuthorDate: Wed, 23 Mar 2022 12:21:10 +01:00
Committer: Ingo Molnar <[email protected]>
CommitterDate: Thu, 24 Mar 2022 09:10:56 +01:00

x86/defconfig: Enable WERROR

To quote Linus:

"EVERYBODY should have CONFIG_WERROR=y on at least x86-64 and other
serious architectures, unless you have some completely random
experimental (and broken) compiler.

New compiler warnings are not acceptable."

So this should make at least the most obvious and common ones not go
unnoticed.

Acked-by: Linus Torvalds <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/x86/configs/i386_defconfig | 1 +
arch/x86/configs/x86_64_defconfig | 1 +
2 files changed, 2 insertions(+)

diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index 71124cf..4b20852 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -262,3 +262,4 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_EARLY_PRINTK_DBGP=y
CONFIG_DEBUG_BOOT_PARAMS=y
CONFIG_KALLSYMS_ALL=y
+CONFIG_WERROR=y
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index 92b1169..38c52e4 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -258,3 +258,4 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_EARLY_PRINTK_DBGP=y
CONFIG_DEBUG_BOOT_PARAMS=y
CONFIG_KALLSYMS_ALL=y
+CONFIG_WERROR=y

2022-03-28 04:45:12

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable


* Andy Shevchenko <[email protected]> wrote:

> On Thu, Mar 24, 2022 at 08:47:27AM -0700, Nathan Chancellor wrote:
> > On Thu, Mar 24, 2022 at 09:31:13AM +0100, Ingo Molnar wrote:
>
> > > --- a/arch/x86/configs/i386_defconfig
> > > +++ b/arch/x86/configs/i386_defconfig
>
> > > -# CONFIG_64BIT is not set
> >
> > I don't think this is right, this is repeating the problem that was
> > fixed by commit 76366050eb1b ("x86/defconfigs: Explicitly unset
> > CONFIG_64BIT in i386_defconfig").
> >
> > $ make ARCH=i386 savedefconfig
> >
> > ?
>
> +1 here, there are still branches in use that have i386 defconfig as
> as base and making this problem again is not okay.

Absolutely - fixed in the latest version.

Thanks,

Ingo

2022-03-28 08:55:14

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable


* Nathan Chancellor <[email protected]> wrote:

> Hi Ingo,
>
> On Thu, Mar 24, 2022 at 09:31:13AM +0100, Ingo Molnar wrote:
>
> <snip>
>
> > ================>
> >
> > From: Ingo Molnar <[email protected]>
> > Date: Thu, 24 Mar 2022 09:18:36 +0100
> > Subject: [PATCH] x86/config: Make the x86 defconfigs a bit more usable
> >
> > - Use 'make savedefconfig' to refresh & regenerate the files
> > - Add in KVM boot enablers
> > - Enable the cgroup features most distros rely on
> >
> > Signed-off-by: Ingo Molnar <[email protected]>
>
> This should be super helpful, especially for the "reference point and
> minimal test requirements" that you mentioned above, along with being
> able to boot more distributions in QEMU without fiddling with
> kvm_guest.config and menuconfig.

Thanks, I've added your Acked-by to the (fixed...) version of this commit.

> > # CONFIG_COMPAT_BRK is not set
> > CONFIG_PROFILING=y
> > -# CONFIG_64BIT is not set
>
> I don't think this is right, this is repeating the problem that was fixed
> by commit 76366050eb1b ("x86/defconfigs: Explicitly unset CONFIG_64BIT in
> i386_defconfig").
>
> $ make ARCH=i386 savedefconfig
>
> ?

Yeah, good catch! ...

I use defconfigs by explicitly adding in the architecture:

kepler:~/tip> make ARCH=i386 defconfig

kepler:~/tip> kconfig-arch
i386

... so never I noticed this bug.

I fixed this in the latest version (attached).

Arguably 'make ARCH=i386 savedefconfig' should preserve this, so that
refreshing defconfigs on bi-arch architectures is idempotent, but that's no
excuse to regress the existing defconfig behavior.

Thanks,

Ingo

========================>
From: Ingo Molnar <[email protected]>
Date: Thu, 24 Mar 2022 09:31:13 +0100
Subject: [PATCH] x86/config: Make the x86 defconfigs a bit more usable

- Use 'make savedefconfig' to refresh & regenerate the files
- Add in KVM boot enablers
- Enable the cgroup features most distros rely on

[ fix bug found by Nathan Chancellor ]

Acked-by: Nathan Chancellor <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/YjwsUT/[email protected]
---
arch/x86/configs/i386_defconfig | 51 +++++++++++++++++++++++++++------------
arch/x86/configs/x86_64_defconfig | 38 +++++++++++++++++++++--------
2 files changed, 63 insertions(+), 26 deletions(-)

diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index 4b2085243aa3..98a4852ed6a0 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -1,5 +1,7 @@
+CONFIG_WERROR=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
+CONFIG_USELIB=y
CONFIG_AUDIT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
@@ -11,23 +13,30 @@ CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_CGROUPS=y
+CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_SCHED=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
+CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_MISC=y
+CONFIG_CGROUP_DEBUG=y
CONFIG_BLK_DEV_INITRD=y
+CONFIG_KALLSYMS_ALL=y
# CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y
-# CONFIG_64BIT is not set
CONFIG_SMP=y
-CONFIG_X86_GENERIC=y
-CONFIG_HPET_TIMER=y
+CONFIG_HYPERVISOR_GUEST=y
+CONFIG_PARAVIRT=y
+CONFIG_NR_CPUS=8
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
-CONFIG_X86_REBOOTFIXUPS=y
CONFIG_MICROCODE_AMD=y
CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y
-CONFIG_HIGHPTE=y
CONFIG_X86_CHECK_BIOS_CORRUPTION=y
# CONFIG_MTRR_SANITIZER is not set
CONFIG_EFI=y
@@ -43,12 +52,15 @@ CONFIG_ACPI_BGRT=y
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_X86_ACPI_CPUFREQ=y
-CONFIG_EFI_VARS=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
+CONFIG_COMPAT_32BIT_TIME=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_BLK_CGROUP_IOLATENCY=y
+CONFIG_BLK_CGROUP_IOCOST=y
+CONFIG_BLK_CGROUP_IOPRIO=y
CONFIG_BINFMT_MISC=y
CONFIG_NET=y
CONFIG_PACKET=y
@@ -103,12 +115,16 @@ CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_NET_SCHED=y
+CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_EMATCH=y
CONFIG_NET_CLS_ACT=y
+CONFIG_CGROUP_NET_PRIO=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_RFKILL=y
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_MSI=y
@@ -119,13 +135,16 @@ CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_DEBUG_DEVRES=y
CONFIG_CONNECTOR=y
+CONFIG_EFI_VARS=y
+CONFIG_EFI_CAPSULE_LOADER=y
CONFIG_BLK_DEV_LOOP=y
+CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_LOWLEVEL is not set
+CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_ATA_PIIX=y
@@ -143,6 +162,7 @@ CONFIG_MACINTOSH_DRIVERS=y
CONFIG_MAC_EMUMOUSEBTN=y
CONFIG_NETDEVICES=y
CONFIG_NETCONSOLE=y
+CONFIG_VIRTIO_NET=y
CONFIG_BNX2=y
CONFIG_TIGON3=y
CONFIG_NET_TULIP=y
@@ -170,6 +190,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_VIRTIO_CONSOLE=y
CONFIG_HW_RANDOM=y
CONFIG_NVRAM=y
CONFIG_HPET=y
@@ -181,12 +202,7 @@ CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
CONFIG_DRM=y
CONFIG_DRM_I915=y
-CONFIG_FB_MODE_HELPERS=y
-CONFIG_FB_TILEBLITTING=y
-CONFIG_FB_EFI=y
-CONFIG_LOGO=y
-# CONFIG_LOGO_LINUX_MONO is not set
-# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_DRM_VIRTIO_GPU=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_HRTIMER=y
@@ -219,6 +235,8 @@ CONFIG_USB_STORAGE=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_DMADEVICES=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_INPUT=y
CONFIG_EEEPC_LAPTOP=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
@@ -240,6 +258,7 @@ CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
+CONFIG_9P_FS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ASCII=y
@@ -251,15 +270,15 @@ CONFIG_SECURITY_SELINUX=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y
CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_PRINTK_TIME=y
+CONFIG_FRAME_WARN=1024
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_STACK_USAGE=y
-CONFIG_DEBUG_STACKOVERFLOW=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_KALLSYMS_ALL=y
-CONFIG_WERROR=y
+CONFIG_UNWINDER_FRAME_POINTER=y
+# CONFIG_64BIT is not set
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index 38c52e4eb30b..69784505a7a8 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -1,3 +1,4 @@
+CONFIG_WERROR=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
@@ -11,14 +12,25 @@ CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_LOG_BUF_SHIFT=18
CONFIG_CGROUPS=y
+CONFIG_BLK_CGROUP=y
CONFIG_CGROUP_SCHED=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_HUGETLB=y
CONFIG_CPUSETS=y
+CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_MISC=y
+CONFIG_CGROUP_DEBUG=y
CONFIG_BLK_DEV_INITRD=y
+CONFIG_KALLSYMS_ALL=y
# CONFIG_COMPAT_BRK is not set
CONFIG_PROFILING=y
CONFIG_SMP=y
+CONFIG_HYPERVISOR_GUEST=y
+CONFIG_PARAVIRT=y
CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
CONFIG_MICROCODE_AMD=y
CONFIG_X86_MSR=y
@@ -41,12 +53,14 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_X86_ACPI_CPUFREQ=y
CONFIG_IA32_EMULATION=y
-CONFIG_EFI_VARS=y
CONFIG_KPROBES=y
CONFIG_JUMP_LABEL=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_BLK_CGROUP_IOLATENCY=y
+CONFIG_BLK_CGROUP_IOCOST=y
+CONFIG_BLK_CGROUP_IOPRIO=y
CONFIG_BINFMT_MISC=y
CONFIG_NET=y
CONFIG_PACKET=y
@@ -101,12 +115,16 @@ CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_MANGLE=y
CONFIG_NET_SCHED=y
+CONFIG_NET_CLS_CGROUP=y
CONFIG_NET_EMATCH=y
CONFIG_NET_CLS_ACT=y
+CONFIG_CGROUP_NET_PRIO=y
CONFIG_CFG80211=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_RFKILL=y
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
CONFIG_PCI=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI=y
@@ -116,13 +134,15 @@ CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_DEBUG_DEVRES=y
CONFIG_CONNECTOR=y
+CONFIG_EFI_VARS=y
CONFIG_BLK_DEV_LOOP=y
+CONFIG_VIRTIO_BLK=y
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_LOWLEVEL is not set
+CONFIG_SCSI_VIRTIO=y
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
CONFIG_ATA_PIIX=y
@@ -138,6 +158,7 @@ CONFIG_MACINTOSH_DRIVERS=y
CONFIG_MAC_EMUMOUSEBTN=y
CONFIG_NETDEVICES=y
CONFIG_NETCONSOLE=y
+CONFIG_VIRTIO_NET=y
CONFIG_TIGON3=y
CONFIG_NET_TULIP=y
CONFIG_E100=y
@@ -162,6 +183,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
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
@@ -175,12 +197,7 @@ CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
CONFIG_DRM=y
CONFIG_DRM_I915=y
-CONFIG_FB_MODE_HELPERS=y
-CONFIG_FB_TILEBLITTING=y
-CONFIG_FB_EFI=y
-CONFIG_LOGO=y
-# CONFIG_LOGO_LINUX_MONO is not set
-# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_DRM_VIRTIO_GPU=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_HRTIMER=y
@@ -213,6 +230,8 @@ CONFIG_USB_STORAGE=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_DMADEVICES=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_INPUT=y
CONFIG_EEEPC_LAPTOP=y
CONFIG_AMD_IOMMU=y
CONFIG_INTEL_IOMMU=y
@@ -237,6 +256,7 @@ CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_ROOT_NFS=y
+CONFIG_9P_FS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ASCII=y
@@ -257,5 +277,3 @@ CONFIG_BLK_DEV_IO_TRACE=y
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_EARLY_PRINTK_DBGP=y
CONFIG_DEBUG_BOOT_PARAMS=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_WERROR=y

2022-03-28 20:37:58

by Nathan Chancellor

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable

On Sun, Mar 27, 2022 at 09:03:14PM +0200, Ingo Molnar wrote:
> Yeah, good catch! ...
>
> I use defconfigs by explicitly adding in the architecture:
>
> kepler:~/tip> make ARCH=i386 defconfig
>
> kepler:~/tip> kconfig-arch
> i386
>
> ... so never I noticed this bug.

Ah, good point!

> I fixed this in the latest version (attached).
>
> Arguably 'make ARCH=i386 savedefconfig' should preserve this, so that
> refreshing defconfigs on bi-arch architectures is idempotent, but that's no
> excuse to regress the existing defconfig behavior.

Hmmm, I thought that it would, but I think the behavior of savedefconfig
is actually correct with regards to how it handles CONFIG_64BIT in the
presence of an explicit ARCH value, based on how CONFIG_64BIT is
defined:

config 64BIT
bool "64-bit kernel" if "$(ARCH)" = "x86"
default "$(ARCH)" != "i386"
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

As the default is no when ARCH == i386 and there is no prompt in that
situation, "# CONFIG_64BIT is not set" gets dropped, as that is the
default. Using savedefconfig without the ARCH variable would do the
right thing.

I tried playing around with these Kconfig symbols to see if I could get
something that would work for savedefconfig with or without ARCH, but I
could not really come up with anything. I did not try super hard though,
it might still be possible.

Cheers,
Nathan

2022-09-02 08:54:08

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable


* Nathan Chancellor <[email protected]> wrote:

> On Sun, Mar 27, 2022 at 09:03:14PM +0200, Ingo Molnar wrote:
> > Yeah, good catch! ...
> >
> > I use defconfigs by explicitly adding in the architecture:
> >
> > kepler:~/tip> make ARCH=i386 defconfig
> >
> > kepler:~/tip> kconfig-arch
> > i386
> >
> > ... so never I noticed this bug.
>
> Ah, good point!
>
> > I fixed this in the latest version (attached).
> >
> > Arguably 'make ARCH=i386 savedefconfig' should preserve this, so that
> > refreshing defconfigs on bi-arch architectures is idempotent, but that's no
> > excuse to regress the existing defconfig behavior.
>
> Hmmm, I thought that it would, but I think the behavior of savedefconfig
> is actually correct with regards to how it handles CONFIG_64BIT in the
> presence of an explicit ARCH value, based on how CONFIG_64BIT is
> defined:
>
> config 64BIT
> bool "64-bit kernel" if "$(ARCH)" = "x86"
> default "$(ARCH)" != "i386"
> 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
>
> As the default is no when ARCH == i386 and there is no prompt in that
> situation, "# CONFIG_64BIT is not set" gets dropped, as that is the
> default. Using savedefconfig without the ARCH variable would do the
> right thing.
>
> I tried playing around with these Kconfig symbols to see if I could get
> something that would work for savedefconfig with or without ARCH, but I
> could not really come up with anything. I did not try super hard though,
> it might still be possible.

Unfortunately, even without the ARCH=i386 'make savedefconfig' doesn't seem
to be doing the right thing & is dropping the '# CONFIG_64BIT is not set'
line:

kepler:~/tip> make ARCH=i386 defconfig
*** Default configuration is based on 'i386_defconfig'
#
# configuration written to .config
#
kepler:~/tip> make savedefconfig
kepler:~/tip> diff -up arch/x86/configs/i386_defconfig defconfig
--- arch/x86/configs/i386_defconfig 2022-09-02 10:45:43.117430882 +0200
+++ defconfig 2022-09-02 10:46:56.663864901 +0200
@@ -282,4 +282,3 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
CONFIG_EARLY_PRINTK_DBGP=y
CONFIG_DEBUG_BOOT_PARAMS=y
CONFIG_UNWINDER_FRAME_POINTER=y
-# CONFIG_64BIT is not set
kepler:~/tip>

This is annoying in that every time I modify the i386 defconfig and use
'make savedefconfig', I have to manually revert that change ...

This reduces the usability of 'make savedefconfig' quite a bit.

Maybe Masahiro-san can tell me how I'm doing this wrong?

Thanks,

Ingo

2022-09-02 09:50:54

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable

On Fri, Sep 2, 2022 at 5:50 PM Ingo Molnar <[email protected]> wrote:
>
>
> * Nathan Chancellor <[email protected]> wrote:
>
> > On Sun, Mar 27, 2022 at 09:03:14PM +0200, Ingo Molnar wrote:
> > > Yeah, good catch! ...
> > >
> > > I use defconfigs by explicitly adding in the architecture:
> > >
> > > kepler:~/tip> make ARCH=i386 defconfig
> > >
> > > kepler:~/tip> kconfig-arch
> > > i386
> > >
> > > ... so never I noticed this bug.
> >
> > Ah, good point!
> >
> > > I fixed this in the latest version (attached).
> > >
> > > Arguably 'make ARCH=i386 savedefconfig' should preserve this, so that
> > > refreshing defconfigs on bi-arch architectures is idempotent, but that's no
> > > excuse to regress the existing defconfig behavior.
> >
> > Hmmm, I thought that it would, but I think the behavior of savedefconfig
> > is actually correct with regards to how it handles CONFIG_64BIT in the
> > presence of an explicit ARCH value, based on how CONFIG_64BIT is
> > defined:
> >
> > config 64BIT
> > bool "64-bit kernel" if "$(ARCH)" = "x86"
> > default "$(ARCH)" != "i386"
> > 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
> >
> > As the default is no when ARCH == i386 and there is no prompt in that
> > situation, "# CONFIG_64BIT is not set" gets dropped, as that is the
> > default. Using savedefconfig without the ARCH variable would do the
> > right thing.
> >
> > I tried playing around with these Kconfig symbols to see if I could get
> > something that would work for savedefconfig with or without ARCH, but I
> > could not really come up with anything. I did not try super hard though,
> > it might still be possible.
>
> Unfortunately, even without the ARCH=i386 'make savedefconfig' doesn't seem
> to be doing the right thing & is dropping the '# CONFIG_64BIT is not set'
> line:


Oh, really?

Without ARCH=i386, it works correctly for me.



masahiro@zoe:~/ref/linux$ make i386_defconfig savedefconfig
#
# No change to .config
#
masahiro@zoe:~/ref/linux$ grep CONFIG_64BIT defconfig
# CONFIG_64BIT is not set




I guess you gave ARCH=i386 somewhere.







> kepler:~/tip> make ARCH=i386 defconfig
> *** Default configuration is based on 'i386_defconfig'
> #
> # configuration written to .config
> #
> kepler:~/tip> make savedefconfig
> kepler:~/tip> diff -up arch/x86/configs/i386_defconfig defconfig
> --- arch/x86/configs/i386_defconfig 2022-09-02 10:45:43.117430882 +0200
> +++ defconfig 2022-09-02 10:46:56.663864901 +0200
> @@ -282,4 +282,3 @@ CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
> CONFIG_EARLY_PRINTK_DBGP=y
> CONFIG_DEBUG_BOOT_PARAMS=y
> CONFIG_UNWINDER_FRAME_POINTER=y
> -# CONFIG_64BIT is not set
> kepler:~/tip>
>
> This is annoying in that every time I modify the i386 defconfig and use
> 'make savedefconfig', I have to manually revert that change ...
>
> This reduces the usability of 'make savedefconfig' quite a bit.
>
> Maybe Masahiro-san can tell me how I'm doing this wrong?
>
> Thanks,
>
> Ingo



--
Best Regards
Masahiro Yamada

2022-09-04 10:28:53

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable


* Masahiro Yamada <[email protected]> wrote:

> > Unfortunately, even without the ARCH=i386 'make savedefconfig' doesn't
> > seem to be doing the right thing & is dropping the '# CONFIG_64BIT is
> > not set' line:
>
>
> Oh, really?
>
> Without ARCH=i386, it works correctly for me.
>
>
>
> masahiro@zoe:~/ref/linux$ make i386_defconfig savedefconfig
> #
> # No change to .config
> #
> masahiro@zoe:~/ref/linux$ grep CONFIG_64BIT defconfig
> # CONFIG_64BIT is not set

Yeah, so why do these two seemingly identical commands produce two
different .config's:

$ make ARCH=i386 defconfig
*** Default configuration is based on 'i386_defconfig'

$ make i386_defconfig

?

Basically the canonical way to generate a defconfig is to provide an ARCH,
then use the common 'defconfig' target:

make ARCH=i386 defconfig
make ARCH=x86 defconfig
make ARCH=arm defconfig
make ARCH=arm64 defconfig
make ARCH=powerpc defconfig
make ARCH=s390 defconfig
make ARCH=sparc defconfig
make ARCH=sparc64 defconfig
...

This is what my build test scripts are using to quick-test cross-arch
builds. It's a straightforward way to generate defconfigs without knowing
the details of the myriads of random defconfig targets some architectures
have, such as:

kepler:~/tip> ls arch/arm/configs/
am200epdkit_defconfig gemini_defconfig multi_v5_defconfig s5pv210_defconfig
aspeed_g4_defconfig h3600_defconfig multi_v7_defconfig sama5_defconfig
aspeed_g5_defconfig h5000_defconfig mv78xx0_defconfig sama7_defconfig
assabet_defconfig hackkit_defconfig mvebu_v5_defconfig shannon_defconfig
at91_dt_defconfig hisi_defconfig mvebu_v7_defconfig shmobile_defconfig
axm55xx_defconfig imxrt_defconfig mxs_defconfig simpad_defconfig
badge4_defconfig imx_v4_v5_defconfig neponset_defconfig socfpga_defconfig
bcm2835_defconfig imx_v6_v7_defconfig netwinder_defconfig sp7021_defconfig
cerfcube_defconfig integrator_defconfig nhk8815_defconfig spear13xx_defconfig
clps711x_defconfig iop32x_defconfig omap1_defconfig spear3xx_defconfig
cm_x300_defconfig ixp4xx_defconfig omap2plus_defconfig spear6xx_defconfig
cns3420vb_defconfig jornada720_defconfig orion5x_defconfig spitz_defconfig
colibri_pxa270_defconfig keystone_defconfig oxnas_v6_defconfig stm32_defconfig
colibri_pxa300_defconfig lart_defconfig palmz72_defconfig sunxi_defconfig
collie_defconfig lpc18xx_defconfig pcm027_defconfig tct_hammer_defconfig
corgi_defconfig lpc32xx_defconfig pleb_defconfig tegra_defconfig
davinci_all_defconfig lpd270_defconfig pxa168_defconfig trizeps4_defconfig
dove_defconfig lubbock_defconfig pxa255-idp_defconfig u8500_defconfig
dram_0x00000000.config magician_defconfig pxa3xx_defconfig versatile_defconfig
dram_0xc0000000.config mainstone_defconfig pxa910_defconfig vexpress_defconfig
dram_0xd0000000.config milbeaut_m10v_defconfig pxa_defconfig vf610m4_defconfig
ep93xx_defconfig mini2440_defconfig qcom_defconfig viper_defconfig
eseries_pxa_defconfig mmp2_defconfig realview_defconfig vt8500_v6_v7_defconfig
exynos_defconfig moxart_defconfig rpc_defconfig xcep_defconfig
ezx_defconfig mps2_defconfig s3c2410_defconfig zeus_defconfig
footbridge_defconfig multi_v4t_defconfig s3c6400_defconfig

But this doesn't seem to be working reliably on i386:

kepler:~/tip> make i386_defconfig
#
# configuration written to .config
#
kepler:~/tip> /bin/cp .config .config.i386_defconfig.1

kepler:~/tip> make ARCH=i386 defconfig
*** Default configuration is based on 'i386_defconfig'
#
# configuration written to .config
#
kepler:~/tip> /bin/cp .config .config.i386_defconfig.2

kepler:~/tip> diff -up .config.i386_defconfig.1 .config.i386_defconfig.2
--- .config.i386_defconfig.1 2022-09-04 11:34:48.253202205 +0200
+++ .config.i386_defconfig.2 2022-09-04 11:35:04.268758331 +0200
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86 6.0.0-rc3 Kernel Configuration
+# Linux/i386 6.0.0-rc3 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 12-20220319-1ubuntu1) 12.0.1 20220319 (experimental) [master r12-7719-g8ca61ad148f]"
CONFIG_CC_IS_GCC=y
@@ -261,7 +261,6 @@ CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
# end of General setup

-# CONFIG_64BIT is not set
CONFIG_X86_32=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y

Note how in the ARCH=i386 case the build system claims to use i386_defconfig:

*** Default configuration is based on 'i386_defconfig'

But that doesn't seem to be identical with when we specify i386_defconfig
directly as a target...

What am I missing?

Thanks,

Ingo

2022-09-05 03:21:39

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable

On Sun, Sep 4, 2022 at 6:48 PM Ingo Molnar <[email protected]> wrote:
>
>
> * Masahiro Yamada <[email protected]> wrote:
>
> > > Unfortunately, even without the ARCH=i386 'make savedefconfig' doesn't
> > > seem to be doing the right thing & is dropping the '# CONFIG_64BIT is
> > > not set' line:
> >
> >
> > Oh, really?
> >
> > Without ARCH=i386, it works correctly for me.
> >
> >
> >
> > masahiro@zoe:~/ref/linux$ make i386_defconfig savedefconfig
> > #
> > # No change to .config
> > #
> > masahiro@zoe:~/ref/linux$ grep CONFIG_64BIT defconfig
> > # CONFIG_64BIT is not set
>
> Yeah, so why do these two seemingly identical commands produce two
> different .config's:
>
> $ make ARCH=i386 defconfig
> *** Default configuration is based on 'i386_defconfig'
>
> $ make i386_defconfig
>
> ?





As Nathan explained in this thread,
the prompt of CONFIG_64BIT is hidden
when ARCH=i386.


config 64BIT
bool "64-bit kernel" if "$(ARCH)" = "x86"
default "$(ARCH)" != "i386"
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




[1] "make ARCH=i386 defconfig"

ARCH is i386, so the Kconfig snippet becomes as follows:


config 64BIT
bool
default n




[2] "make i386_defconfig"


ARCH is x86, so the Kconfig snippet becomes as follows:


config 64BIT
bool "64-bit kernel"
default y







"# ... is not set" is output when
the prompt is visible and the user did not enable it.












> Basically the canonical way to generate a defconfig is to provide an ARCH,
> then use the common 'defconfig' target:



I do not know what you mean by "canonical", but
there are only 3 architectures (x86, sparc, sh) that
allow two ways for configuration.

This is somewhat related to a historical reason
(commit 8c4d9b145ba3 mentioned this a little).

After arch/i386/ and arch/x86_64/ were merged into arch/x86,
ARCH=i386 and ARCH=x86_64 became a subset of ARCH=x86.






>
> make ARCH=i386 defconfig
> make ARCH=x86 defconfig
> make ARCH=arm defconfig
> make ARCH=arm64 defconfig
> make ARCH=powerpc defconfig
> make ARCH=s390 defconfig
> make ARCH=sparc defconfig
> make ARCH=sparc64 defconfig
> ...
>
> This is what my build test scripts are using to quick-test cross-arch
> builds. It's a straightforward way to generate defconfigs without knowing
> the details of the myriads of random defconfig targets some architectures
> have, such as:
>
> kepler:~/tip> ls arch/arm/configs/
> am200epdkit_defconfig gemini_defconfig multi_v5_defconfig s5pv210_defconfig
> aspeed_g4_defconfig h3600_defconfig multi_v7_defconfig sama5_defconfig
> aspeed_g5_defconfig h5000_defconfig mv78xx0_defconfig sama7_defconfig
> assabet_defconfig hackkit_defconfig mvebu_v5_defconfig shannon_defconfig
> at91_dt_defconfig hisi_defconfig mvebu_v7_defconfig shmobile_defconfig
> axm55xx_defconfig imxrt_defconfig mxs_defconfig simpad_defconfig
> badge4_defconfig imx_v4_v5_defconfig neponset_defconfig socfpga_defconfig
> bcm2835_defconfig imx_v6_v7_defconfig netwinder_defconfig sp7021_defconfig
> cerfcube_defconfig integrator_defconfig nhk8815_defconfig spear13xx_defconfig
> clps711x_defconfig iop32x_defconfig omap1_defconfig spear3xx_defconfig
> cm_x300_defconfig ixp4xx_defconfig omap2plus_defconfig spear6xx_defconfig
> cns3420vb_defconfig jornada720_defconfig orion5x_defconfig spitz_defconfig
> colibri_pxa270_defconfig keystone_defconfig oxnas_v6_defconfig stm32_defconfig
> colibri_pxa300_defconfig lart_defconfig palmz72_defconfig sunxi_defconfig
> collie_defconfig lpc18xx_defconfig pcm027_defconfig tct_hammer_defconfig
> corgi_defconfig lpc32xx_defconfig pleb_defconfig tegra_defconfig
> davinci_all_defconfig lpd270_defconfig pxa168_defconfig trizeps4_defconfig
> dove_defconfig lubbock_defconfig pxa255-idp_defconfig u8500_defconfig
> dram_0x00000000.config magician_defconfig pxa3xx_defconfig versatile_defconfig
> dram_0xc0000000.config mainstone_defconfig pxa910_defconfig vexpress_defconfig
> dram_0xd0000000.config milbeaut_m10v_defconfig pxa_defconfig vf610m4_defconfig
> ep93xx_defconfig mini2440_defconfig qcom_defconfig viper_defconfig
> eseries_pxa_defconfig mmp2_defconfig realview_defconfig vt8500_v6_v7_defconfig
> exynos_defconfig moxart_defconfig rpc_defconfig xcep_defconfig
> ezx_defconfig mps2_defconfig s3c2410_defconfig zeus_defconfig
> footbridge_defconfig multi_v4t_defconfig s3c6400_defconfig
>
> But this doesn't seem to be working reliably on i386:
>
> kepler:~/tip> make i386_defconfig
> #
> # configuration written to .config
> #
> kepler:~/tip> /bin/cp .config .config.i386_defconfig.1
>
> kepler:~/tip> make ARCH=i386 defconfig
> *** Default configuration is based on 'i386_defconfig'
> #
> # configuration written to .config
> #
> kepler:~/tip> /bin/cp .config .config.i386_defconfig.2
>
> kepler:~/tip> diff -up .config.i386_defconfig.1 .config.i386_defconfig.2
> --- .config.i386_defconfig.1 2022-09-04 11:34:48.253202205 +0200
> +++ .config.i386_defconfig.2 2022-09-04 11:35:04.268758331 +0200
> @@ -1,6 +1,6 @@
> #
> # Automatically generated file; DO NOT EDIT.
> -# Linux/x86 6.0.0-rc3 Kernel Configuration
> +# Linux/i386 6.0.0-rc3 Kernel Configuration
> #
> CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 12-20220319-1ubuntu1) 12.0.1 20220319 (experimental) [master r12-7719-g8ca61ad148f]"
> CONFIG_CC_IS_GCC=y
> @@ -261,7 +261,6 @@ CONFIG_PROFILING=y
> CONFIG_TRACEPOINTS=y
> # end of General setup
>
> -# CONFIG_64BIT is not set
> CONFIG_X86_32=y
> CONFIG_X86=y
> CONFIG_INSTRUCTION_DECODER=y
>
> Note how in the ARCH=i386 case the build system claims to use i386_defconfig:
>
> *** Default configuration is based on 'i386_defconfig'
>
> But that doesn't seem to be identical with when we specify i386_defconfig
> directly as a target...
>
> What am I missing?
>
> Thanks,
>
> Ingo





--
Best Regards
Masahiro Yamada

2022-09-05 09:58:09

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable


* Masahiro Yamada <[email protected]> wrote:

> On Sun, Sep 4, 2022 at 6:48 PM Ingo Molnar <[email protected]> wrote:
> >
> >
> > * Masahiro Yamada <[email protected]> wrote:
> >
> > > > Unfortunately, even without the ARCH=i386 'make savedefconfig' doesn't
> > > > seem to be doing the right thing & is dropping the '# CONFIG_64BIT is
> > > > not set' line:
> > >
> > >
> > > Oh, really?
> > >
> > > Without ARCH=i386, it works correctly for me.
> > >
> > >
> > >
> > > masahiro@zoe:~/ref/linux$ make i386_defconfig savedefconfig
> > > #
> > > # No change to .config
> > > #
> > > masahiro@zoe:~/ref/linux$ grep CONFIG_64BIT defconfig
> > > # CONFIG_64BIT is not set
> >
> > Yeah, so why do these two seemingly identical commands produce two
> > different .config's:
> >
> > $ make ARCH=i386 defconfig
> > *** Default configuration is based on 'i386_defconfig'
> >
> > $ make i386_defconfig
> >
> > ?
>
>
>
> As Nathan explained in this thread,
> the prompt of CONFIG_64BIT is hidden
> when ARCH=i386.

Yeah, so my 'why' question was more about why we'd tolerate the UI
inconsistency in seemingly similar commands generating subtly different
.config's.

In other words, what should we modify in this Kconfig block, or in other
parts of the kernel:

> config 64BIT
> bool "64-bit kernel" if "$(ARCH)" = "x86"
> default "$(ARCH)" != "i386"
> 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

... to not have this Kconfig UI quirk/bug/inconsistency?

I hope we agree that the status quo is not ideal.

Thanks,

Ingo

2022-09-10 17:40:07

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] x86/config: Make the x86 defconfigs a bit more usable

On Fri, Sep 9, 2022 at 6:05 PM Masahiro Yamada <[email protected]> wrote:
>
> If you do not like the inconsistency,
> the support for ARCH=i386 and ARCH=x86_64 must be removed.

Is there any sane alternative for "do cross-architecture test builds"?

I do things like "make ARCH=i386 allmodconfig" myself, and I have to
admit that it's annoying that you have to then remember to do "make
ARCH=ii386" to do the actual build too, because otherwise Kcoinfig
will mess up the architecture, because it didn't make it into the
final simplified .config.

This is probably more noticeable with "defconfig" because then the
"ARCH=xyz" part has *other* effects too (ie it is also what says
*which* defconfig to pick).

So this is a bit of an annoyance, in that it's not trivial to just
"make the config for ARCH xyz" and then "make".

Linus