]> git.proxmox.com Git - mirror_qemu.git/commit - hw/ppc/spapr_caps.c
spapr: Maximum (HPT) pagesize property
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 16 Mar 2018 08:19:13 +0000 (19:19 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 22 Jun 2018 04:19:07 +0000 (14:19 +1000)
commit2309832afdaf8d6451ebc2e81bace8eb8ea41293
tree599ca45adcf9273b506f23db1f94bdd3f5d8a6fc
parentd21bbcc655b4f611f3d9246d50dba0b6a404d784
spapr: Maximum (HPT) pagesize property

The way the POWER Hash Page Table (HPT) MMU is virtualized by KVM HV means
that every page that the guest puts in the pagetables must be truly
physically contiguous, not just GPA-contiguous.  In effect this means that
an HPT guest can't use any pagesizes greater than the host page size used
to back its memory.

At present we handle this by changing what we advertise to the guest based
on the backing pagesizes.  This is pretty bad, because it means the guest
sees a different environment depending on what should be host configuration
details.

As a start on fixing this, we add a new capability parameter to the
pseries machine type which gives the maximum allowed pagesizes for an
HPT guest.  For now we just create and validate the parameter without
making it do anything.

For backwards compatibility, on older machine types we set it to the max
available page size for the host.  For the 3.0 machine type, we fix it to
16, the intention being to only allow HPT pagesizes up to 64kiB by default
in future.

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