]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/kvm: move KVM_HAVE_MCE_INJECTION define to kvm-all.c
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Tue, 25 Mar 2025 04:59:02 +0000 (21:59 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 23 Apr 2025 22:04:57 +0000 (15:04 -0700)
This define is used only in accel/kvm/kvm-all.c, so we push directly the
definition there. Add more visibility to kvm_arch_on_sigbus_vcpu() to
allow removing this define from any header.

The architectures defining KVM_HAVE_MCE_INJECTION are i386, x86_64 and
aarch64.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20250325045915.994760-18-pierrick.bouvier@linaro.org>

accel/kvm/kvm-all.c
include/system/kvm.h
target/arm/cpu.h
target/i386/cpu.h

index a30b19f455aa05356264c6865add76ea4c3fe265..cba9c78d2ff122414fb23e43d86675a791bb68fb 100644 (file)
 #include <sys/eventfd.h>
 #endif
 
+#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
+# define KVM_HAVE_MCE_INJECTION 1
+#endif
+
+
 /* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We
  * need to use the real host PAGE_SIZE, as that's what KVM will use.
  */
index 21da3b8b05261c78b86685fab19145ee5a0c9d8e..18811cad6fd0f5ad747dd54b3a696b964a72d5cb 100644 (file)
@@ -390,9 +390,7 @@ bool kvm_vcpu_id_is_valid(int vcpu_id);
 /* Returns VCPU ID to be used on KVM_CREATE_VCPU ioctl() */
 unsigned long kvm_arch_vcpu_id(CPUState *cpu);
 
-#ifdef KVM_HAVE_MCE_INJECTION
 void kvm_arch_on_sigbus_vcpu(CPUState *cpu, int code, void *addr);
-#endif
 
 void kvm_arch_init_irq_routing(KVMState *s);
 
index ea9956395ca803bd0ac465b64b898aa94e0f0f84..a8a1a8faf6bf60f9a463bf77d082376d8c8d8bcd 100644 (file)
 #include "target/arm/multiprocessing.h"
 #include "target/arm/gtimer.h"
 
-#ifdef TARGET_AARCH64
-#define KVM_HAVE_MCE_INJECTION 1
-#endif
-
 #define EXCP_UDEF            1   /* undefined instruction */
 #define EXCP_SWI             2   /* software interrupt */
 #define EXCP_PREFETCH_ABORT  3
index bd63036334566975c666c6a8f3f34ce8ed87934d..17ad0b644bd97bafc630d9e4bee24ec488a7f200 100644 (file)
@@ -35,8 +35,6 @@
 
 #define XEN_NR_VIRQS 24
 
-#define KVM_HAVE_MCE_INJECTION 1
-
 /* support for self modifying code even if the modified instruction is
    close to the modifying instruction */
 #define TARGET_HAS_PRECISE_SMC