Skip to content

Commit 2565e5b

Browse files
Adrian HuangLorenzo Pieralisi
authored andcommitted
PCI: vmd: Do not disable MSI-X remapping if interrupt remapping is enabled by IOMMU
When enabling VMD in BIOS setup (Ice Lake Processor: Whitley platform), the host OS cannot boot successfully with the following error message: nvme nvme0: I/O 12 QID 0 timeout, completion polled nvme nvme0: Shutdown timeout set to 6 seconds DMAR: DRHD: handling fault status reg 2 DMAR: [INTR-REMAP] Request device [0x00:0x00.5] fault index 0xa00 [fault reason 0x25] Blocked a compatibility format interrupt request The request device is the VMD controller: # lspci -s 0000:00.5 -nn 0000:00:00.5 RAID bus controller [0104]: Intel Corporation Volume Management Device NVMe RAID Controller [8086:28c0] (rev 04) `git bisect` points to this offending commit ee81ee8 ("PCI: vmd: Disable MSI-X remapping when possible"), which disables VMD MSI remapping. The IOMMU hardware blocks the compatibility format interrupt request because Interrupt Remapping Enable Status (IRES) and Extended Interrupt Mode Enable (EIME) are enabled. Please refer to section "5.1.4 Interrupt-Remapping Hardware Operation" in Intel VT-d spec. To fix the issue, VMD driver still enables the interrupt remapping irrespective of VMD_FEAT_CAN_BYPASS_MSI_REMAP if the IOMMU subsystem enables the interrupt remapping. Test configuration is shown as follows: * Two VMD controllers 1. 8086:28c0 (Whitley's VMD) 2. 8086:201d (Purley's VMD: The issue does not appear in this controller. Just make sure if any side effect occurs.) * w/wo intremap=off Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214219 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Adrian Huang <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Jon Derrick <[email protected]> Cc: Jon Derrick <[email protected]> Cc: Nirmal Patel <[email protected]> Cc: Joerg Roedel <[email protected]>
1 parent 42da791 commit 2565e5b

File tree

1 file changed

+3
-1
lines changed
  • drivers/pci/controller

1 file changed

+3
-1
lines changed

drivers/pci/controller/vmd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <linux/device.h>
88
#include <linux/interrupt.h>
9+
#include <linux/iommu.h>
910
#include <linux/irq.h>
1011
#include <linux/kernel.h>
1112
#include <linux/module.h>
@@ -765,7 +766,8 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
765766
* acceptable because the guest is usually CPU-limited and MSI
766767
* remapping doesn't become a performance bottleneck.
767768
*/
768-
if (!(features & VMD_FEAT_CAN_BYPASS_MSI_REMAP) ||
769+
if (iommu_capable(vmd->dev->dev.bus, IOMMU_CAP_INTR_REMAP) ||
770+
!(features & VMD_FEAT_CAN_BYPASS_MSI_REMAP) ||
769771
offset[0] || offset[1]) {
770772
ret = vmd_alloc_irqs(vmd);
771773
if (ret)

0 commit comments

Comments
 (0)