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

[Xen-changelog] [xen staging] x86/vtd: Fix S3 resume following c/s 650c31d3af



commit 7aae9c1c916d1522001bc7f4ea1846c9d62bda8b
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Aug 12 18:08:00 2019 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Aug 23 13:00:06 2019 +0100

    x86/vtd: Fix S3 resume following c/s 650c31d3af
    
    c/s 650c31d3af "x86/IRQ: fix locking around vector management" adjusted the
    locking in adjust_irq_affinity().
    
    The S3 path ends up here via iommu_resume() before interrupts are enabled, 
at
    which point spin_lock_irq() fails ASSERT(local_irq_is_enabled()); but with 
no
    working console.
    
    Use spin_lock_irqsave() instead to cope with interrupts already being
    disabled.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
---
 xen/drivers/passthrough/vtd/iommu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c 
b/xen/drivers/passthrough/vtd/iommu.c
index 5d72270c5b..defa74fae3 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2135,15 +2135,16 @@ static void adjust_irq_affinity(struct acpi_drhd_unit 
*drhd)
                              : NUMA_NO_NODE;
     const cpumask_t *cpumask = NULL;
     struct irq_desc *desc;
+    unsigned long flags;
 
     if ( node < MAX_NUMNODES && node_online(node) &&
          cpumask_intersects(&node_to_cpumask(node), &cpu_online_map) )
         cpumask = &node_to_cpumask(node);
 
     desc = irq_to_desc(drhd->iommu->msi.irq);
-    spin_lock_irq(&desc->lock);
+    spin_lock_irqsave(&desc->lock, flags);
     dma_msi_set_affinity(desc, cpumask);
-    spin_unlock_irq(&desc->lock);
+    spin_unlock_irqrestore(&desc->lock, flags);
 }
 
 static int adjust_vtd_irq_affinities(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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