x86/mm: correctly initialise M2P entries on boot
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Tue, 27 Aug 2019 11:48:05 +0000 (12:48 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 27 Aug 2019 12:40:42 +0000 (13:40 +0100)
commit6c093931a765803cfc7b0df466ee032760cc8020
tree2e7040e34f97494402181c622382abb74f256462
parent7ef63cd38bbf8f9153549d5216e14a07e7f4ece6
x86/mm: correctly initialise M2P entries on boot

Since guest resource management work it's now possible to have a page
assigned to a domain without a valid M2P entry. Some paths in the code
rely on the fact a GFN returned from mfn_to_gfn() for such a page
is not valid as well, i.e. see arch_iommu_populate_page_table().

For systems without 512GB contiguous RAM M2P entries were already
correctly initialised on boot with INVALID_M2P_ENTRY (~0UL) but
on systems where M2P could be covered by a single 1GB page directory
0x77 poison was used instead. That eventually resulted in a crash
during IOMMU construction on systems without shared PTs enabled.

While here fix up compat M2P entries as well.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_64/mm.c