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

[Xen-changelog] [xen-unstable] x86: make domain_spin_lock_irq_desc() a wrapper of pirq_spin_lock_irq_desc()



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1309549521 -3600
# Node ID c9b383a4d96e89bd0fbd8b30ffba0b1f1602da2b
# Parent  cd8258c1ebf1a0d416cfe93fb9f000814f33c817
x86: make domain_spin_lock_irq_desc() a wrapper of pirq_spin_lock_irq_desc()

...and drop the now unused struct domain * parameter of the latter.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---


diff -r cd8258c1ebf1 -r c9b383a4d96e xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri Jul 01 20:44:50 2011 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri Jul 01 20:45:21 2011 +0100
@@ -258,7 +258,7 @@
          (pirq_dpci->gmsi.dest_vcpu_id == v->vcpu_id) )
     {
         struct irq_desc *desc =
-            pirq_spin_lock_irq_desc(d, dpci_pirq(pirq_dpci), NULL);
+            pirq_spin_lock_irq_desc(dpci_pirq(pirq_dpci), NULL);
 
         if ( !desc )
             return 0;
diff -r cd8258c1ebf1 -r c9b383a4d96e xen/arch/x86/hvm/vmsi.c
--- a/xen/arch/x86/hvm/vmsi.c   Fri Jul 01 20:44:50 2011 +0100
+++ b/xen/arch/x86/hvm/vmsi.c   Fri Jul 01 20:45:21 2011 +0100
@@ -375,7 +375,7 @@
     if ( !new_entry )
         return -ENOMEM;
 
-    irq_desc = pirq_spin_lock_irq_desc(d, pirq, NULL);
+    irq_desc = pirq_spin_lock_irq_desc(pirq, NULL);
     if ( !irq_desc )
     {
         xfree(new_entry);
@@ -422,7 +422,7 @@
     ASSERT(spin_is_locked(&pcidevs_lock));
     ASSERT(spin_is_locked(&d->event_lock));
 
-    irq_desc = pirq_spin_lock_irq_desc(d, pirq, NULL);
+    irq_desc = pirq_spin_lock_irq_desc(pirq, NULL);
     if ( !irq_desc )
         return;
 
diff -r cd8258c1ebf1 -r c9b383a4d96e xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Fri Jul 01 20:44:50 2011 +0100
+++ b/xen/arch/x86/irq.c        Fri Jul 01 20:45:21 2011 +0100
@@ -946,32 +946,16 @@
 struct irq_desc *domain_spin_lock_irq_desc(
     struct domain *d, int pirq, unsigned long *pflags)
 {
-    int irq;
-    unsigned long flags;
-    struct irq_desc *desc;
+    const struct pirq *info = pirq_info(d, pirq);
 
-    for ( ; ; )
-    {
-        irq = domain_pirq_to_irq(d, pirq);
-        if ( irq <= 0 )
-            return NULL;
-        desc = irq_to_desc(irq);
-        spin_lock_irqsave(&desc->lock, flags);
-        if ( irq == domain_pirq_to_irq(d, pirq) )
-            break;
-        spin_unlock_irqrestore(&desc->lock, flags);
-    }
-
-    if ( pflags != NULL )
-        *pflags = flags;
-    return desc;
+    return info ? pirq_spin_lock_irq_desc(info, pflags) : NULL;
 }
 
 /*
  * Same with struct pirq already looked up.
  */
 struct irq_desc *pirq_spin_lock_irq_desc(
-    struct domain *d, const struct pirq *pirq, unsigned long *pflags)
+    const struct pirq *pirq, unsigned long *pflags)
 {
     struct irq_desc *desc;
     unsigned long flags;
@@ -1179,7 +1163,7 @@
     struct irq_desc *desc;
 
     ASSERT(local_irq_is_enabled());
-    desc = pirq_spin_lock_irq_desc(d, pirq, NULL);
+    desc = pirq_spin_lock_irq_desc(pirq, NULL);
     if ( desc )
         desc_guest_eoi(d, desc, pirq);
 }
@@ -1338,7 +1322,7 @@
     BUG_ON(!local_irq_is_enabled());
 
  retry:
-    desc = pirq_spin_lock_irq_desc(v->domain, pirq, NULL);
+    desc = pirq_spin_lock_irq_desc(pirq, NULL);
     if ( desc == NULL )
     {
         rc = -EINVAL;
@@ -1541,7 +1525,7 @@
     WARN_ON(!spin_is_locked(&d->event_lock));
 
     BUG_ON(!local_irq_is_enabled());
-    desc = pirq_spin_lock_irq_desc(d, pirq, NULL);
+    desc = pirq_spin_lock_irq_desc(pirq, NULL);
 
     if ( desc == NULL )
     {
@@ -1576,7 +1560,7 @@
     WARN_ON(!spin_is_locked(&d->event_lock));
 
     BUG_ON(!local_irq_is_enabled());
-    desc = pirq_spin_lock_irq_desc(d, pirq, NULL);
+    desc = pirq_spin_lock_irq_desc(pirq, NULL);
     BUG_ON(desc == NULL);
 
     if ( !(desc->status & IRQ_GUEST) )
diff -r cd8258c1ebf1 -r c9b383a4d96e xen/drivers/passthrough/io.c
--- a/xen/drivers/passthrough/io.c      Fri Jul 01 20:44:50 2011 +0100
+++ b/xen/drivers/passthrough/io.c      Fri Jul 01 20:45:21 2011 +0100
@@ -432,7 +432,7 @@
         struct pirq *pirq = dpci_pirq(pirq_dpci);
 
          BUG_ON(!local_irq_is_enabled());
-         desc = pirq_spin_lock_irq_desc(d, pirq, NULL);
+         desc = pirq_spin_lock_irq_desc(pirq, NULL);
          if ( !desc )
             return;
 
diff -r cd8258c1ebf1 -r c9b383a4d96e xen/include/xen/irq.h
--- a/xen/include/xen/irq.h     Fri Jul 01 20:44:50 2011 +0100
+++ b/xen/include/xen/irq.h     Fri Jul 01 20:45:21 2011 +0100
@@ -171,7 +171,7 @@
 extern irq_desc_t *domain_spin_lock_irq_desc(
     struct domain *d, int irq, unsigned long *pflags);
 extern irq_desc_t *pirq_spin_lock_irq_desc(
-    struct domain *, const struct pirq *, unsigned long *pflags);
+    const struct pirq *, unsigned long *pflags);
 
 static inline void set_native_irq_info(unsigned int irq, const cpumask_t *mask)
 {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.