]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/amd: Set the pgsize_bitmap correctly
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 30 Aug 2024 00:06:12 +0000 (21:06 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:32:40 +0000 (16:32 +0200)
commitc4cdd0948126c39740ee63ed5a30c2de3c51e8f9
treeec561189d58297d9cd70fe4ac746b50588013328
parent8cab33c1b290e02dcffd985b61afc8d1c84bcd4b
iommu/amd: Set the pgsize_bitmap correctly

[ Upstream commit 7a41dcb52f9de6079621fc31c3b84c7fc290934b ]

When using io_pgtable the correct pgsize_bitmap is stored in the cfg, both
v1_alloc_pgtable() and v2_alloc_pgtable() set it correctly.

This fixes a bug where the v2 pgtable had the wrong pgsize as
protection_domain_init_v2() would set it and then do_iommu_domain_alloc()
immediately resets it.

Remove the confusing ops.pgsize_bitmap since that is not used if the
driver sets domain.pgsize_bitmap.

Fixes: 134288158a41 ("iommu/amd: Add domain_alloc_user based domain allocation")
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/3-v2-831cdc4d00f3+1a315-amd_iopgtbl_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/amd/iommu.c