pseries: Allow HPT resizing with KVM
commitb55d295e3ec98e46f5b39d50e4a3a9725b4289b3
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 12 Jul 2017 07:56:55 +0000 (12 17:56 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 17 Jul 2017 05:07:05 +0000 (17 15:07 +1000)
treea9fadf3a3abae4c1e018f3b3aaca9ca9ceea59fc
parent2772cf6be90e39919d0557ba3c57a77313ca9edf
pseries: Allow HPT resizing with KVM

So far, qemu implements the PAPR Hash Page Table (HPT) resizing extension
with TCG.  The same implementation will work with KVM PR, but we don't
currently allow that.  For KVM HV we can only implement resizing with the
assistance of the host kernel, which needs a new capability and ioctl()s.

This patch adds support for testing the new KVM capability and implementing
the resize in terms of KVM facilities when necessary.  If we're running on
a kernel which doesn't have the new capability flag at all, we fall back to
testing for PR vs. HV KVM using the same hack that we already use in a
number of places for older kernels.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_hcall.c
target/ppc/kvm.c
target/ppc/kvm_ppc.h