[PATCH 03/24] target/arm/hvf: Check hv_vcpu_set_vtimer_mask() returned value

Philippe Mathieu-Daudé posted 24 patches 3 days, 4 hours ago
[PATCH 03/24] target/arm/hvf: Check hv_vcpu_set_vtimer_mask() returned value
Posted by Philippe Mathieu-Daudé 3 days, 4 hours ago
hv_vcpu_set_vtimer_mask() returns a hv_return_t enum type
(defined in <Hypervisor/hv_error.h>). Assert we succeeded,
as we are not ready to handle any error path.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/arm/hvf/hvf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 65ac0bd71aa..1b59cc0eb04 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -1906,7 +1906,8 @@ static void hvf_sync_vtimer(CPUState *cpu)
 
     if (!irq_state) {
         /* Timer no longer asserting, we can unmask it */
-        hv_vcpu_set_vtimer_mask(cpu->accel->fd, false);
+        r = hv_vcpu_set_vtimer_mask(cpu->accel->fd, false);
+        assert_hvf_ok(r);
         cpu->accel->vtimer_masked = false;
     }
 }
-- 
2.51.0


Re: [PATCH 03/24] target/arm/hvf: Check hv_vcpu_set_vtimer_mask() returned value
Posted by Richard Henderson 3 days, 2 hours ago
On 9/3/25 12:06, Philippe Mathieu-Daudé wrote:
> hv_vcpu_set_vtimer_mask() returns a hv_return_t enum type
> (defined in <Hypervisor/hv_error.h>). Assert we succeeded,
> as we are not ready to handle any error path.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/arm/hvf/hvf.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
> index 65ac0bd71aa..1b59cc0eb04 100644
> --- a/target/arm/hvf/hvf.c
> +++ b/target/arm/hvf/hvf.c
> @@ -1906,7 +1906,8 @@ static void hvf_sync_vtimer(CPUState *cpu)
>   
>       if (!irq_state) {
>           /* Timer no longer asserting, we can unmask it */
> -        hv_vcpu_set_vtimer_mask(cpu->accel->fd, false);
> +        r = hv_vcpu_set_vtimer_mask(cpu->accel->fd, false);
> +        assert_hvf_ok(r);
>           cpu->accel->vtimer_masked = false;
>       }
>   }

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~