diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2013-08-22 07:38:39 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-08-22 13:25:41 -0400 |
commit | 87916442bd0ac0aaabcca4f7fcd7eb3d8bef0d34 (patch) | |
tree | 7c287484b4ed511d0c4ca1674dee59ef32d50cef /arch/powerpc/kvm/book3s_hv.c | |
parent | c8ae0ace104ff36d43311c148c8aeed9f194cbf2 (diff) |
powerpc/kvm: Copy the pvr value after memset
Otherwise we would clear the pvr value
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 2b95c45e17d9..1cbcb4ca5800 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
@@ -680,13 +680,12 @@ static int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
680 | } | 680 | } |
681 | 681 | ||
682 | int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, | 682 | int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, |
683 | struct kvm_sregs *sregs) | 683 | struct kvm_sregs *sregs) |
684 | { | 684 | { |
685 | int i; | 685 | int i; |
686 | 686 | ||
687 | sregs->pvr = vcpu->arch.pvr; | ||
688 | |||
689 | memset(sregs, 0, sizeof(struct kvm_sregs)); | 687 | memset(sregs, 0, sizeof(struct kvm_sregs)); |
688 | sregs->pvr = vcpu->arch.pvr; | ||
690 | for (i = 0; i < vcpu->arch.slb_max; i++) { | 689 | for (i = 0; i < vcpu->arch.slb_max; i++) { |
691 | sregs->u.s.ppc64.slb[i].slbe = vcpu->arch.slb[i].orige; | 690 | sregs->u.s.ppc64.slb[i].slbe = vcpu->arch.slb[i].orige; |
692 | sregs->u.s.ppc64.slb[i].slbv = vcpu->arch.slb[i].origv; | 691 | sregs->u.s.ppc64.slb[i].slbv = vcpu->arch.slb[i].origv; |
@@ -696,7 +695,7 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, | |||
696 | } | 695 | } |
697 | 696 | ||
698 | int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, | 697 | int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, |
699 | struct kvm_sregs *sregs) | 698 | struct kvm_sregs *sregs) |
700 | { | 699 | { |
701 | int i, j; | 700 | int i, j; |
702 | 701 | ||