public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: use #error instead of BUILD_BUG_ON
@ 2026-02-11 17:07 Alexey Dobriyan
  2026-02-12 19:18 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2026-02-11 17:07 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson; +Cc: kvm

Force preprocessing error instead of expanding BUILD_BUG_ON macro and
forcing compile error at later stage.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/include/asm/kvm-x86-ops.h     |    2 +-
 arch/x86/include/asm/kvm-x86-pmu-ops.h |    2 +-
 arch/x86/kvm/vmx/vmcs_shadow_fields.h  |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/arch/x86/include/asm/kvm-x86-ops.h
+++ b/arch/x86/include/asm/kvm-x86-ops.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #if !defined(KVM_X86_OP) || !defined(KVM_X86_OP_OPTIONAL)
-BUILD_BUG_ON(1)
+#error
 #endif
 
 /*
--- a/arch/x86/include/asm/kvm-x86-pmu-ops.h
+++ b/arch/x86/include/asm/kvm-x86-pmu-ops.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #if !defined(KVM_X86_PMU_OP) || !defined(KVM_X86_PMU_OP_OPTIONAL)
-BUILD_BUG_ON(1)
+#error
 #endif
 
 /*
--- a/arch/x86/kvm/vmx/vmcs_shadow_fields.h
+++ b/arch/x86/kvm/vmx/vmcs_shadow_fields.h
@@ -1,5 +1,5 @@
 #if !defined(SHADOW_FIELD_RO) && !defined(SHADOW_FIELD_RW)
-BUILD_BUG_ON(1)
+#error
 #endif
 
 #ifndef SHADOW_FIELD_RO

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

end of thread, other threads:[~2026-02-12 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-11 17:07 [PATCH] kvm: use #error instead of BUILD_BUG_ON Alexey Dobriyan
2026-02-12 19:18 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox