All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: julien.grall@citrix.com, jtd@galois.com, Ian.Campbell@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v4 04/10] xen/arm: set GICH_HCR_UIE if all the LRs are in use
Date: Wed, 19 Mar 2014 12:31:59 +0000	[thread overview]
Message-ID: <1395232325-19226-4-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1403191226020.8273@kaball.uk.xensource.com>

On return to guest, if there are no free LRs and we still have more
interrupt to inject, set GICH_HCR_UIE so that we are going to receive a
maintenance interrupt when no pending interrupts are present in the LR
registers.
The maintenance interrupt handler won't do anything anymore, but
receiving the interrupt is going to cause gic_inject to be called on
return to guest that is going to clear the old LRs and inject new
interrupts.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---

Changes in v2:
- disable/enable the GICH_HCR_UIE bit in GICH_HCR;
- only enable GICH_HCR_UIE if this_cpu(lr_mask) == ((1 << nr_lrs) - 1).
---
 xen/arch/arm/gic.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 32d3bea..d445e8b 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -790,6 +790,12 @@ void gic_inject(void)
         vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq);
 
     gic_restore_pending_irqs(current);
+
+    if ( !list_empty(&current->arch.vgic.lr_pending) &&
+         this_cpu(lr_mask) == ((1 << nr_lrs) - 1) )
+        GICH[GICH_HCR] |= GICH_HCR_UIE;
+    else
+        GICH[GICH_HCR] &= ~GICH_HCR_UIE;
 }
 
 int gic_route_irq_to_guest(struct domain *d, const struct dt_irq *irq,
-- 
1.7.10.4

  parent reply	other threads:[~2014-03-19 12:31 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 12:31 [PATCH v4 0/10] remove maintenance interrupts Stefano Stabellini
2014-03-19 12:31 ` [PATCH v4 01/10] xen/arm: no need to set HCR_VI when using the vgic to inject irqs Stefano Stabellini
2014-03-19 13:33   ` Julien Grall
2014-03-21 14:06   ` Ian Campbell
2014-03-19 12:31 ` [PATCH v4 02/10] xen/arm: remove unused virtual parameter from vgic_vcpu_inject_irq Stefano Stabellini
2014-03-19 12:31 ` [PATCH v4 03/10] xen/arm: support HW interrupts, do not request maintenance_interrupts Stefano Stabellini
2014-03-19 13:42   ` Julien Grall
2014-03-19 14:43     ` Stefano Stabellini
2014-03-19 15:11       ` Julien Grall
2014-03-19 15:53         ` Stefano Stabellini
2014-03-19 16:10           ` Julien Grall
2014-03-21 13:04   ` Ian Campbell
2014-03-21 15:55     ` Stefano Stabellini
2014-03-21 16:16       ` Ian Campbell
2014-03-24 12:11         ` Stefano Stabellini
2014-03-24 12:15           ` Ian Campbell
2014-03-19 12:31 ` Stefano Stabellini [this message]
2014-03-19 13:49   ` [PATCH v4 04/10] xen/arm: set GICH_HCR_UIE if all the LRs are in use Julien Grall
2014-03-21 13:06   ` Ian Campbell
2014-03-21 16:03     ` Stefano Stabellini
2014-03-21 13:07   ` Ian Campbell
2014-03-21 16:05     ` Stefano Stabellini
2014-03-19 12:32 ` [PATCH v4 05/10] xen/arm: keep track of the GICH_LR used for the irq in struct pending_irq Stefano Stabellini
2014-03-19 13:52   ` Julien Grall
2014-03-19 14:45     ` Stefano Stabellini
2014-03-21 13:11   ` Ian Campbell
2014-03-21 16:19     ` Stefano Stabellini
2014-03-21 16:25       ` Ian Campbell
2014-03-24 12:12         ` Stefano Stabellini
2014-03-19 12:32 ` [PATCH v4 06/10] xen/arm: s/gic_set_guest_irq/gic_raise_guest_irq Stefano Stabellini
2014-03-19 13:53   ` Julien Grall
2014-03-21 13:12   ` Ian Campbell
2014-03-21 16:20     ` Stefano Stabellini
2014-03-21 16:26       ` Ian Campbell
2014-03-19 12:32 ` [PATCH v4 07/10] xen/arm: call gic_clear_lrs on entry to the hypervisor Stefano Stabellini
2014-03-19 13:56   ` Julien Grall
2014-03-21 13:14   ` Ian Campbell
2014-03-21 16:34     ` Stefano Stabellini
2014-03-21 16:39       ` Ian Campbell
2014-03-24 12:24         ` Stefano Stabellini
2014-03-19 12:32 ` [PATCH v4 08/10] xen/arm: second irq injection while the first irq is still inflight Stefano Stabellini
2014-03-21 13:22   ` Ian Campbell
2014-03-21 16:46     ` Stefano Stabellini
2014-03-21 17:04       ` Ian Campbell
2014-03-24 12:54         ` Stefano Stabellini
2014-03-24 12:57           ` Ian Campbell
2014-03-24 16:41             ` Stefano Stabellini
2014-03-25 10:09               ` Ian Campbell
2014-03-19 12:32 ` [PATCH v4 09/10] xen/arm: don't protect GICH and lr_queue accesses with gic.lock Stefano Stabellini
2014-03-21 13:31   ` Ian Campbell
2014-03-21 17:07     ` Stefano Stabellini
2014-03-19 12:32 ` [PATCH v4 10/10] xen/arm: gic_events_need_delivery and irq priorities Stefano Stabellini
2014-03-19 14:00   ` Julien Grall
2014-03-20 11:03     ` Ian Campbell
2014-03-20 15:10       ` Julien Grall
2014-03-20 15:14         ` Ian Campbell
2014-03-21 13:42   ` Ian Campbell
2014-03-24 12:00     ` Stefano Stabellini
2014-03-24 12:05       ` Ian Campbell
2014-03-24 13:06         ` Stefano Stabellini
2014-03-24 16:06           ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395232325-19226-4-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=jtd@galois.com \
    --cc=julien.grall@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.