Skip to content

Commit ecb6d61

Browse files
paulusmackagraf
authored andcommitted
KVM: PPC: Book3S HV: Endian fix for accessing VPA yield count
The VPA (virtual processor area) is defined by PAPR and is therefore big-endian, so we need a be32_to_cpu when reading it in kvmppc_get_yield_count(). Without this, H_CONFER always fails on a little-endian host, causing SMP guests to waste time spinning on spinlocks. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
1 parent 8f902b0 commit ecb6d61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kvm/book3s_hv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ static int kvmppc_get_yield_count(struct kvm_vcpu *vcpu)
636636
spin_lock(&vcpu->arch.vpa_update_lock);
637637
lppaca = (struct lppaca *)vcpu->arch.vpa.pinned_addr;
638638
if (lppaca)
639-
yield_count = lppaca->yield_count;
639+
yield_count = be32_to_cpu(lppaca->yield_count);
640640
spin_unlock(&vcpu->arch.vpa_update_lock);
641641
return yield_count;
642642
}

0 commit comments

Comments
 (0)