From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Eric Farman" <farman@linux.ibm.com>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Matthew Rosato" <mjrosato@linux.ibm.com>,
"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
kvm@vger.kernel.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Huacai Chen" <chenhuacai@kernel.org>,
qemu-riscv@nongnu.org, "Alexander Graf" <agraf@csgraf.de>,
"Pedro Barbuda" <pbarbuda@microsoft.com>,
"Anton Johansson" <anjo@rev.ng>, "Song Gao" <gaosong@loongson.cn>,
"Weiwei Li" <liwei1518@gmail.com>,
"Aleksandar Rikalo" <arikalo@gmail.com>,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
"Cornelia Huck" <cohuck@redhat.com>,
qemu-s390x@nongnu.org, "Chao Liu" <chao.liu.zevorn@gmail.com>,
"Bibo Mao" <maobibo@loongson.cn>,
qemu-arm@nongnu.org, "Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Mohamed Mediouni" <mohamed@unpredictable.fr>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH-for-11.1 2/8] accel/kvm: Remove TARGET_KVM_HAVE_GUEST_DEBUG
Date: Wed, 1 Apr 2026 22:17:46 +0200 [thread overview]
Message-ID: <20260401201753.92290-3-philmd@linaro.org> (raw)
In-Reply-To: <20260401201753.92290-1-philmd@linaro.org>
All targets except MIPS have TARGET_KVM_HAVE_GUEST_DEBUG=y.
Declare the kvm_update_guest_debug() stub to MIPS and have
TARGET_KVM_HAVE_GUEST_DEBUG be the default.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
configs/targets/aarch64-softmmu.mak | 1 -
configs/targets/i386-softmmu.mak | 1 -
configs/targets/loongarch64-softmmu.mak | 1 -
configs/targets/ppc-softmmu.mak | 1 -
configs/targets/ppc64-softmmu.mak | 1 -
configs/targets/riscv64-softmmu.mak | 1 -
configs/targets/s390x-softmmu.mak | 1 -
configs/targets/x86_64-softmmu.mak | 1 -
include/system/kvm.h | 7 -------
include/system/kvm_int.h | 2 --
accel/kvm/kvm-accel-ops.c | 4 ----
accel/kvm/kvm-all.c | 13 ++-----------
target/mips/kvm.c | 5 +++++
13 files changed, 7 insertions(+), 32 deletions(-)
diff --git a/configs/targets/aarch64-softmmu.mak b/configs/targets/aarch64-softmmu.mak
index d34aead41c4..6f60ca6505c 100644
--- a/configs/targets/aarch64-softmmu.mak
+++ b/configs/targets/aarch64-softmmu.mak
@@ -1,6 +1,5 @@
TARGET_ARCH=aarch64
TARGET_BASE_ARCH=arm
-TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-vfp-sysregs.xml arm-neon.xml arm-m-profile.xml arm-m-profile-mve.xml aarch64-pauth.xml aarch64-sme2.xml
# needed by boot.c
TARGET_NEED_FDT=y
diff --git a/configs/targets/i386-softmmu.mak b/configs/targets/i386-softmmu.mak
index 38a8f85201f..2eef68dc55e 100644
--- a/configs/targets/i386-softmmu.mak
+++ b/configs/targets/i386-softmmu.mak
@@ -1,5 +1,4 @@
TARGET_ARCH=i386
-TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_KVM_HAVE_RESET_PARKED_VCPU=y
TARGET_XML_FILES= i386-32bit.xml
TARGET_LONG_BITS=32
diff --git a/configs/targets/loongarch64-softmmu.mak b/configs/targets/loongarch64-softmmu.mak
index 476407f9413..7e0b1ab5d05 100644
--- a/configs/targets/loongarch64-softmmu.mak
+++ b/configs/targets/loongarch64-softmmu.mak
@@ -1,6 +1,5 @@
TARGET_ARCH=loongarch64
TARGET_BASE_ARCH=loongarch
-TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= loongarch-base32.xml loongarch-base64.xml loongarch-fpu.xml loongarch-lsx.xml loongarch-lasx.xml
# all boards require libfdt
TARGET_NEED_FDT=y
diff --git a/configs/targets/ppc-softmmu.mak b/configs/targets/ppc-softmmu.mak
index 867898bd47c..c47887f8992 100644
--- a/configs/targets/ppc-softmmu.mak
+++ b/configs/targets/ppc-softmmu.mak
@@ -1,5 +1,4 @@
TARGET_ARCH=ppc
TARGET_BIG_ENDIAN=y
-TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= power-core.xml power-fpu.xml power-altivec.xml power-spe.xml
TARGET_LONG_BITS=32
diff --git a/configs/targets/ppc64-softmmu.mak b/configs/targets/ppc64-softmmu.mak
index 10d7a2681e7..8c6dc84b821 100644
--- a/configs/targets/ppc64-softmmu.mak
+++ b/configs/targets/ppc64-softmmu.mak
@@ -1,7 +1,6 @@
TARGET_ARCH=ppc64
TARGET_BASE_ARCH=ppc
TARGET_BIG_ENDIAN=y
-TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml
# all boards require libfdt
TARGET_NEED_FDT=y
diff --git a/configs/targets/riscv64-softmmu.mak b/configs/targets/riscv64-softmmu.mak
index 5059c550480..e0d2c7032d6 100644
--- a/configs/targets/riscv64-softmmu.mak
+++ b/configs/targets/riscv64-softmmu.mak
@@ -1,6 +1,5 @@
TARGET_ARCH=riscv64
TARGET_BASE_ARCH=riscv
-TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= riscv-64bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-64bit-virtual.xml riscv-32bit-cpu.xml riscv-32bit-virtual.xml
# needed by boot.c
TARGET_NEED_FDT=y
diff --git a/configs/targets/s390x-softmmu.mak b/configs/targets/s390x-softmmu.mak
index e273075f1a9..699e5ced96f 100644
--- a/configs/targets/s390x-softmmu.mak
+++ b/configs/targets/s390x-softmmu.mak
@@ -1,6 +1,5 @@
TARGET_ARCH=s390x
TARGET_BIG_ENDIAN=y
-TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_XML_FILES= s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml s390-virt.xml s390-virt-kvm.xml s390-gs.xml
TARGET_LONG_BITS=64
TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
diff --git a/configs/targets/x86_64-softmmu.mak b/configs/targets/x86_64-softmmu.mak
index c7f8746b4f5..491173df466 100644
--- a/configs/targets/x86_64-softmmu.mak
+++ b/configs/targets/x86_64-softmmu.mak
@@ -1,6 +1,5 @@
TARGET_ARCH=x86_64
TARGET_BASE_ARCH=i386
-TARGET_KVM_HAVE_GUEST_DEBUG=y
TARGET_KVM_HAVE_RESET_PARKED_VCPU=y
TARGET_XML_FILES= i386-64bit.xml i386-64bit-apx.xml
TARGET_LONG_BITS=64
diff --git a/include/system/kvm.h b/include/system/kvm.h
index 12f7fc8fb58..a2463a3ac3f 100644
--- a/include/system/kvm.h
+++ b/include/system/kvm.h
@@ -236,14 +236,7 @@ void kvm_irqchip_change_notify(void);
* calling down to kvm_arch_update_guest_debug after the generic
* fields have been set.
*/
-#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap);
-#else
-static inline int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
-{
- return -EINVAL;
-}
-#endif
/* internal API */
diff --git a/include/system/kvm_int.h b/include/system/kvm_int.h
index 0876aac938d..9d1d3fd3deb 100644
--- a/include/system/kvm_int.h
+++ b/include/system/kvm_int.h
@@ -113,9 +113,7 @@ struct KVMState
struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
bool coalesced_flush_in_progress;
int vcpu_events;
-#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
QTAILQ_HEAD(, kvm_sw_breakpoint) kvm_sw_breakpoints;
-#endif
int max_nested_state_len;
int kvm_shadow_mem;
bool kernel_irqchip_allowed;
diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c
index 6d9140e549f..d4af6b416c3 100644
--- a/accel/kvm/kvm-accel-ops.c
+++ b/accel/kvm/kvm-accel-ops.c
@@ -85,12 +85,10 @@ static bool kvm_cpus_are_resettable(void)
return !kvm_enabled() || !kvm_state->guest_state_protected;
}
-#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
static int kvm_update_guest_debug_ops(CPUState *cpu)
{
return kvm_update_guest_debug(cpu, 0);
}
-#endif
static void kvm_accel_ops_class_init(ObjectClass *oc, const void *data)
{
@@ -105,13 +103,11 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, const void *data)
ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm;
ops->handle_interrupt = generic_handle_interrupt;
-#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
ops->update_guest_debug = kvm_update_guest_debug_ops;
ops->supports_guest_debug = kvm_supports_guest_debug;
ops->insert_breakpoint = kvm_insert_breakpoint;
ops->remove_breakpoint = kvm_remove_breakpoint;
ops->remove_all_breakpoints = kvm_remove_all_breakpoints;
-#endif
}
static const TypeInfo kvm_accel_ops_type = {
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 774499d34f8..9a46a61b7f5 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2919,9 +2919,7 @@ static int kvm_init(AccelState *as, MachineState *ms)
s->sigmask_len = 8;
accel_blocker_init();
-#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
QTAILQ_INIT(&s->kvm_sw_breakpoints);
-#endif
QLIST_INIT(&s->kvm_parked_vcpus);
s->fd = qemu_open_old(s->device ?: "/dev/kvm", O_RDWR);
if (s->fd == -1) {
@@ -3032,23 +3030,19 @@ static int kvm_init(AccelState *as, MachineState *ms)
kvm_vm_attributes_allowed =
(kvm_check_extension(s, KVM_CAP_VM_ATTRIBUTES) > 0);
-#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
kvm_has_guest_debug =
(kvm_check_extension(s, KVM_CAP_SET_GUEST_DEBUG) > 0);
-#endif
kvm_sstep_flags = 0;
if (kvm_has_guest_debug) {
- kvm_sstep_flags = SSTEP_ENABLE;
-
-#if defined TARGET_KVM_HAVE_GUEST_DEBUG
int guest_debug_flags =
kvm_check_extension(s, KVM_CAP_SET_GUEST_DEBUG2);
+ kvm_sstep_flags = SSTEP_ENABLE;
+
if (guest_debug_flags & KVM_GUESTDBG_BLOCKIRQ) {
kvm_sstep_flags |= SSTEP_NOIRQ;
}
-#endif
}
kvm_state = s;
@@ -3781,7 +3775,6 @@ bool kvm_arm_supports_user_irq(void)
return kvm_check_extension(kvm_state, KVM_CAP_ARM_USER_IRQ);
}
-#ifdef TARGET_KVM_HAVE_GUEST_DEBUG
struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *cpu, vaddr pc)
{
struct kvm_sw_breakpoint *bp;
@@ -3941,8 +3934,6 @@ void kvm_remove_all_breakpoints(CPUState *cpu)
}
}
-#endif /* !TARGET_KVM_HAVE_GUEST_DEBUG */
-
static int kvm_set_signal_mask(CPUState *cpu, const sigset_t *sigset)
{
KVMState *s = kvm_state;
diff --git a/target/mips/kvm.c b/target/mips/kvm.c
index a85e162409c..49bff68b137 100644
--- a/target/mips/kvm.c
+++ b/target/mips/kvm.c
@@ -1262,6 +1262,11 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)
abort();
}
+int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
+{
+ return -EINVAL;
+}
+
int kvm_arch_get_default_type(MachineState *machine)
{
#if defined(KVM_CAP_MIPS_VZ)
--
2.53.0
next prev parent reply other threads:[~2026-04-01 20:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 20:17 [PATCH-for-11.1 0/8] target/arm: Compile accelerator-related objects as common code Philippe Mathieu-Daudé
2026-04-01 20:17 ` [PATCH-for-11.1 1/8] accel/kvm: Include missing 'exec/vaddr.h' header Philippe Mathieu-Daudé
2026-04-02 0:45 ` Alistair Francis
2026-04-01 20:17 ` Philippe Mathieu-Daudé [this message]
2026-04-02 0:45 ` [PATCH-for-11.1 2/8] accel/kvm: Remove TARGET_KVM_HAVE_GUEST_DEBUG Alistair Francis
2026-04-01 20:17 ` [PATCH-for-11.1 3/8] accel/kvm: Expose all non-target specific declarations Philippe Mathieu-Daudé
2026-04-01 21:02 ` Philippe Mathieu-Daudé
2026-04-01 20:17 ` [PATCH-for-11.1 4/8] target/arm: Compile WHPX as common object Philippe Mathieu-Daudé
2026-04-01 20:17 ` [PATCH-for-11.1 5/8] target/arm: Remove target_ulong use in hvf_handle_psci_call() Philippe Mathieu-Daudé
2026-04-01 20:17 ` [PATCH-for-11.1 6/8] target/arm: Compile HVF as common object Philippe Mathieu-Daudé
2026-04-01 20:17 ` [PATCH-for-11.1 7/8] target/arm: Remove target_ulong cast in kvm_arm_handle_dabt_nisv() Philippe Mathieu-Daudé
2026-04-01 20:17 ` [PATCH-for-11.1 8/8] target/arm: Compile KVM as common object Philippe Mathieu-Daudé
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=20260401201753.92290-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=agraf@csgraf.de \
--cc=alistair.francis@wdc.com \
--cc=anjo@rev.ng \
--cc=arikalo@gmail.com \
--cc=aurelien@aurel32.net \
--cc=chao.liu.zevorn@gmail.com \
--cc=chenhuacai@kernel.org \
--cc=cohuck@redhat.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=farman@linux.ibm.com \
--cc=gaosong@loongson.cn \
--cc=jiaxun.yang@flygoat.com \
--cc=kvm@vger.kernel.org \
--cc=liwei1518@gmail.com \
--cc=maobibo@loongson.cn \
--cc=mjrosato@linux.ibm.com \
--cc=mohamed@unpredictable.fr \
--cc=palmer@dabbelt.com \
--cc=pbarbuda@microsoft.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=zhao1.liu@intel.com \
--cc=zhiwei_liu@linux.alibaba.com \
/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