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

[Xen-changelog] [xen master] Revert "arm/acpi: Configure SPI interrupt type and route to Dom0 dynamically"



commit 909bd140bfbfd3c762ae7ebf2bb41da00842c77d
Author:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
AuthorDate: Wed Jun 1 10:54:45 2016 +0100
Commit:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
CommitDate: Wed Jun 1 11:10:45 2016 +0100

    Revert "arm/acpi: Configure SPI interrupt type and route to Dom0 
dynamically"
    
    This reverts commit 9d77b3c01d1261ce17c10097a1b393f2893ca657.
    
    The commit is causing a dead loop inside the spinlock function.
    spinlocks in Xen are not recursive. Re-acquiring a spinlock that was
    already taken by the calling cpu leads to deadlock. This happens
    whenever dom0 writes to GICD regs ISENABLER/ICENABLER.
    
    DOM0 writes GICD_ISENABLER/GICD_ICENABLER
      vgic_v3_distr_common_mmio_write()
        vgic_lock_rank()  -->  acquiring first time
          vgic_enable_irqs()
            route_irq_to_guest()
              gic_route_irq_to_guest()
                vgic_get_target_vcpu()
                  vgic_lock_rank()  -->  attemping acquired lock
    
    Reported-by: Shanker Donthineni <shankerd@xxxxxxxxxxxxxx>
    Signed-off-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/arch/arm/vgic.c | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index aa420bb..ee35683 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -25,8 +25,6 @@
 #include <xen/irq.h>
 #include <xen/sched.h>
 #include <xen/perfc.h>
-#include <xen/iocap.h>
-#include <xen/acpi.h>
 
 #include <asm/current.h>
 
@@ -336,19 +334,6 @@ void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n)
     }
 }
 
-#define VGIC_ICFG_MASK(intr) (1 << ((2 * ((intr) % 16)) + 1))
-
-static inline unsigned int get_the_irq_type(struct vcpu *v, int n, int index)
-{
-    struct vgic_irq_rank *vr = vgic_get_rank(v, n);
-    uint32_t tr = vr->icfg[index >> 4];
-
-    if ( tr & VGIC_ICFG_MASK(index) )
-        return IRQ_TYPE_EDGE_BOTH;
-    else
-        return IRQ_TYPE_LEVEL_MASK;
-}
-
 void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
 {
     const unsigned long mask = r;
@@ -357,26 +342,9 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
     unsigned long flags;
     int i = 0;
     struct vcpu *v_target;
-    struct domain *d = v->domain;
-    int ret;
 
     while ( (i = find_next_bit(&mask, 32, i)) < 32 ) {
         irq = i + (32 * n);
-        /* Set the irq type and route it to guest only for SPI and Dom0 */
-        if( irq_access_permitted(d, irq) && is_hardware_domain(d) &&
-            ( irq >= 32 ) && ( !acpi_disabled ) )
-        {
-            ret = irq_set_spi_type(irq, get_the_irq_type(v, n, i));
-            if ( ret )
-                gprintk(XENLOG_WARNING, "The irq type is not correct\n");
-
-            vgic_reserve_virq(d, irq);
-
-            ret = route_irq_to_guest(d, irq, irq, NULL);
-            if ( ret )
-                gprintk(XENLOG_ERR, "Unable to route IRQ %u to domain %u\n",
-                        irq, d->domain_id);
-        }
         v_target = __vgic_get_target_vcpu(v, irq);
         p = irq_to_pending(v_target, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.