IOMMU Fixes for Linux v6.5-rc1
Including: - Fix a regression causing a crash on sysfs access of iommu-group specific files - Fix signedness bug in SVA code -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEr9jSbILcajRFYWYyK/BELZcBGuMFAmSxsAYACgkQK/BELZcB GuMpZxAAwIZKHtblmbOmTj7TG+izY1QGbnehU5Fvytwso7z4FUU6DgmdhXVG8t6L MtWSkip4NOSej85RUr9cZK6BcK5o3wu6LU+bUBPNjJEWF7Q/Of0pZ7rMoTnDATLu mGg2dgobbQ0P5kL7NgmJrBp4YTLjFTrELOaBdp3iIIZ7sWG86hkS3IW6zaZyINOU hRRi44CsWZNfoEgARa8tbU5fx+aseaIYxjGoSOE1lVS5c8j3UZaAwv0ZdqZie8LR HnkDwlgUgdDkaq5ejb2xvyXxvNGwRf5I+3ycXv+FWMIt1jWZPVzN/jaeg3HanCyG uQd43gWPN6WLzdBDZXybUcefaRTUC77QSGdaRnWc3Y2KSh7ZqZLWH/kfCU3jBCRV bRzF6TKdA6mkFRjiZsV9RhKBclrtJn7NmhZY8SUPFKjA0yYvHiVkVU/BMMOglUaK 8VLx+C04hKiTqF605sBtTJBuhVNkCdlZdyGzallSc1eAK13kEuCrXvzj48HJndV4 AWhs75UGAYQ7g8IbrUgGFPw/emtCJBwP2iag7HJfn8pxAPAI9z4cT0fK1aJepB0B LXfHXCTJU+dzzIzWHIagrAOhaXpHINDeXWzuckrl/JSVS8JqGyWcsGp0y0v2JW5g V20LaukRcqRQI2gkZjGY9DEpyR6EleJrkXqDScrDooP2+HZuAfw= =iFwG -----END PGP SIGNATURE----- Merge tag 'iommu-fixes-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Fix a regression causing a crash on sysfs access of iommu-group specific files - Fix signedness bug in SVA code * tag 'iommu-fixes-v6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/sva: Fix signedness bug in iommu_sva_alloc_pasid() iommu: Fix crash during syfs iommu_groups/N/type
This commit is contained in:
commit
82678ab2a4
@ -34,8 +34,9 @@ static int iommu_sva_alloc_pasid(struct mm_struct *mm, ioasid_t min, ioasid_t ma
|
||||
}
|
||||
|
||||
ret = ida_alloc_range(&iommu_global_pasid_ida, min, max, GFP_KERNEL);
|
||||
if (ret < min)
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
mm->pasid = ret;
|
||||
ret = 0;
|
||||
out:
|
||||
|
@ -2891,14 +2891,11 @@ static int iommu_setup_default_domain(struct iommu_group *group,
|
||||
ret = __iommu_group_set_domain_internal(
|
||||
group, dom, IOMMU_SET_DOMAIN_MUST_SUCCEED);
|
||||
if (WARN_ON(ret))
|
||||
goto out_free;
|
||||
goto out_free_old;
|
||||
} else {
|
||||
ret = __iommu_group_set_domain(group, dom);
|
||||
if (ret) {
|
||||
iommu_domain_free(dom);
|
||||
group->default_domain = old_dom;
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
goto err_restore_def_domain;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2911,21 +2908,25 @@ static int iommu_setup_default_domain(struct iommu_group *group,
|
||||
for_each_group_device(group, gdev) {
|
||||
ret = iommu_create_device_direct_mappings(dom, gdev->dev);
|
||||
if (ret)
|
||||
goto err_restore;
|
||||
goto err_restore_domain;
|
||||
}
|
||||
}
|
||||
|
||||
err_restore:
|
||||
if (old_dom) {
|
||||
__iommu_group_set_domain_internal(
|
||||
group, old_dom, IOMMU_SET_DOMAIN_MUST_SUCCEED);
|
||||
iommu_domain_free(dom);
|
||||
old_dom = NULL;
|
||||
}
|
||||
out_free:
|
||||
out_free_old:
|
||||
if (old_dom)
|
||||
iommu_domain_free(old_dom);
|
||||
return ret;
|
||||
|
||||
err_restore_domain:
|
||||
if (old_dom)
|
||||
__iommu_group_set_domain_internal(
|
||||
group, old_dom, IOMMU_SET_DOMAIN_MUST_SUCCEED);
|
||||
err_restore_def_domain:
|
||||
if (old_dom) {
|
||||
iommu_domain_free(dom);
|
||||
group->default_domain = old_dom;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user