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
table = hd->arch.root_table;
level = hd->arch.paging_mode;
- BUG_ON( table == NULL || level < 1 || level > 6 );
+ BUG_ON( table == NULL || level < 1 || level > IOMMU_MAX_PT_LEVELS );
/*
* A frame number past what the current page tables can represent can't
#define IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_MASK 0xFFFFF000
#define IOMMU_DEV_TABLE_PAGE_TABLE_PTR_LOW_SHIFT 12
+#define IOMMU_MAX_PT_LEVELS 6
+
/* DeviceTable Entry[63:32] */
#define IOMMU_DEV_TABLE_GV_SHIFT 23
#define IOMMU_DEV_TABLE_GV_MASK 0x800000
while ( max_frames > PTE_PER_TABLE_SIZE )
{
max_frames = PTE_PER_TABLE_ALIGN(max_frames) >> PTE_PER_TABLE_SHIFT;
- if ( ++level > 6 )
+ if ( ++level > IOMMU_MAX_PT_LEVELS )
return -ENOMEM;
}