Skip to content

Commit fb575d1

Browse files
ssuthiku-amdjoergroedel
authored andcommitted
iommu/amd: Refactor protection_domain helper functions
To removes the code to setup GCR3 table, and only handle domain create / destroy, since GCR3 is no longer part of a domain. Signed-off-by: Suravee Suthikulpanit <[email protected]> Signed-off-by: Vasant Hegde <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 4ebd4c7 commit fb575d1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/iommu/amd/iommu.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,9 +2176,6 @@ static void protection_domain_free(struct protection_domain *domain)
21762176
if (domain->iop.pgtbl_cfg.tlb)
21772177
free_io_pgtable_ops(&domain->iop.iop.ops);
21782178

2179-
if (domain->flags & PD_IOMMUV2_MASK)
2180-
free_gcr3_table(domain);
2181-
21822179
if (domain->iop.root)
21832180
free_page((unsigned long)domain->iop.root);
21842181

@@ -2206,15 +2203,10 @@ static int protection_domain_init_v1(struct protection_domain *domain, int mode)
22062203
return 0;
22072204
}
22082205

2209-
static int protection_domain_init_v2(struct protection_domain *domain)
2206+
static int protection_domain_init_v2(struct protection_domain *pdom)
22102207
{
2211-
domain->flags |= PD_GIOV_MASK;
2212-
domain->pd_mode = PD_MODE_V2;
2213-
2214-
domain->domain.pgsize_bitmap = AMD_IOMMU_PGSIZES_V2;
2215-
2216-
if (setup_gcr3_table(domain, 1))
2217-
return -ENOMEM;
2208+
pdom->pd_mode = PD_MODE_V2;
2209+
pdom->domain.pgsize_bitmap = AMD_IOMMU_PGSIZES_V2;
22182210

22192211
return 0;
22202212
}

0 commit comments

Comments
 (0)