This is a note to let you know that I've just added the patch titled

    vfio: Fix PCI INTx disable consistency

to the 3.6-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     vfio-fix-pci-intx-disable-consistency.patch
and it can be found in the queue-3.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 899649b7d4ead76c19e39251ca886eebe3f811a8 Mon Sep 17 00:00:00 2001
From: Alex Williamson <[email protected]>
Date: Wed, 10 Oct 2012 09:10:32 -0600
Subject: vfio: Fix PCI INTx disable consistency

From: Alex Williamson <[email protected]>

commit 899649b7d4ead76c19e39251ca886eebe3f811a8 upstream.

The virq_disabled flag tracks the userspace view of INTx masking
across interrupt mode changes, but we're not consistently applying
this to the interrupt and masking handler notion of the device.
Currently if the user sets DisINTx while in MSI or MSIX mode, then
returns to INTx mode (ex. rebooting a qemu guest), the hardware has
DisINTx+, but the management of INTx thinks it's enabled, making it
impossible to actually clear DisINTx.  Fix this by updating the
handler state when INTx is re-enabled.

Signed-off-by: Alex Williamson <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/vfio/pci/vfio_pci_intrs.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/drivers/vfio/pci/vfio_pci_intrs.c
+++ b/drivers/vfio/pci/vfio_pci_intrs.c
@@ -366,6 +366,17 @@ static int vfio_intx_enable(struct vfio_
                return -ENOMEM;
 
        vdev->num_ctx = 1;
+
+       /*
+        * If the virtual interrupt is masked, restore it.  Devices
+        * supporting DisINTx can be masked at the hardware level
+        * here, non-PCI-2.3 devices will have to wait until the
+        * interrupt is enabled.
+        */
+       vdev->ctx[0].masked = vdev->virq_disabled;
+       if (vdev->pci_2_3)
+               pci_intx(vdev->pdev, !vdev->ctx[0].masked);
+
        vdev->irq_type = VFIO_PCI_INTX_IRQ_INDEX;
 
        return 0;
@@ -419,7 +430,7 @@ static int vfio_intx_set_signal(struct v
         * disable_irq won't.
         */
        spin_lock_irqsave(&vdev->irqlock, flags);
-       if (!vdev->pci_2_3 && (vdev->ctx[0].masked || vdev->virq_disabled))
+       if (!vdev->pci_2_3 && vdev->ctx[0].masked)
                disable_irq_nosync(pdev->irq);
        spin_unlock_irqrestore(&vdev->irqlock, flags);
 


Patches currently in stable-queue which might be from 
[email protected] are

queue-3.6/vfio-move-pci-intx-eventfd-setting-earlier.patch
queue-3.6/vfio-fix-pci-intx-disable-consistency.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to