Skip to content

Commit 296c19d

Browse files
agrafavikivity
authored andcommitted
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>
1 parent 8b6db3b commit 296c19d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎arch/powerpc/kvm/book3s.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,14 @@ void kvmppc_set_msr(struct kvm_vcpu *vcpu, u64 msr)
134134
vcpu->arch.shared->msr = msr;
135135
kvmppc_recalc_shadow_msr(vcpu);
136136

137-
if (msr & (MSR_WE|MSR_POW)) {
137+
if (msr & MSR_POW) {
138138
if (!vcpu->arch.pending_exceptions) {
139139
kvm_vcpu_block(vcpu);
140140
vcpu->stat.halt_wakeup++;
141+
142+
/* Unset POW bit after we woke up */
143+
msr &= ~MSR_POW;
144+
vcpu->arch.shared->msr = msr;
141145
}
142146
}
143147

0 commit comments

Comments
 (0)