summaryrefslogtreecommitdiff
path: root/drivers/iommu/amd/iommu.c
diff options
context:
space:
mode:
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>2024-02-05 11:56:02 +0000
committerJoerg Roedel <jroedel@suse.de>2024-02-09 13:16:23 +0100
commitfda5108ebafe7797dc8e1279f04e6e9145c9ad10 (patch)
treec5fbf7b122625f4692ab070c03732caf6a0f01ac /drivers/iommu/amd/iommu.c
parent6f35fe5d8a0ad0125c52fb20f5d67000e369eb3a (diff)
iommu/amd: Introduce struct protection_domain.pd_mode
This enum variable is used to track the type of page table used by the protection domain. It will replace the protection_domain.flags in subsequent series. Suggested-by: Jason Gunthorpe <jgg@ziepe.ca> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20240205115615.6053-5-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd/iommu.c')
-rw-r--r--drivers/iommu/amd/iommu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 2a5ae7a841cc..a3c8f8ea926e 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -2068,6 +2068,7 @@ static int protection_domain_init_v1(struct protection_domain *domain, int mode)
return -ENOMEM;
}
+ domain->pd_mode = PD_MODE_V1;
amd_iommu_domain_set_pgtable(domain, pt_root, mode);
return 0;
@@ -2076,6 +2077,7 @@ static int protection_domain_init_v1(struct protection_domain *domain, int mode)
static int protection_domain_init_v2(struct protection_domain *domain)
{
domain->flags |= PD_GIOV_MASK;
+ domain->pd_mode = PD_MODE_V2;
domain->domain.pgsize_bitmap = AMD_IOMMU_PGSIZES_V2;