mbox series

[V2,00/19] PCI/MSI, x86: Cure a couple of inconsistencies

Message ID 20210729215139.889204656@linutronix.de
Headers show
Series PCI/MSI, x86: Cure a couple of inconsistencies | expand

Message

Thomas Gleixner July 29, 2021, 9:51 p.m. UTC
A recent discussion about the PCI/MSI management for virtio unearthed a
violation of the MSI-X specification vs. writing the MSI-X message: under
certain circumstances the entry is written without being masked.

While looking at that and the related violation of the x86 non-remapped
interrupt affinity mechanism a few other issues were discovered by
inspection.

The following series addresses these.

Note this does not fix the virtio issue, but while staring at the above
problems I came up with a plan to address this. I'm still trying to
convince myself that I can get away without sprinkling locking all over the
place, so don't hold your breath that this will materialize tomorrow.

The series is also available from git:

    git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/msi

V1 can be found here:

   https://lore.kernel.org/r/20210721191126.274946280@linutronix.de

Changes vs. V1:

  - Identified and addressed more inconsistencies, especially the lack of
    serialization for multi-MSI masking
    
  - Removed the extra vector masking in S390 

  - Addressed review comments and picked up tags where applicable

  - Clean up of the naming of msi_desc::masked as discussed in the V1
    thread

  - Consolidation of the mask/unmask functions

Thanks,

	tglx
---
 arch/s390/pci/pci_irq.c        |    4 
 arch/x86/kernel/apic/io_apic.c |    6 
 arch/x86/kernel/apic/msi.c     |   11 +
 arch/x86/kernel/hpet.c         |    2 
 drivers/base/core.c            |    1 
 drivers/pci/msi.c              |  274 ++++++++++++++++++++++-------------------
 include/linux/device.h         |    1 
 include/linux/irq.h            |    2 
 include/linux/msi.h            |   10 -
 kernel/irq/chip.c              |    5 
 10 files changed, 178 insertions(+), 138 deletions(-)

Comments

Marc Zyngier Aug. 10, 2021, 7:49 a.m. UTC | #1
On 2021-07-29 22:51, Thomas Gleixner wrote:
> A recent discussion about the PCI/MSI management for virtio unearthed a
> violation of the MSI-X specification vs. writing the MSI-X message: 
> under
> certain circumstances the entry is written without being masked.
> 
> While looking at that and the related violation of the x86 non-remapped
> interrupt affinity mechanism a few other issues were discovered by
> inspection.
> 
> The following series addresses these.
> 
> Note this does not fix the virtio issue, but while staring at the above
> problems I came up with a plan to address this. I'm still trying to
> convince myself that I can get away without sprinkling locking all over 
> the
> place, so don't hold your breath that this will materialize tomorrow.

For the patches I haven't acked yet, and with the fix on patch 18:

Reviewed-by: Marc Zyngier <maz@kernel.org>
Tested-by: Marc Zyngier <maz@kernel.org>

Thanks,

         M.