AMD/IOMMU: abstract maximum number of page table levels
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 12:49:23 +0000 (14:49 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 12:49:23 +0000 (14:49 +0200)
We will want to use the constant elsewhere.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
master commit: a038b514c1e970a8dc32229cbd31f6769ee61ad5
master date: 2022-04-05 14:20:04 +0200

xen/drivers/passthrough/amd/iommu-defs.h
xen/drivers/passthrough/amd/pci_amd_iommu.c

index 774234dfd2a2fa01eaa1235fec4c9b5e22e18615..8a17697ea73e8558f42251c9b10282e26f2ab358 100644 (file)
@@ -106,6 +106,7 @@ struct amd_iommu_dte {
     bool tv:1;
     unsigned int :5;
     unsigned int had:2;
+#define IOMMU_MAX_PT_LEVELS 6
     unsigned int paging_mode:3;
     uint64_t pt_root:40;
     bool ppr:1;
index f170a69a4562c1b77bbfaee0472edb1fd70c5eda..6092a2932b1be34b27645f627c69afc1132246eb 100644 (file)
@@ -337,7 +337,7 @@ int amd_iommu_alloc_root(struct domain *d)
     return 0;
 }
 
-unsigned int __read_mostly amd_iommu_max_paging_mode = 6;
+unsigned int __read_mostly amd_iommu_max_paging_mode = IOMMU_MAX_PT_LEVELS;
 int __read_mostly amd_iommu_min_paging_mode = 1;
 
 static int amd_iommu_domain_init(struct domain *d)