iommu/amd: Allocate the page table root using GFP_KERNEL

BugLink: https://bugs.launchpad.net/bugs/2089340

[ Upstream commit b0a6c883bcd42eeb0850135e529b34b64d57673c ]

Domain allocation is always done under a sleepable context, the v1 path
and other drivers use GFP_KERNEL already. Fix the v2 path to also use
GFP_KERNEL.

Fixes: 0d571dcbe7 ("iommu/amd: Allocate page table using numa locality info")
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/2-v2-831cdc4d00f3+1a315-amd_iopgtbl_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[portias: revert to using alloc_pgtable_page, new page allocation functions
are not provided by iommu-pages.h yet]
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
Jason Gunthorpe
2024-08-29 21:06:11 -03:00
committed by Mehmet Basaran
parent 30c687a7b7
commit 20bfe9e73b
+1 -1
View File
@@ -374,7 +374,7 @@ static struct io_pgtable *v2_alloc_pgtable(struct io_pgtable_cfg *cfg, void *coo
int ret;
int ias = IOMMU_IN_ADDR_BIT_SIZE;
pgtable->pgd = alloc_pgtable_page(pdom->nid, GFP_ATOMIC);
pgtable->pgd = alloc_pgtable_page(pdom->nid, GFP_KERNEL);
if (!pgtable->pgd)
return NULL;