diff options
Diffstat (limited to 'arch/powerpc/kvm/powerpc.c')
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index ec3d2e75c0a8..9e6aa8bfd160 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -298,12 +298,25 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) | |||
298 | 298 | ||
299 | void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) | 299 | void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) |
300 | { | 300 | { |
301 | #ifdef CONFIG_BOOKE | ||
302 | /* | ||
303 | * vrsave (formerly usprg0) isn't used by Linux, but may | ||
304 | * be used by the guest. | ||
305 | * | ||
306 | * On non-booke this is associated with Altivec and | ||
307 | * is handled by code in book3s.c. | ||
308 | */ | ||
309 | mtspr(SPRN_VRSAVE, vcpu->arch.vrsave); | ||
310 | #endif | ||
301 | kvmppc_core_vcpu_load(vcpu, cpu); | 311 | kvmppc_core_vcpu_load(vcpu, cpu); |
302 | } | 312 | } |
303 | 313 | ||
304 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) | 314 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) |
305 | { | 315 | { |
306 | kvmppc_core_vcpu_put(vcpu); | 316 | kvmppc_core_vcpu_put(vcpu); |
317 | #ifdef CONFIG_BOOKE | ||
318 | vcpu->arch.vrsave = mfspr(SPRN_VRSAVE); | ||
319 | #endif | ||
307 | } | 320 | } |
308 | 321 | ||
309 | int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, | 322 | int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, |