aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-08-15 02:39:19 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:52:16 -0400
commit296c19d0b4072dd9594daeec532563e56bddd119 (patch)
tree75070ed734b71414fd42f5b3f92f679ed3023ce3 /arch/powerpc/kvm
parent8b6db3bc965c204db6868d4005808b4fdc9c46d7 (diff)
KVM: PPC: Don't put MSR_POW in MSR
On Book3S a mtmsr with the MSR_POW bit set indicates that the OS is in idle and only needs to be waked up on the next interrupt. Now, unfortunately we let that bit slip into the stored MSR value which is not what the real CPU does, so that we ended up executing code like this: r = mfmsr(); /* r containts MSR_POW */ mtmsr(r | MSR_EE); This obviously breaks, as we're going into idle mode in code sections that don't expect to be idling. This patch masks MSR_POW out of the stored MSR value on wakeup, making guests happy again. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/book3s.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 7adea632065..5833df7e8cc 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -134,10 +134,14 @@ void kvmppc_set_msr(struct kvm_vcpu *vcpu, u64 msr)
134 vcpu->arch.shared->msr = msr; 134 vcpu->arch.shared->msr = msr;
135 kvmppc_recalc_shadow_msr(vcpu); 135 kvmppc_recalc_shadow_msr(vcpu);
136 136
137 if (msr & (MSR_WE|MSR_POW)) { 137 if (msr & MSR_POW) {
138 if (!vcpu->arch.pending_exceptions) { 138 if (!vcpu->arch.pending_exceptions) {
139 kvm_vcpu_block(vcpu); 139 kvm_vcpu_block(vcpu);
140 vcpu->stat.halt_wakeup++; 140 vcpu->stat.halt_wakeup++;
141
142 /* Unset POW bit after we woke up */
143 msr &= ~MSR_POW;
144 vcpu->arch.shared->msr = msr;
141 } 145 }
142 } 146 }
143 147