diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2017-07-12 17:56:55 +1000 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-07-17 15:07:05 +1000 |
commit | b55d295e3ec98e46f5b39d50e4a3a9725b4289b3 (patch) | |
tree | a9fadf3a3abae4c1e018f3b3aaca9ca9ceea59fc /target/ppc/kvm_ppc.h | |
parent | 2772cf6be90e39919d0557ba3c57a77313ca9edf (diff) |
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>
Diffstat (limited to 'target/ppc/kvm_ppc.h')
-rw-r--r-- | target/ppc/kvm_ppc.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index 9be706c5c9..6bc6fb3e2d 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -64,6 +64,9 @@ 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); +int kvmppc_resize_hpt_prepare(PowerPCCPU *cpu, target_ulong flags, int shift); +int kvmppc_resize_hpt_commit(PowerPCCPU *cpu, target_ulong flags, int shift); +void kvmppc_update_sdr1(target_ulong sdr1); bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path); @@ -302,6 +305,24 @@ static inline void kvmppc_check_papr_resize_hpt(Error **errp) { return; } + +static inline int kvmppc_resize_hpt_prepare(PowerPCCPU *cpu, + target_ulong flags, int shift) +{ + return -ENOSYS; +} + +static inline int kvmppc_resize_hpt_commit(PowerPCCPU *cpu, + target_ulong flags, int shift) +{ + return -ENOSYS; +} + +static inline void kvmppc_update_sdr1(target_ulong sdr1) +{ + abort(); +} + #endif #ifndef CONFIG_KVM |