x86/PVH: de-duplicate mappings for first Mb of Dom0 memory
authorJan Beulich <jbeulich@suse.com>
Tue, 31 Aug 2021 15:43:36 +0000 (17:43 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 31 Aug 2021 15:43:36 +0000 (17:43 +0200)
commit6b4f6a31ace125d658a581e8d10809e4fccdc272
tree67b7c94a9305ecaaf83cd31a317129d1b0239c26
parent305c2c3abf8228989f7a6f6d8e698ca088c8dc42
x86/PVH: de-duplicate mappings for first Mb of Dom0 memory

One of the changes comprising the fixes for XSA-378 disallows replacing
MMIO mappings by code paths not intended for this purpose. This means we
need to be more careful about the mappings put in place in this range -
mappings should be created exactly once:
- iommu_hwdom_init() comes first; it should avoid the first Mb,
- pvh_populate_p2m() should insert identity mappings only into ranges
  not populated as RAM,
- pvh_setup_acpi() should again avoid the first Mb, which was already
  dealt with at that point.

Fixes: 753cb68e6530 ("x86/p2m: guard (in particular) identity mapping entries")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/dom0_build.c
xen/drivers/passthrough/x86/iommu.c