x86/mm: correctly initialise M2P entries on boot
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Mon, 23 Sep 2019 12:39:07 +0000 (14:39 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 23 Sep 2019 12:39:07 +0000 (14:39 +0200)
commit10582ea1f9cebc1a290b04d8cb24bf31326a6b35
tree8295e61d5ee268b9b12a9e612b7447c6590f0bd5
parent4e95d85b991f5d7e9a881e176395340a4441b44b
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>
master commit: 6c093931a765803cfc7b0df466ee032760cc8020
master date: 2019-08-27 13:40:42 +0100
xen/arch/x86/x86_64/mm.c