From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org, qemu-arm@nongnu.org,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>
Subject: [PATCH v2 18/30] accel/kvm: move KVM_HAVE_MCE_INJECTION define to kvm-all.c
Date: Thu, 20 Mar 2025 15:29:50 -0700 [thread overview]
Message-ID: <20250320223002.2915728-19-pierrick.bouvier@linaro.org> (raw)
In-Reply-To: <20250320223002.2915728-1-pierrick.bouvier@linaro.org>
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.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
include/system/kvm.h | 2 --
target/arm/cpu.h | 4 ----
target/i386/cpu.h | 2 --
accel/kvm/kvm-all.c | 5 +++++
4 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/include/system/kvm.h b/include/system/kvm.h
index 716c7dcdf6b..b690dda1370 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -392,9 +392,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 ea9956395ca..a8a1a8faf6b 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 049bdd1a893..44ee263d8f1 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
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 0723a3933bb..7c5d1a98bc4 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.
*/
--
2.39.5
next prev parent reply other threads:[~2025-03-20 22:41 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 22:29 [PATCH v2 00/30] single-binary: start make hw/arm/ common Pierrick Bouvier
2025-03-20 22:29 ` [PATCH v2 01/30] exec/cpu-all: remove BSWAP_NEEDED Pierrick Bouvier
2025-03-23 19:26 ` Richard Henderson
2025-03-24 20:54 ` Pierrick Bouvier
2025-03-20 22:29 ` [PATCH v2 02/30] exec/cpu-all: extract tlb flags defines to exec/tlb-flags.h Pierrick Bouvier
2025-03-23 19:28 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 03/30] exec/cpu-all: move cpu_copy to linux-user/qemu.h Pierrick Bouvier
2025-03-21 15:36 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 04/30] include/exec/cpu-all: move compile time check for CPUArchState to cpu-target.c Pierrick Bouvier
2025-03-21 15:42 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 05/30] exec/cpu-all: remove system/memory include Pierrick Bouvier
2025-03-21 16:36 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 06/30] exec/cpu-all: remove exec/page-protection include Pierrick Bouvier
2025-03-21 16:37 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 07/30] exec/cpu-all: remove tswap include Pierrick Bouvier
2025-03-21 16:37 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 08/30] exec/cpu-all: remove exec/cpu-interrupt include Pierrick Bouvier
2025-03-21 16:38 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 09/30] exec/cpu-all: remove exec/cpu-defs include Pierrick Bouvier
2025-03-21 16:38 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 10/30] exec/cpu-all: remove exec/target_page include Pierrick Bouvier
2025-03-23 19:29 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 11/30] exec/cpu-all: remove hw/core/cpu.h include Pierrick Bouvier
2025-03-21 18:00 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 12/30] accel/tcg: fix missing includes for TCG_GUEST_DEFAULT_MO Pierrick Bouvier
2025-03-21 18:01 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 13/30] accel/tcg: fix missing includes for TARGET_HAS_PRECISE_SMC Pierrick Bouvier
2025-03-21 18:02 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 14/30] exec/cpu-all: remove cpu include Pierrick Bouvier
2025-03-21 18:02 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 15/30] exec/cpu-all: transfer exec/cpu-common include to cpu.h headers Pierrick Bouvier
2025-03-21 18:03 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 16/30] exec/cpu-all: remove this header Pierrick Bouvier
2025-03-21 18:04 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 17/30] exec/target_page: runtime defintion for TARGET_PAGE_BITS_MIN Pierrick Bouvier
2025-03-21 18:05 ` Richard Henderson
2025-03-21 18:09 ` Pierrick Bouvier
2025-03-21 19:27 ` Richard Henderson
2025-03-21 20:11 ` Pierrick Bouvier
2025-03-21 22:19 ` Richard Henderson
2025-03-22 0:01 ` Pierrick Bouvier
2025-03-22 0:20 ` Pierrick Bouvier
2025-03-22 20:55 ` Richard Henderson
2025-03-24 21:39 ` Pierrick Bouvier
2025-03-20 22:29 ` Pierrick Bouvier [this message]
2025-03-23 19:35 ` [PATCH v2 18/30] accel/kvm: move KVM_HAVE_MCE_INJECTION define to kvm-all.c Richard Henderson
2025-03-20 22:29 ` [PATCH v2 19/30] exec/poison: KVM_HAVE_MCE_INJECTION can now be poisoned Pierrick Bouvier
2025-03-20 22:29 ` [PATCH v2 20/30] target/arm/cpu: always define kvm related registers Pierrick Bouvier
2025-03-23 19:37 ` Richard Henderson
2025-03-24 21:11 ` Pierrick Bouvier
2025-03-25 1:24 ` Richard Henderson
2025-04-02 13:36 ` Philippe Mathieu-Daudé
2025-04-02 15:06 ` Pierrick Bouvier
2025-03-20 22:29 ` [PATCH v2 21/30] target/arm/cpu: flags2 is always uint64_t Pierrick Bouvier
2025-03-20 22:29 ` [PATCH v2 22/30] target/arm/cpu: define same set of registers for aarch32 and aarch64 Pierrick Bouvier
2025-03-20 22:29 ` [PATCH v2 23/30] target/arm/cpu: remove inline stubs for aarch32 emulation Pierrick Bouvier
2025-03-23 19:41 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 24/30] meson: add common hw files Pierrick Bouvier
2025-03-23 19:58 ` Richard Henderson
2025-03-24 21:21 ` Pierrick Bouvier
2025-03-20 22:29 ` [PATCH v2 25/30] hw/arm/boot: make compilation unit hw common Pierrick Bouvier
2025-03-23 19:46 ` Richard Henderson
2025-03-20 22:29 ` [PATCH v2 26/30] hw/arm/armv7m: prepare compilation unit to be common Pierrick Bouvier
2025-03-23 19:48 ` Richard Henderson
2025-03-24 21:31 ` Pierrick Bouvier
2025-03-25 1:22 ` Richard Henderson
2025-03-25 1:48 ` Pierrick Bouvier
2025-03-20 22:29 ` [PATCH v2 27/30] hw/arm/digic_boards: " Pierrick Bouvier
2025-03-23 19:49 ` Richard Henderson
2025-03-20 22:30 ` [PATCH v2 28/30] hw/arm/xlnx-zynqmp: " Pierrick Bouvier
2025-03-23 19:50 ` Richard Henderson
2025-03-24 21:23 ` Pierrick Bouvier
2025-03-20 22:30 ` [PATCH v2 29/30] hw/arm/xlnx-versal: " Pierrick Bouvier
2025-03-23 19:50 ` Richard Henderson
2025-03-20 22:30 ` [PATCH v2 30/30] hw/arm: make most of the compilation units common Pierrick Bouvier
2025-03-23 19:51 ` Richard Henderson
2025-03-20 22:49 ` [PATCH v2 00/30] single-binary: start make hw/arm/ common Pierrick Bouvier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250320223002.2915728-19-pierrick.bouvier@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).