Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'iommu-v4.15-rc7' of git://github.com/awilliam/linux-vfio

Pull IOMMU fixes from Alex Williamson:
"Fixes via Will Deacon for arm-smmu-v3.

- Fix duplicate Stream ID handling in arm-smmu-v3

- Fix arm-smmu-v3 page table ops double free"

* tag 'iommu-v4.15-rc7' of git://github.com/awilliam/linux-vfio:
iommu/arm-smmu-v3: Cope with duplicated Stream IDs
iommu/arm-smmu-v3: Don't free page table ops twice

+13 -4
+13 -4
drivers/iommu/arm-smmu-v3.c
··· 1698 1698 domain->pgsize_bitmap = pgtbl_cfg.pgsize_bitmap; 1699 1699 domain->geometry.aperture_end = (1UL << ias) - 1; 1700 1700 domain->geometry.force_aperture = true; 1701 - smmu_domain->pgtbl_ops = pgtbl_ops; 1702 1701 1703 1702 ret = finalise_stage_fn(smmu_domain, &pgtbl_cfg); 1704 - if (ret < 0) 1703 + if (ret < 0) { 1705 1704 free_io_pgtable_ops(pgtbl_ops); 1705 + return ret; 1706 + } 1706 1707 1707 - return ret; 1708 + smmu_domain->pgtbl_ops = pgtbl_ops; 1709 + return 0; 1708 1710 } 1709 1711 1710 1712 static __le64 *arm_smmu_get_step_for_sid(struct arm_smmu_device *smmu, u32 sid) ··· 1733 1731 1734 1732 static void arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec) 1735 1733 { 1736 - int i; 1734 + int i, j; 1737 1735 struct arm_smmu_master_data *master = fwspec->iommu_priv; 1738 1736 struct arm_smmu_device *smmu = master->smmu; 1739 1737 1740 1738 for (i = 0; i < fwspec->num_ids; ++i) { 1741 1739 u32 sid = fwspec->ids[i]; 1742 1740 __le64 *step = arm_smmu_get_step_for_sid(smmu, sid); 1741 + 1742 + /* Bridged PCI devices may end up with duplicated IDs */ 1743 + for (j = 0; j < i; j++) 1744 + if (fwspec->ids[j] == sid) 1745 + break; 1746 + if (j < i) 1747 + continue; 1743 1748 1744 1749 arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste); 1745 1750 }