Skip to content

Commit

Permalink
Merge branch 'remotes/lorenzo/pci/vmd'
Browse files Browse the repository at this point in the history
- Assign VMD IRQ domain before enumeration to avoid IOMMU interrupt
  remapping errors when MSI-X remapping is disabled (Nirmal Patel)

- Revert VMD workaround that kept MSI-X remapping enabled when IOMMU
  remapping was enabled (Nirmal Patel)

* remotes/lorenzo/pci/vmd:
  PCI: vmd: Revert 2565e5b ("PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU.")
  PCI: vmd: Assign VMD IRQ domain before enumeration
  • Loading branch information
Bjorn Helgaas committed May 24, 2022
2 parents efa3158 + c94f732 commit 32f479d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/pci/controller/vmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/iommu.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/module.h>
Expand Down Expand Up @@ -813,8 +812,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
* acceptable because the guest is usually CPU-limited and MSI
* remapping doesn't become a performance bottleneck.
*/
if (iommu_capable(vmd->dev->dev.bus, IOMMU_CAP_INTR_REMAP) ||
!(features & VMD_FEAT_CAN_BYPASS_MSI_REMAP) ||
if (!(features & VMD_FEAT_CAN_BYPASS_MSI_REMAP) ||
offset[0] || offset[1]) {
ret = vmd_alloc_irqs(vmd);
if (ret)
Expand Down Expand Up @@ -853,6 +851,9 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
vmd_attach_resources(vmd);
if (vmd->irq_domain)
dev_set_msi_domain(&vmd->bus->dev, vmd->irq_domain);
else
dev_set_msi_domain(&vmd->bus->dev,
dev_get_msi_domain(&vmd->dev->dev));

vmd_acpi_begin();

Expand Down

0 comments on commit 32f479d

Please sign in to comment.