diff options
author | Bharata B Rao <bharata@linux.ibm.com> | 2021-07-06 16:54:40 +0530 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-07-09 11:01:06 +1000 |
commit | 82123b756a1a2f1965350e5794aaa7b5c6a15282 (patch) | |
tree | ab9f90b916b44f9b3f1b7aff737942fa909637ab /target/ppc/kvm.c | |
parent | 327d4b7f3f26eb19b8bc2b1b54afa6874612efdd (diff) | |
download | qemu-82123b756a1a2f1965350e5794aaa7b5c6a15282.zip qemu-82123b756a1a2f1965350e5794aaa7b5c6a15282.tar.gz qemu-82123b756a1a2f1965350e5794aaa7b5c6a15282.tar.bz2 |
target/ppc: Support for H_RPT_INVALIDATE hcall
If KVM_CAP_RPT_INVALIDATE KVM capability is enabled, then
- indicate the availability of H_RPT_INVALIDATE hcall to the guest via
ibm,hypertas-functions property.
- Enable the hcall
Both the above are done only if the new sPAPR machine capability
cap-rpt-invalidate is set.
Signed-off-by: Bharata B Rao <bharata@linux.ibm.com>
Message-Id: <20210706112440.1449562-3-bharata@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/kvm.c')
-rw-r--r-- | target/ppc/kvm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 104a308..dc93b99 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -89,6 +89,7 @@ static int cap_ppc_count_cache_flush_assist; static int cap_ppc_nested_kvm_hv; static int cap_large_decr; static int cap_fwnmi; +static int cap_rpt_invalidate; static uint32_t debug_inst_opcode; @@ -152,6 +153,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) exit(1); } + cap_rpt_invalidate = kvm_vm_check_extension(s, KVM_CAP_PPC_RPT_INVALIDATE); kvm_ppc_register_host_cpu_type(); return 0; @@ -2040,6 +2042,11 @@ void kvmppc_enable_h_page_init(void) kvmppc_enable_hcall(kvm_state, H_PAGE_INIT); } +void kvmppc_enable_h_rpt_invalidate(void) +{ + kvmppc_enable_hcall(kvm_state, H_RPT_INVALIDATE); +} + void kvmppc_set_papr(PowerPCCPU *cpu) { CPUState *cs = CPU(cpu); @@ -2551,6 +2558,11 @@ int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable) return 0; } +int kvmppc_has_cap_rpt_invalidate(void) +{ + return cap_rpt_invalidate; +} + PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void) { uint32_t host_pvr = mfpvr(); |