mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-15 20:47:43 +07:00
IOMMU fixes for Linux v4.15-rc7
* Fix duplicate Stream ID handling in arm-smmu-v3 * Fix arm-smmu-v3 page table ops double free -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iQIcBAABAgAGBQJaT652AAoJECObm247sIsi3WsP/0CrTtKvaS5c4S0wc+drsl0R aqKwKzTTWI9Lo/ky8Pqd82QcN8ZKZrObg7JGKXql0YEboxYFm7Jm33Lkn6jFGWwd jJB6AIjZRKd6MAO9LvduyTFO/DoMnJxzUZmGg+YYfqiQGyQ2lAYcPHJsdtjvn+yy 1osWd2xxpEccqXOeh8dhzfDVipt1KRLrahxzr0Wdas7DUp0nI9n8FR9M5wh+xacW 2rEiScFZ+NzGCRmGeFRpy9znwpM1YKGaB9E2mvTRsql3CbzGAoQUDfu2F5oz6B6B QPEvvCGIG4tuCo53W7Fr49jfi2WAAdgxNfINbKo/QXFSapG0M1EKq8ivEvP09/s4 c38OrBU4Snxm1EpWwkIlavuj4N3eo91S9FvzXmkfQQ4y6TAdr8fXOqwSbplRHhCO NhyK4gtFK3nf6qcSwEys5cVCBMCSd8Fr/5EGDro4lz77hajU86EWFUv0A0ZJpQ1H g3boKM/5WBkDWgEtxk1cwup0K3Pixs0RiA7fMyEZGo1DkgObzql+T9P702Z6uke+ 0KBtmaFeJ3Rj1pOD0NUx0CGMMuqhQ4uCu8wPe8tOk2MxJdc5IhATGI5i9b0UvLXs Zeut4J1Pz8ua977zmTM9GUbHTzm1zc0c9iUTGM1RG2agZ9sl8F/tjiCr0T8STW6E zqZGtdBEVW/gSQeeYPXn =ta8U -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
313243aa1a
@ -1698,13 +1698,15 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain)
|
||||
domain->pgsize_bitmap = pgtbl_cfg.pgsize_bitmap;
|
||||
domain->geometry.aperture_end = (1UL << ias) - 1;
|
||||
domain->geometry.force_aperture = true;
|
||||
smmu_domain->pgtbl_ops = pgtbl_ops;
|
||||
|
||||
ret = finalise_stage_fn(smmu_domain, &pgtbl_cfg);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
free_io_pgtable_ops(pgtbl_ops);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
smmu_domain->pgtbl_ops = pgtbl_ops;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __le64 *arm_smmu_get_step_for_sid(struct arm_smmu_device *smmu, u32 sid)
|
||||
@ -1731,7 +1733,7 @@ static __le64 *arm_smmu_get_step_for_sid(struct arm_smmu_device *smmu, u32 sid)
|
||||
|
||||
static void arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec)
|
||||
{
|
||||
int i;
|
||||
int i, j;
|
||||
struct arm_smmu_master_data *master = fwspec->iommu_priv;
|
||||
struct arm_smmu_device *smmu = master->smmu;
|
||||
|
||||
@ -1739,6 +1741,13 @@ static void arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec)
|
||||
u32 sid = fwspec->ids[i];
|
||||
__le64 *step = arm_smmu_get_step_for_sid(smmu, sid);
|
||||
|
||||
/* Bridged PCI devices may end up with duplicated IDs */
|
||||
for (j = 0; j < i; j++)
|
||||
if (fwspec->ids[j] == sid)
|
||||
break;
|
||||
if (j < i)
|
||||
continue;
|
||||
|
||||
arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user