Skip to contentSkip to conversation

iommu/vt-d: Fixes for v6.12-rc

GIT PULL New Lu Baolu 2 participants 3 messages Oct 14, 2024 – Oct 15, 2024

Subsystems (2)
lore
Share & tools
lore

Lu Baolu

author maintainer
#0 lore raw

Hi Joerg,

The following fix has been queued for v6.12-rc:

- Fix incorrect pci_for_each_dma_alias() for non-PCI devices

It fixes boot failure issues on some client platforms. Please consider it for v6.12-rc.

Best regards,
baolu

Lu Baolu (1):
iommu/vt-d: Fix incorrect pci_for_each_dma_alias() for non-PCI devices

 drivers/iommu/intel/iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/1 iommu/vt-d: Fix incorrect pci_for_each_dma_alias() for non-PCI devices

Previously, the domain_context_clear() function incorrectly called pci_for_each_dma_alias() to set up context entries for non-PCI devices. This could lead to kernel hangs or other unexpected behavior.

Add a check to only call pci_for_each_dma_alias() for PCI devices. For non-PCI devices, domain_context_clear_one() is called directly.

Fixes 9a16ab9d6402 ("iommu/vt-d: Make context clearing consistent with context mapping")
---
 drivers/iommu/intel/iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iommu/intel/iommu.c +3 -1
index 9f6b0780f2ef..e860bc9439a2 100644
@@ -3340,8 +3340,10 @@ static int domain_context_clear_one_cb(struct pci_dev *pdev, u16 alias, void *op
  */
 static void domain_context_clear(struct device_domain_info *info)
 {
-	if (!dev_is_pci(info->dev))
+	if (!dev_is_pci(info->dev)) {
 		domain_context_clear_one(info, info->bus, info->devfn);
+		return;
+	}
 
 	pci_for_each_dma_alias(to_pci_dev(info->dev),
 			       &domain_context_clear_one_cb, info);
Signature · 1 line
2.43.0
maintainer Applied
#2 lore raw
In reply to Lu Baolu
Quoted 5 lines · Lu Baolu

Lu Baolu (1):
iommu/vt-d: Fix incorrect pci_for_each_dma_alias() for non-PCI devices

 drivers/iommu/intel/iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks Baolu.