diff mbox series

[RFC,RESEND,07/42] accel/split: Implement supports_guest_debug()

Message ID 20250620172751.94231-8-philmd@linaro.org
State New
Headers show
Series accel/split/arm: Run EL2 using TCG and EL1/EL0 in hardware with HVF | expand

Commit Message

Philippe Mathieu-Daudé June 20, 2025, 5:27 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/split/split-all.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Richard Henderson June 22, 2025, 2:28 a.m. UTC | #1
On 6/20/25 10:27, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/split/split-all.c | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/accel/split/split-all.c b/accel/split/split-all.c
> index 8b9f8ff77a4..cb910300931 100644
> --- a/accel/split/split-all.c
> +++ b/accel/split/split-all.c
> @@ -61,7 +61,18 @@ static bool split_cpus_are_resettable(AccelState *as)
>   
>   static bool split_supports_guest_debug(AccelState *as)
>   {
> -    g_assert_not_reached();
> +    SplitAccelState *sas = SPLIT_ACCEL(as);
> +    AccelClass *hwc = ACCEL_GET_CLASS(sas->hw);
> +    AccelClass *swc = ACCEL_GET_CLASS(sas->sw);
> +    bool supported = false;
> +
> +    if (hwc->supports_guest_debug) {
> +        supported |= hwc->supports_guest_debug(sas->hw);
> +    }
> +    if (swc->supports_guest_debug) {
> +        supported |= swc->supports_guest_debug(sas->sw);
> +    }
> +    return supported;
>   }
>   
>   static int split_gdbstub_supported_sstep_flags(AccelState *as)

Require both to support debug?  Otherwise support depends on state.


r~
diff mbox series

Patch

diff --git a/accel/split/split-all.c b/accel/split/split-all.c
index 8b9f8ff77a4..cb910300931 100644
--- a/accel/split/split-all.c
+++ b/accel/split/split-all.c
@@ -61,7 +61,18 @@  static bool split_cpus_are_resettable(AccelState *as)
 
 static bool split_supports_guest_debug(AccelState *as)
 {
-    g_assert_not_reached();
+    SplitAccelState *sas = SPLIT_ACCEL(as);
+    AccelClass *hwc = ACCEL_GET_CLASS(sas->hw);
+    AccelClass *swc = ACCEL_GET_CLASS(sas->sw);
+    bool supported = false;
+
+    if (hwc->supports_guest_debug) {
+        supported |= hwc->supports_guest_debug(sas->hw);
+    }
+    if (swc->supports_guest_debug) {
+        supported |= swc->supports_guest_debug(sas->sw);
+    }
+    return supported;
 }
 
 static int split_gdbstub_supported_sstep_flags(AccelState *as)