VT-d: replace all-contiguous page tables by superpage mappings
authorJan Beulich <jbeulich@suse.com>
Mon, 25 Jul 2022 13:41:48 +0000 (15:41 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 25 Jul 2022 13:41:48 +0000 (15:41 +0200)
commit3eb5c23542fabeeaff3c20a1fb1f6dddc2874890
tree32cbab0b4029c0fb8b1e09c3270f2c3797deae30
parent0f91f75eb7ec589700c2c651b03d606bb19471dc
VT-d: replace all-contiguous page tables by superpage mappings

When a page table ends up with all contiguous entries (including all
identical attributes), it can be replaced by a superpage entry at the
next higher level. The page table itself can then be scheduled for
freeing.

The adjustment to LEVEL_MASK is merely to avoid leaving a latent trap
for whenever we (and obviously hardware) start supporting 512G mappings.

Note that cache sync-ing is likely more strict than necessary. This is
both to be on the safe side as well as to maintain the pattern of all
updates of (potentially) live tables being accompanied by a flush (if so
needed).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <paul@xen.org>
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/iommu.h