x86/pvh: fix population of the low 1MB for dom0
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 24 Jan 2022 16:13:12 +0000 (17:13 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Jan 2022 10:52:24 +0000 (10:52 +0000)
commit2d5fc9120d556ec3c4b1acf0ab5660a6d3f7ebeb
treec5c2aae68baf891d6b132ae91cb63e26977885bb
parentec32910f4f871dce0f0e32dfb36f218fa1a2e869
x86/pvh: fix population of the low 1MB for dom0

RMRRs are setup ahead of populating the p2m and hence the ASSERT when
populating the low 1MB needs to be relaxed when it finds an existing
entry: it's either RAM or a RMRR resulting from the IOMMU setup.

Rework the logic a bit and introduce a local mfn variable in order to
assert that if the gfn is populated and not RAM it is an identity map.

Fixes: 6b4f6a31ac ('x86/PVH: de-duplicate mappings for first Mb of Dom0 memory')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/dom0_build.c