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 /hw/ppc | |
parent | b12a4efb76e81644e290d962d2eb6dbb0a5f214f (diff) | |
download | qemu-a84f71793aab5d06b5798e78e1cee82cc3e4b3e2.zip qemu-a84f71793aab5d06b5798e78e1cee82cc3e4b3e2.tar.gz qemu-a84f71793aab5d06b5798e78e1cee82cc3e4b3e2.tar.bz2 |
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 'hw/ppc')
-rw-r--r-- | hw/ppc/spapr_cpu_core.c | 1 | ||||
-rw-r--r-- | hw/ppc/spapr_rtas.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index a73b244..2398ce6 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -90,6 +90,7 @@ void spapr_cpu_set_entry_state(PowerPCCPU *cpu, target_ulong nip, target_ulong r env->nip = nip; env->gpr[3] = r3; + kvmppc_set_reg_ppc_online(cpu, 1); CPU(cpu)->halted = 0; /* Enable Power-saving mode Exit Cause exceptions */ ppc_store_lpcr(cpu, env->spr[SPR_LPCR] | pcc->lpcr_pm); diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 4ac96bc..d6a0952 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -33,6 +33,7 @@ #include "sysemu/device_tree.h" #include "sysemu/cpus.h" #include "sysemu/hw_accel.h" +#include "kvm_ppc.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_vio.h" @@ -207,6 +208,7 @@ static void rtas_stop_self(PowerPCCPU *cpu, sPAPRMachineState *spapr, * guest */ ppc_store_lpcr(cpu, env->spr[SPR_LPCR] & ~pcc->lpcr_pm); cs->halted = 1; + kvmppc_set_reg_ppc_online(cpu, 0); qemu_cpu_kick(cs); } |