Skip to content

Commit 3d7dc86

Browse files
committed
Merge tag 'iommu-fixes-v6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux
Pull iommu fixes from Joerg Roedel: - Intel VT-d fixes: - Fix suspicious RCU usage splat - Fix passthrough for devices under PCIe-PCI bridge - AMD-Vi fix: - Fix to preserve bits when updating device table entries * tag 'iommu-fixes-v6.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux: iommu/vt-d: Fix suspicious RCU usage iommu/vt-d: Remove device comparison in context_setup_pass_through_cb iommu/amd: Preserve default DTE fields when updating Host Page Table Root
2 parents 276f98e + b150654 commit 3d7dc86

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

drivers/iommu/amd/iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,12 +2043,12 @@ static void set_dte_entry(struct amd_iommu *iommu,
20432043
make_clear_dte(dev_data, dte, &new);
20442044

20452045
if (domain->iop.mode != PAGE_MODE_NONE)
2046-
new.data[0] = iommu_virt_to_phys(domain->iop.root);
2046+
new.data[0] |= iommu_virt_to_phys(domain->iop.root);
20472047

20482048
new.data[0] |= (domain->iop.mode & DEV_ENTRY_MODE_MASK)
20492049
<< DEV_ENTRY_MODE_SHIFT;
20502050

2051-
new.data[0] |= DTE_FLAG_IR | DTE_FLAG_IW | DTE_FLAG_V;
2051+
new.data[0] |= DTE_FLAG_IR | DTE_FLAG_IW;
20522052

20532053
/*
20542054
* When SNP is enabled, we can only support TV=1 with non-zero domain ID.

drivers/iommu/intel/dmar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,7 @@ int enable_drhd_fault_handling(unsigned int cpu)
20432043
/*
20442044
* Enable fault control interrupt.
20452045
*/
2046+
guard(rwsem_read)(&dmar_global_lock);
20462047
for_each_iommu(iommu, drhd) {
20472048
u32 fault_status;
20482049
int ret;

drivers/iommu/intel/iommu.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3146,7 +3146,14 @@ int __init intel_iommu_init(void)
31463146
iommu_device_sysfs_add(&iommu->iommu, NULL,
31473147
intel_iommu_groups,
31483148
"%s", iommu->name);
3149+
/*
3150+
* The iommu device probe is protected by the iommu_probe_device_lock.
3151+
* Release the dmar_global_lock before entering the device probe path
3152+
* to avoid unnecessary lock order splat.
3153+
*/
3154+
up_read(&dmar_global_lock);
31493155
iommu_device_register(&iommu->iommu, &intel_iommu_ops, NULL);
3156+
down_read(&dmar_global_lock);
31503157

31513158
iommu_pmu_register(iommu);
31523159
}
@@ -4378,9 +4385,6 @@ static int context_setup_pass_through_cb(struct pci_dev *pdev, u16 alias, void *
43784385
{
43794386
struct device *dev = data;
43804387

4381-
if (dev != &pdev->dev)
4382-
return 0;
4383-
43844388
return context_setup_pass_through(dev, PCI_BUS_NUM(alias), alias & 0xff);
43854389
}
43864390

0 commit comments

Comments
 (0)