diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2017-05-12 15:46:11 +1000 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-07-17 15:07:05 +1000 |
commit | 30f4b05bd090564181554d0890605eb2c143e4ea (patch) | |
tree | ac2f6656ac80dec20a9ea7ddd86a410690222c34 /target | |
parent | 2ee77040f53b7720579d897544604e45b3d41963 (diff) | |
download | qemu-30f4b05bd090564181554d0890605eb2c143e4ea.zip qemu-30f4b05bd090564181554d0890605eb2c143e4ea.tar.gz qemu-30f4b05bd090564181554d0890605eb2c143e4ea.tar.bz2 |
pseries: Stubs for HPT resizing
This introduces stub implementations of the H_RESIZE_HPT_PREPARE and
H_RESIZE_HPT_COMMIT hypercalls which we hope to add in a PAPR
extension to allow run time resizing of a guest's hash page table. It
also adds a new machine property for controlling whether this new
facility is available.
For now we only allow resizing with TCG, allowing it with KVM will require
kernel changes as well.
Finally, it adds a new string to the hypertas property in the device
tree, advertising to the guest the availability of the HPT resizing
hypercalls. This is a tentative suggested value, and would need to be
standardized by PAPR before being merged.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/ppc/kvm.c | 13 | ||||
-rw-r--r-- | target/ppc/kvm_ppc.h | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index f7a7ea5..8bafd1e 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -22,6 +22,7 @@ #include <linux/kvm.h> #include "qemu-common.h" +#include "qapi/error.h" #include "qemu/error-report.h" #include "cpu.h" #include "cpu-models.h" @@ -2709,3 +2710,15 @@ int kvmppc_enable_hwrng(void) return kvmppc_enable_hcall(kvm_state, H_RANDOM); } + +void kvmppc_check_papr_resize_hpt(Error **errp) +{ + if (!kvm_enabled()) { + return; + } + + /* TODO: Check for resize-capable KVM implementations */ + + error_setg(errp, + "Hash page table resizing not available with this KVM version"); +} diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index eab7c8f..9be706c 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -63,6 +63,7 @@ bool kvmppc_has_cap_mmu_hash_v3(void); int kvmppc_enable_hwrng(void); int kvmppc_put_books_sregs(PowerPCCPU *cpu); PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void); +void kvmppc_check_papr_resize_hpt(Error **errp); bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path); @@ -297,6 +298,10 @@ static inline PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void) return NULL; } +static inline void kvmppc_check_papr_resize_hpt(Error **errp) +{ + return; +} #endif #ifndef CONFIG_KVM |