whpx: i386: re-enable guest debug support
Fix what got broken several years ago by adding ops->supports_guest_debug support as an architecture-specific function. arm64 WHP doesn't currently provide support needed for this. Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Link: https://lore.kernel.org/r/20260223233950.96076-7-mohamed@unpredictable.fr Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Mohamed Mediouni committed
Feb 24, 2026 at 00:39 UTC
19b48084f713fb5c894c6979f4d583fe809c1c6b
4 files changed
+22
accel/whpx/whpx-accel-ops.c
+8
@@ -17,6 +17,7 @@
17
18
#include "system/whpx.h"
19
#include "system/whpx-internal.h"
20
+#include "system/whpx-all.h"
21
#include "system/whpx-accel-ops.h"
22
23
static void *whpx_cpu_thread_fn(void *arg)
@@ -81,6 +82,12 @@ static bool whpx_vcpu_thread_is_idle(CPUState *cpu)
82
return !whpx_irqchip_in_kernel();
83
}
84
85
+static bool whpx_supports_guest_debug(void)
86
+{
87
+ return whpx_arch_supports_guest_debug();
88
+}
89
+
90
+
91
static void whpx_accel_ops_class_init(ObjectClass *oc, const void *data)
92
{
93
AccelOpsClass *ops = ACCEL_OPS_CLASS(oc);
@@ -89,6 +96,7 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, const void *data)
96
ops->kick_vcpu_thread = whpx_kick_vcpu_thread;
97
ops->cpu_thread_is_idle = whpx_vcpu_thread_is_idle;
98
ops->handle_interrupt = generic_handle_interrupt;
99
+ ops->supports_guest_debug = whpx_supports_guest_debug;
100
101
ops->synchronize_post_reset = whpx_cpu_synchronize_post_reset;
102
ops->synchronize_post_init = whpx_cpu_synchronize_post_init;
include/system/whpx-all.h
+4
@@ -17,4 +17,8 @@ void whpx_translate_cpu_breakpoints(
17
struct whpx_breakpoints *breakpoints,
18
CPUState *cpu,
19
int cpu_breakpoint_count);
20
+
21
+/* called by whpx-accel-ops */
22
+bool whpx_arch_supports_guest_debug(void);
23
+
24
#endif
target/arm/whpx/whpx-all.c
+5
@@ -303,6 +303,11 @@ void whpx_translate_cpu_breakpoints(
303
/* Breakpoints aren’t supported on this platform */
304
}
305
306
+bool whpx_arch_supports_guest_debug(void)
307
+{
308
+ return false;
309
+}
310
+
311
static void whpx_get_reg(CPUState *cpu, WHV_REGISTER_NAME reg, WHV_REGISTER_VALUE* val)
312
{
313
struct whpx_state *whpx = &whpx_global;
target/i386/whpx/whpx-all.c
+5
@@ -1272,6 +1272,11 @@ void whpx_apply_breakpoints(
1272
}
1273
}
1274
1275
+bool whpx_arch_supports_guest_debug(void)
1276
+{
1277
+ return true;
1278
+}
1279
+
1280
/* Returns the address of the next instruction that is about to be executed. */
1281
static vaddr whpx_vcpu_get_pc(CPUState *cpu, bool exit_context_valid)
1282
{