diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2018-04-20 15:33:21 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2018-05-17 16:36:36 +1000 |
commit | a1f158262a3e00fe396f2d21ef1cffdfc29226dc (patch) | |
tree | 75273d1cb10f12be15338d1d25167f9ea17d3b4f /arch/powerpc/kvm | |
parent | df158189dbcc2e0ee29dc4b917d45ee5bf25a35e (diff) | |
download | op-kernel-dev-a1f158262a3e00fe396f2d21ef1cffdfc29226dc.zip op-kernel-dev-a1f158262a3e00fe396f2d21ef1cffdfc29226dc.tar.gz |
KVM: PPC: Book3S HV: Add 'online' register to ONE_REG interface
This adds a new KVM_REG_PPC_ONLINE register which userspace can set
to 0 or 1 via the GET/SET_ONE_REG interface to indicate whether it
considers the VCPU to be offline (0), that is, not currently running,
or online (1). This will be used in a later patch to configure the
register which controls PURR and SPURR accumulation.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 9963f65..04bd717 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -1526,6 +1526,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, *val = get_reg_val(id, vcpu->arch.dec_expires + vcpu->arch.vcore->tb_offset); break; + case KVM_REG_PPC_ONLINE: + *val = get_reg_val(id, vcpu->arch.online); + break; default: r = -EINVAL; break; @@ -1757,6 +1760,9 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, vcpu->arch.dec_expires = set_reg_val(id, *val) - vcpu->arch.vcore->tb_offset; break; + case KVM_REG_PPC_ONLINE: + vcpu->arch.online = set_reg_val(id, *val); + break; default: r = -EINVAL; break; |