diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2014-06-05 12:08:02 (GMT) |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-07-28 13:21:50 (GMT) |
commit | 8f42ab2749d00ea15157ab896cfbed73a247b3e1 (patch) | |
tree | 2ca02b2e03693367661a77c28746a05852b2ed1b /arch/powerpc/kvm/book3s_pr.c | |
parent | 3cd60e31185343d4132ca7cf3c9becb903b3ec1b (diff) | |
download | linux-8f42ab2749d00ea15157ab896cfbed73a247b3e1.tar.xz |
KVM: PPC: BOOK3S: PR: Emulate virtual timebase register
virtual time base register is a per VM, per cpu register that needs
to be saved and restored on vm exit and entry. Writing to VTB is not
allowed in the privileged mode.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
[agraf: fix compile error]
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/book3s_pr.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_pr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 671f5c92..d2deb9e 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c @@ -125,6 +125,7 @@ void kvmppc_copy_to_svcpu(struct kvmppc_book3s_shadow_vcpu *svcpu, * to find the guest purr and spurr value. */ vcpu->arch.entry_tb = get_tb(); + vcpu->arch.entry_vtb = get_vtb(); svcpu->in_use = true; } @@ -176,7 +177,7 @@ void kvmppc_copy_from_svcpu(struct kvm_vcpu *vcpu, */ vcpu->arch.purr += get_tb() - vcpu->arch.entry_tb; vcpu->arch.spurr += get_tb() - vcpu->arch.entry_tb; - + vcpu->arch.vtb += get_vtb() - vcpu->arch.entry_vtb; svcpu->in_use = false; out: |