Skip to contentSkip to conversation

KVM: PPC: e500: Don't hardcode PIR=0

PATCH Applied Scott Wood 2 participants 2 messages Sep 2, 2011 – Sep 6, 2011

Subsystems (3)
lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH v2 1/1 KVM: PPC: e500: Don't hardcode PIR=0

The hardcoded behavior prevents proper SMP support.

QEMU shall specify the vcpu's PIR as the vcpu id.

---
v2: More detailed commit message.

 arch/powerpc/kvm/booke.c |    4 ++--
 arch/powerpc/kvm/e500.c  |    3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
arch/powerpc/kvm/booke.c +2 -2
index ee45fa0..d967faf 100644
@@ -753,7 +753,7 @@ static void get_sregs_arch206(struct kvm_vcpu *vcpu,
 {
 	sregs->u.e.features |= KVM_SREGS_E_ARCH206;
 
-	sregs->u.e.pir = 0;
+	sregs->u.e.pir = vcpu->vcpu_id;
 	sregs->u.e.mcsrr0 = vcpu->arch.mcsrr0;
 	sregs->u.e.mcsrr1 = vcpu->arch.mcsrr1;
 	sregs->u.e.decar = vcpu->arch.decar;
@@ -766,7 +766,7 @@ static int set_sregs_arch206(struct kvm_vcpu *vcpu,
 	if (!(sregs->u.e.features & KVM_SREGS_E_ARCH206))
 		return 0;
 
-	if (sregs->u.e.pir != 0)
+	if (sregs->u.e.pir != vcpu->vcpu_id)
 		return -EINVAL;
 
 	vcpu->arch.mcsrr0 = sregs->u.e.mcsrr0;
arch/powerpc/kvm/e500.c +0 -3
index b8f065c..e8f5ec2 100644
@@ -70,9 +70,6 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
 	vcpu->arch.pvr = mfspr(SPRN_PVR);
 	vcpu_e500->svr = mfspr(SPRN_SVR);
 
-	/* Since booke kvm only support one core, update all vcpus' PIR to 0 */
-	vcpu->vcpu_id = 0;
-
 	return 0;
 }
 
Signature · 1 line
1.7.6