qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 12/20] intc/arm_gic: Implement virtualization


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3 12/20] intc/arm_gic: Implement virtualization extensions in gic_complete_irq
Date: Thu, 12 Jul 2018 13:34:27 +0100

On 29 June 2018 at 14:29, Luc Michel <address@hidden> wrote:
> Implement virtualization extensions in the gic_complete_irq() function.
> When a guest tries to end an IRQ that does not exist in the LRs, the
> EOICount field of the virtual interface HCR register is incremented by
> one, and the request is ignored.
>
> Signed-off-by: Luc Michel <address@hidden>
> ---
>  hw/intc/arm_gic.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
> index a7577ac073..434dc9c7b2 100644
> --- a/hw/intc/arm_gic.c
> +++ b/hw/intc/arm_gic.c
> @@ -605,6 +605,15 @@ static void gic_complete_irq(GICState *s, int cpu, int 
> irq, MemTxAttrs attrs)
>      int group;
>
>      DPRINTF("EOI %d\n", irq);
> +    if (gic_is_vcpu(cpu) && !gic_virq_is_valid(s, irq, cpu)) {
> +        /* This vIRQ does not have a valid LR entry. Increment EOICount and
> +         * ignore the write.
> +         */
> +        int rcpu = gic_get_vcpu_real_id(cpu);
> +        s->h_hcr[rcpu] += 1 << R_GICH_HCR_EOICount_SHIFT;
> +        return;
> +    }
> +

This check and handling of EOICount must also be done in
gic_deactivate_irq() -- see my comments on patch 7.

thanks
-- PMM



reply via email to

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