Skip to content

PCI/MSI, x86: Cure a couple of inconsistencies

Thomas Gleixner linux-pci linux-s390 lkml stable 2 versions – Applied

Status from this message: The following commit has been merged into the irq/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest19 patches 3 repliesApplied
  2. v18 patches 21 repliesSuperseded

Changes in v2 from the cover letter

- 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

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/19PCI/MSI: Enable and mask MSI-X earlydrivers/pci/msi.c+15 -130 replies
2/19PCI/MSI: Mask all unused MSI-X entriesdrivers/pci/msi.c+27 -180 replies
3/19PCI/MSI: Enforce that MSI-X table entry is masked for updatedrivers/pci/msi.c+15 -00 replies
4/19PCI/MSI: Enforce MSI[X] entry updates to be visibledrivers/pci/msi.c+5 -00 replies
5/19PCI/MSI: Do not set invalid bits in MSI maskdrivers/pci/msi.c+4 -40 replies
6/19PCI/MSI: Correct misleading commentsdrivers/pci/msi.c+1 -40 replies
7/19PCI/MSI: Use msi_mask_irq() in pci_msi_shutdown()drivers/pci/msi.c+1 -10 replies
8/19PCI/MSI: Protect msi_desc::masked for multi-MSIdrivers/base/core.c drivers/pci/msi.c include/linux/device.h +1 more+13 -100 replies
9/19genirq: Provide IRQCHIP_AFFINITY_PRE_STARTUPinclude/linux/irq.h kernel/irq/chip.c+6 -10 replies
10/19x86/ioapic: Force affinity setup before startuparch/x86/kernel/apic/io_apic.c+4 -20 replies
11/19x86/msi: Force affinity setup before startuparch/x86/kernel/apic/msi.c arch/x86/kernel/hpet.c+9 -40 replies
12/19s390/pci: Do not mask MSI[-X] entries on teardownarch/s390/pci/pci_irq.c drivers/pci/msi.c include/linux/msi.h+2 -81 reply
13/19PCI/MSI: Simplify msi_verify_entries()drivers/pci/msi.c+4 -10 replies
14/19PCI/MSI: Rename msi_desc::maskeddrivers/pci/msi.c include/linux/msi.h+21 -170 replies
15/19PCI/MSI: Consolidate error handling in msi_capability_init()drivers/pci/msi.c+11 -150 replies
16/19PCI/MSI: Deobfuscate virtual MSI-Xdrivers/pci/msi.c+8 -170 replies
17/19PCI/MSI: Cleanup msi_mask()drivers/pci/msi.c+11 -140 replies
18/19PCI/MSI: Provide a new set of mask and unmask functionsdrivers/pci/msi.c+72 -02 replies
19/19PCI/MSI: Use new mask/unmask functionsdrivers/pci/msi.c+21 -810 replies

Reviews trailers per patch

9 of 19 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAshok RajMarc ZyngierBjorn HelgaasNiklas Schnelle
SeriesR-b T-b
1/19R-b R-b A-b
2/19R-b A-b
3/19R-b A-b
4/19R-b A-b
5/19
6/19
7/19
8/19
9/19R-b
10/19R-b
11/19R-b
12/19A-b T-b
13/19R-b A-b
14/19
15/19
16/19
17/19
18/19
19/19

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

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

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/[email protected]

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(-)