diff options
author | Nikunj A Dadhania <nikunj@linux.ibm.com> | 2018-09-04 14:54:18 +0530 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2018-09-05 16:06:19 +1000 |
commit | a84f71793aab5d06b5798e78e1cee82cc3e4b3e2 (patch) | |
tree | 2041d6a0476488eede9d6e60ba813aac2b999961 /target/ppc/kvm.c | |
parent | b12a4efb76e81644e290d962d2eb6dbb0a5f214f (diff) |
target/ppc/kvm: set vcpu as online/offline
Set the newly added register(KVM_REG_PPC_ONLINE) to indicate if the vcpu is
online(1) or offline(0)
KVM will use this information to set the RWMR register, which controls the PURR
and SPURR accumulation.
CC: paulus@samba.org
Signed-off-by: Nikunj A Dadhania <nikunj@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 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index ef63842217..30aeafa7de 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2783,3 +2783,12 @@ bool kvmppc_pvr_workaround_required(PowerPCCPU *cpu) return !kvmppc_is_pr(cs->kvm_state); } + +void kvmppc_set_reg_ppc_online(PowerPCCPU *cpu, unsigned int online) +{ + CPUState *cs = CPU(cpu); + + if (kvm_enabled()) { + kvm_set_one_reg(cs, KVM_REG_PPC_ONLINE, &online); + } +} |