Skip to content

Commit 7b79edf

Browse files
jasowangmstsirkin
authored andcommitted
Revert "virtio-pci: harden INTX interrupts"
This reverts commit 080cd7c. Since the MSI-X interrupts hardening will be reverted in the next patch. We will rework the interrupt hardening in the future. Fixes: 080cd7c ("virtio-pci: harden INTX interrupts") Signed-off-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/20220323031524.6555-1-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent c117082 commit 7b79edf

2 files changed

Lines changed: 2 additions & 22 deletions

File tree

drivers/virtio/virtio_pci_common.c

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,8 @@ void vp_disable_cbs(struct virtio_device *vdev)
3030
struct virtio_pci_device *vp_dev = to_vp_device(vdev);
3131
int i;
3232

33-
if (vp_dev->intx_enabled) {
34-
/*
35-
* The below synchronize() guarantees that any
36-
* interrupt for this line arriving after
37-
* synchronize_irq() has completed is guaranteed to see
38-
* intx_soft_enabled == false.
39-
*/
40-
WRITE_ONCE(vp_dev->intx_soft_enabled, false);
33+
if (vp_dev->intx_enabled)
4134
synchronize_irq(vp_dev->pci_dev->irq);
42-
}
4335

4436
for (i = 0; i < vp_dev->msix_vectors; ++i)
4537
disable_irq(pci_irq_vector(vp_dev->pci_dev, i));
@@ -51,16 +43,8 @@ void vp_enable_cbs(struct virtio_device *vdev)
5143
struct virtio_pci_device *vp_dev = to_vp_device(vdev);
5244
int i;
5345

54-
if (vp_dev->intx_enabled) {
55-
disable_irq(vp_dev->pci_dev->irq);
56-
/*
57-
* The above disable_irq() provides TSO ordering and
58-
* as such promotes the below store to store-release.
59-
*/
60-
WRITE_ONCE(vp_dev->intx_soft_enabled, true);
61-
enable_irq(vp_dev->pci_dev->irq);
46+
if (vp_dev->intx_enabled)
6247
return;
63-
}
6448

6549
for (i = 0; i < vp_dev->msix_vectors; ++i)
6650
enable_irq(pci_irq_vector(vp_dev->pci_dev, i));
@@ -113,9 +97,6 @@ static irqreturn_t vp_interrupt(int irq, void *opaque)
11397
struct virtio_pci_device *vp_dev = opaque;
11498
u8 isr;
11599

116-
if (!READ_ONCE(vp_dev->intx_soft_enabled))
117-
return IRQ_NONE;
118-
119100
/* reading the ISR has the effect of also clearing it so it's very
120101
* important to save off the value. */
121102
isr = ioread8(vp_dev->isr);

drivers/virtio/virtio_pci_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ struct virtio_pci_device {
6363
/* MSI-X support */
6464
int msix_enabled;
6565
int intx_enabled;
66-
bool intx_soft_enabled;
6766
cpumask_var_t *msix_affinity_masks;
6867
/* Name strings for interrupts. This size should be enough,
6968
* and I'm too lazy to allocate each name separately. */

0 commit comments

Comments
 (0)