diff options
author | Pierrick Bouvier <pierrick.bouvier@linaro.org> | 2025-03-24 21:59:02 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2025-04-23 15:04:57 -0700 |
commit | f1d2a8e95383090c8b3a57138f742fbd9aedf678 (patch) | |
tree | 89d7d1f9053df8c1aeddc1e5bfb6a9b80afdfec3 | |
parent | 0df783b2fbeca9aa3cc19adafb9a4ec7f97e3a6d (diff) | |
download | qemu-f1d2a8e95383090c8b3a57138f742fbd9aedf678.zip qemu-f1d2a8e95383090c8b3a57138f742fbd9aedf678.tar.gz qemu-f1d2a8e95383090c8b3a57138f742fbd9aedf678.tar.bz2 |
accel/kvm: move KVM_HAVE_MCE_INJECTION define to kvm-all.c
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>
-rw-r--r-- | accel/kvm/kvm-all.c | 5 | ||||
-rw-r--r-- | include/system/kvm.h | 2 | ||||
-rw-r--r-- | target/arm/cpu.h | 4 | ||||
-rw-r--r-- | target/i386/cpu.h | 2 |
4 files changed, 5 insertions, 8 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index a30b19f..cba9c78 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -57,6 +57,11 @@ #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. */ diff --git a/include/system/kvm.h b/include/system/kvm.h index 21da3b8..18811ca 100644 --- a/include/system/kvm.h +++ b/include/system/kvm.h @@ -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); diff --git a/target/arm/cpu.h b/target/arm/cpu.h index ea99563..a8a1a8f 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -33,10 +33,6 @@ #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 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index bd63036..17ad0b6 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -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 |