x86/PVH: de-duplicate mappings for first Mb of Dom0 memory
authorJan Beulich <jbeulich@suse.com>
Wed, 8 Sep 2021 12:51:24 +0000 (14:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Sep 2021 12:51:24 +0000 (14:51 +0200)
commit0cfccfd7feffb51295d10bd4952a37bb06f0b53f
treef12aa32afcada6f61f82b0d2b0c63edbe579e073
parent76c7755ed5ebc0ade1711ffd6f435233b97e8332
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>
master commit: 6b4f6a31ace125d658a581e8d10809e4fccdc272
master date: 2021-08-31 17:43:36 +0200
xen/arch/x86/hvm/dom0_build.c
xen/drivers/passthrough/x86/iommu.c