Skip to content

Commit 75bedc1

Browse files
committed
KVM: x86: Turn off KVM_WERROR by default for all configs
Don't enable KVM_WERROR by default for x86-64 builds as KVM's one-off -Werror enabling is *mostly* superseded by the kernel-wide WERROR, and enabling KVM_WERROR by default can cause problems for developers working on other subsystems. E.g. subsystems that have a "zero W=1 regressions" rule can inadvertently build KVM with -Werror and W=1, and end up with build failures that are completely uninteresting to the developer (W=1 is prone to false positives, especially on older compilers). Keep KVM_WERROR as there are combinations where enabling WERROR isn't feasible, e.g. the default FRAME_WARN=1024 on i386 builds generates a non-zero number of warnings and thus errors, and there are far too many warnings throughout the kernel to enable WERROR with W=1 (building KVM with -Werror is desirable (with a sane compiler) as W=1 does generate useful warnings). Opportunistically drop the dependency on !COMPILE_TEST as it's completely meaningless (it was copied from i195's -Werror Kconfig), as the kernel's WERROR is explicitly *enabled* for COMPILE_TEST=y kernel's, i.e. enabling -Werror is obviosly not dependent on COMPILE_TEST=n. Reported-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/all/20231006205415.3501535-1-kuba@kernel.org Link: https://lore.kernel.org/r/20231018151906.1841689-1-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent e9e60c8 commit 75bedc1

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

arch/x86/kvm/Kconfig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ config KVM
6565

6666
config KVM_WERROR
6767
bool "Compile KVM with -Werror"
68-
# KASAN may cause the build to fail due to larger frames
69-
default y if X86_64 && !KASAN
70-
# We use the dependency on !COMPILE_TEST to not be enabled
71-
# blindly in allmodconfig or allyesconfig configurations
72-
depends on KVM
73-
depends on (X86_64 && !KASAN) || !COMPILE_TEST
74-
depends on EXPERT
68+
# Disallow KVM's -Werror if KASAN is enabled, e.g. to guard against
69+
# randomized configs from selecting KVM_WERROR=y, which doesn't play
70+
# nice with KASAN. KASAN builds generates warnings for the default
71+
# FRAME_WARN, i.e. KVM_WERROR=y with KASAN=y requires special tuning.
72+
# Building KVM with -Werror and KASAN is still doable via enabling
73+
# the kernel-wide WERROR=y.
74+
depends on KVM && EXPERT && !KASAN
7575
help
7676
Add -Werror to the build flags for KVM.
7777

0 commit comments

Comments
 (0)