VT-d: limit page table population in domain_pgd_maddr()
authorJan Beulich <jbeulich@suse.com>
Fri, 22 Apr 2022 12:53:13 +0000 (14:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 22 Apr 2022 12:53:13 +0000 (14:53 +0200)
commit4e977a70adb1b9036d5fa7705d73ab5dd087faa4
treea76ab88b03d3e4b418d2aa4828da8b093b2c8e98
parentc71e55501a618d0443d2e07ef0e04edce74a0e5f
VT-d: limit page table population in domain_pgd_maddr()

I have to admit that I never understood why domain_pgd_maddr() wants to
populate all page table levels for DFN 0. I can only assume that despite
the comment there what is needed is population just down to the smallest
possible nr_pt_levels that the loop later in the function may need to
run to. Hence what is needed is the minimum of all possible
iommu->nr_pt_levels, to then be passed into addr_to_dma_page_maddr()
instead of literal 1.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c