x86/dom0: take alignment into account when populating p2m in PVH mode
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 28 Dec 2018 11:18:56 +0000 (12:18 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 28 Dec 2018 14:32:57 +0000 (14:32 +0000)
commitae7fc10d2ca5c22e04b8a28becbd1fbf8b44e83a
treed190c4bcca32476eb5b4f55ecfa1a222b3f883c9
parent626c9bde57b540efea5ddfce7f148baeda435869
x86/dom0: take alignment into account when populating p2m in PVH mode

Current code that allocates memory and populates the p2m for PVH Dom0
doesn't take the address alignment into account, this can lead to high
order allocations that start on a non-aligned address to be broken
down into lower order entries on the p2m page tables.

Fix this by taking into account the p2m page sizes and alignment
requirements when allocating the memory and populating the p2m.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/dom0_build.c