From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Tim.Deegan@citrix.com, david.vrabel@citrix.com,
Ian.Campbell@citrix.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH 5/5] xen/vgic: initialize pending_irqs.lr_queue
Date: Wed, 6 Jun 2012 12:22:10 +0100 [thread overview]
Message-ID: <1338981730-14816-5-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <1338981730-14816-1-git-send-email-stefano.stabellini@eu.citrix.com>
Properly initialize all the pending_irqs.lr_queue like we do for
inflight.
Check whether we already have the irq in lr_queue before adding it.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
xen/arch/arm/gic.c | 6 ++++++
xen/arch/arm/vgic.c | 6 ++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 2e41d75..998033a 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -456,6 +456,12 @@ void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
}
n = irq_to_pending(v, virtual_irq);
+ if ( !list_empty(&n->lr_queue) )
+ {
+ printk(KERN_WARNING "%s: irq %d already in lr_queue\n", __func__,
+ virtual_irq);
+ goto out;
+ }
list_for_each_entry ( iter, &v->arch.vgic.lr_pending, lr_queue )
{
if ( iter->priority > priority )
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 4cdfec5..653e8e5 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -84,7 +84,10 @@ int domain_vgic_init(struct domain *d)
d->arch.vgic.pending_irqs =
xzalloc_array(struct pending_irq, d->arch.vgic.nr_lines);
for (i=0; i<d->arch.vgic.nr_lines; i++)
+ {
INIT_LIST_HEAD(&d->arch.vgic.pending_irqs[i].inflight);
+ INIT_LIST_HEAD(&d->arch.vgic.pending_irqs[i].lr_queue);
+ }
for (i=0; i<DOMAIN_NR_RANKS(d); i++)
spin_lock_init(&d->arch.vgic.shared_irqs[i].lock);
return 0;
@@ -99,7 +102,10 @@ int vcpu_vgic_init(struct vcpu *v)
memset(&v->arch.vgic.pending_irqs, 0, sizeof(v->arch.vgic.pending_irqs));
for (i = 0; i < 32; i++)
+ {
INIT_LIST_HEAD(&v->arch.vgic.pending_irqs[i].inflight);
+ INIT_LIST_HEAD(&v->arch.vgic.pending_irqs[i].lr_queue);
+ }
printk("vcpu_vgic_init irq[0] at %p desc is %p\n",
&v->arch.vgic.pending_irqs[0],
v->arch.vgic.pending_irqs[0].desc);
--
1.7.2.5
next prev parent reply other threads:[~2012-06-06 11:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-06 11:20 [PATCH 0/5] xen/arm: multiple guests support in the GIC and VGIC Stefano Stabellini
2012-06-06 11:22 ` [PATCH 1/5] arm/vtimer: do not let the guest interact with the physical timer Stefano Stabellini
2012-06-06 11:22 ` [PATCH 2/5] arm/gic: fix gic context switch Stefano Stabellini
2012-06-26 13:55 ` Ian Campbell
2012-06-06 11:22 ` [PATCH 3/5] xen/gic: support injecting IRQs even to VCPUs not currently running Stefano Stabellini
2012-06-07 12:46 ` Tim Deegan
2012-06-07 15:43 ` Stefano Stabellini
2012-06-26 14:07 ` Ian Campbell
2012-06-26 17:28 ` Stefano Stabellini
2012-06-06 11:22 ` [PATCH 4/5] xen/vgic: vgic: support irq enable/disable Stefano Stabellini
2012-06-26 14:05 ` Ian Campbell
2012-06-06 11:22 ` Stefano Stabellini [this message]
2012-06-26 14:08 ` [PATCH 5/5] xen/vgic: initialize pending_irqs.lr_queue Ian Campbell
2012-06-26 17:53 ` Stefano Stabellini
2012-06-27 8:52 ` Ian Campbell
2012-06-27 11:06 ` Stefano Stabellini
2012-06-26 13:55 ` [PATCH 1/5] arm/vtimer: do not let the guest interact with the physical timer Ian Campbell
2012-06-26 17:25 ` Stefano Stabellini
2012-06-07 12:47 ` [PATCH 0/5] xen/arm: multiple guests support in the GIC and VGIC Tim Deegan
2012-06-07 15:47 ` 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=1338981730-14816-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).