spapr: Use maximum page size capability to simplify memory backend checking
commit123eec655287e43e0e86154e8093a394aefa3958
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 18 Apr 2018 04:21:45 +0000 (18 14:21 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 22 Jun 2018 04:19:07 +0000 (22 14:19 +1000)
tree357c075e950822ba5744bf746d52337ac7079172
parent2309832afdaf8d6451ebc2e81bace8eb8ea41293
spapr: Use maximum page size capability to simplify memory backend checking

The way we used to handle KVM allowable guest pagesizes for PAPR guests
required some convoluted checking of memory attached to the guest.

The allowable pagesizes advertised to the guest cpus depended on the memory
which was attached at boot, but then we needed to ensure that any memory
later hotplugged didn't change which pagesizes were allowed.

Now that we have an explicit machine option to control the allowable
maximum pagesize we can simplify this.  We just check all memory backends
against that declared pagesize.  We check base and cold-plugged memory at
reset time, and hotplugged memory at pre_plug() time.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
hw/ppc/spapr.c
hw/ppc/spapr_caps.c
include/hw/ppc/spapr.h
target/ppc/kvm.c
target/ppc/kvm_ppc.h