ppc: Huge page detection mechanism fixes - Episode III
commit3d4f2534834cd9f9bbb3dd145fa61fd2ac0dd535
authorThomas Huth <thuth@redhat.com>
Mon, 18 Jul 2016 13:19:04 +0000 (18 15:19 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 25 Jul 2016 00:19:30 +0000 (25 10:19 +1000)
tree9a8916852e22ef8386e7bb617ec285f6a3863bf2
parent2d2e632ad00d11867c6c5625605b1fbc022dd62f
ppc: Huge page detection mechanism fixes - Episode III

After already fixing two issues with the huge page detection mechanism
(see commit 159d2e39a860 and 86b50f2e1bef), Greg Kurz noticed another
case that caused the guest to crash where QEMU announces huge pages
though they should not be available for the guest:

qemu-system-ppc64 -enable-kvm ... -mem-path /dev/hugepages \
 -m 1G,slots=4,maxmem=32G
 -object memory-backend-ram,policy=default,size=1G,id=mem-mem1 \
 -device pc-dimm,id=dimm-mem1,memdev=mem-mem1 -smp 2 \
 -numa node,nodeid=0 -numa node,nodeid=1

That means if there is a global mem-path option, we still have
to look at the memory-backend objects that have been specified
additionally and return their minimum page size if that value
is smaller than the page size of the main memory.

Reported-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target-ppc/kvm.c