xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Tim.Deegan@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian.Campbell@citrix.com, david.vrabel@citrix.com
Subject: [PATCH v4 5/6] arm: remove VGIC_SOFTIRQ
Date: Fri, 25 May 2012 17:23:13 +0100	[thread overview]
Message-ID: <1337962994-23573-5-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1205251712480.26786@kaball-desktop>

Instead of using a softirq to check whether we need to set the VI bit in
the HCR (IRQ injection in the guest), always check the lr_mask on
leave_hypervisor_tail.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c            |   13 ++++++++++---
 xen/arch/arm/gic.h            |    4 ++--
 xen/arch/arm/traps.c          |    4 +++-
 xen/arch/arm/vgic.c           |   15 ---------------
 xen/include/asm-arm/softirq.h |    3 +--
 5 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index c05e598..cdb4e4a 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -433,7 +433,7 @@ out:
     return;
 }
 
-void gic_inject_irq_start(void)
+static void gic_inject_irq_start(void)
 {
     uint32_t hcr;
     hcr = READ_CP32(HCR);
@@ -441,7 +441,7 @@ void gic_inject_irq_start(void)
     isb();
 }
 
-void gic_inject_irq_stop(void)
+static void gic_inject_irq_stop(void)
 {
     uint32_t hcr;
     hcr = READ_CP32(HCR);
@@ -451,6 +451,14 @@ void gic_inject_irq_stop(void)
     }
 }
 
+void gic_inject(void)
+{
+    if (!gic.lr_mask)
+        gic_inject_irq_stop();
+    else
+        gic_inject_irq_start();
+}
+
 int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
                            const char * devname)
 {
@@ -540,7 +548,6 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
             GICC[GICC_DIR] = virq;
         }
         list_del_init(&p->inflight);
-        cpu_raise_softirq(current->processor, VGIC_SOFTIRQ);
         spin_unlock(&current->arch.vgic.lock);
 
         i++;
diff --git a/xen/arch/arm/gic.h b/xen/arch/arm/gic.h
index 6b2be4f..2c5922e 100644
--- a/xen/arch/arm/gic.h
+++ b/xen/arch/arm/gic.h
@@ -128,11 +128,11 @@ extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
 extern void gic_route_irqs(void);
 
+extern void gic_inject(void);
+
 extern void __cpuinit init_maintenance_interrupt(void);
 extern void gic_set_guest_irq(unsigned int irq,
         unsigned int state, unsigned int priority);
-extern void gic_inject_irq_start(void);
-extern void gic_inject_irq_stop(void);
 extern int gic_route_irq_to_guest(struct domain *d, unsigned int irq,
                                   const char * devname);
 
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 6304bbd..abc26a3 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -608,8 +608,10 @@ asmlinkage void leave_hypervisor_tail(void)
     while (1)
     {
         local_irq_disable();
-        if (!softirq_pending(smp_processor_id()))
+        if (!softirq_pending(smp_processor_id())) {
+            gic_inject();
             return;
+        }
         local_irq_enable();
         do_softirq();
     }
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 4d2a0e0..629a0da 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -577,23 +577,8 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     list_add_tail(&n->inflight, &v->arch.vgic.inflight_irqs);
     spin_unlock(&v->arch.vgic.lock);
     /* we have a new higher priority irq, inject it into the guest */
-    cpu_raise_softirq(v->processor, VGIC_SOFTIRQ);
 }
 
-static void vgic_softirq(void)
-{
-    if (list_empty(&current->arch.vgic.inflight_irqs))
-        return;
-
-    gic_inject_irq_start();
-}
-
-static int __init init_vgic_softirq(void)
-{
-    open_softirq(VGIC_SOFTIRQ, vgic_softirq);
-    return 0;
-}
-__initcall(init_vgic_softirq);
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/asm-arm/softirq.h b/xen/include/asm-arm/softirq.h
index 536af38..27818ae 100644
--- a/xen/include/asm-arm/softirq.h
+++ b/xen/include/asm-arm/softirq.h
@@ -1,8 +1,7 @@
 #ifndef __ASM_SOFTIRQ_H__
 #define __ASM_SOFTIRQ_H__
 
-#define VGIC_SOFTIRQ        (NR_COMMON_SOFTIRQS + 0)
-#define NR_ARCH_SOFTIRQS       1
+#define NR_ARCH_SOFTIRQS       0
 
 #endif /* __ASM_SOFTIRQ_H__ */
 /*
-- 
1.7.2.5

  parent reply	other threads:[~2012-05-25 16:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 16:21 [PATCH v4 0/6] xen/arm: event channels and shared_info page Stefano Stabellini
2012-05-25 16:23 ` [PATCH v4 1/6] arm: support fewer LR registers than virtual irqs Stefano Stabellini
2012-05-25 16:23 ` [PATCH v4 2/6] arm: replace list_del and INIT_LIST_HEAD with list_del_init Stefano Stabellini
2012-05-25 16:23 ` [PATCH v4 3/6] arm: shared_info page allocation and mapping Stefano Stabellini
2012-05-25 16:23 ` [PATCH v4 4/6] arm: implement flush_tlb_all_local and flush_tlb_local Stefano Stabellini
2012-05-25 16:23 ` Stefano Stabellini [this message]
2012-05-25 16:23 ` [PATCH v4 6/6] arm: implement event injection Stefano Stabellini
2012-06-01  8:45   ` Ian Campbell
2012-06-01  9:31 ` [PATCH v4 0/6] xen/arm: event channels and shared_info page Ian Campbell

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=1337962994-23573-5-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Tim.Deegan@citrix.com \
    --cc=david.vrabel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).