qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] spapr/xive: H_INT_ESB is used for LSIs only


From: Cédric Le Goater
Subject: Re: [Qemu-devel] [PATCH] spapr/xive: H_INT_ESB is used for LSIs only
Date: Fri, 21 Jun 2019 17:05:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 21/06/2019 16:52, Greg Kurz wrote:
> As indicated in the function header, this "hcall is only supported for
> LISNs that have the ESB hcall flag set to 1 when returned from hcall()
> H_INT_GET_SOURCE_INFO". We only set that flag for LSIs actually.
> 
> Check that in h_int_esb().

Indeed. H_INT_ESB should work on any IRQ, but I think it's better 
to check that the HCALL is only used with the IRQ requiring it.   

> Signed-off-by: Greg Kurz <address@hidden>

Reviewed-by: Cédric Le Goater <address@hidden>

Thanks,

C.

> ---
>  hw/intc/spapr_xive.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
> index 58c2e5d890bd..01dd47ad5b02 100644
> --- a/hw/intc/spapr_xive.c
> +++ b/hw/intc/spapr_xive.c
> @@ -1408,6 +1408,12 @@ static target_ulong h_int_esb(PowerPCCPU *cpu,
>          return H_P2;
>      }
>  
> +    if (!xive_source_irq_is_lsi(xsrc, lisn)) {
> +        qemu_log_mask(LOG_GUEST_ERROR, "XIVE: LISN " TARGET_FMT_lx "isn't 
> LSI\n",
> +                      lisn);
> +        return H_P2;
> +    }
> +
>      if (offset > (1ull << xsrc->esb_shift)) {
>          return H_P3;
>      }
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]