All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] KVM: PPC: e500: Don't hardcode PIR=0
@ 2011-09-02 22:39 ` Scott Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2011-09-02 22:39 UTC (permalink / raw)
  To: agraf; +Cc: kvm-ppc, kvm

The hardcoded behavior prevents proper SMP support.

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

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
v2: More detailed commit message.

 arch/powerpc/kvm/booke.c |    4 ++--
 arch/powerpc/kvm/e500.c  |    3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index ee45fa0..d967faf 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -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;
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c
index b8f065c..e8f5ec2 100644
--- a/arch/powerpc/kvm/e500.c
+++ b/arch/powerpc/kvm/e500.c
@@ -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;
 }
 
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] KVM: PPC: e500: Don't hardcode PIR=0
@ 2011-09-02 22:39 ` Scott Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2011-09-02 22:39 UTC (permalink / raw)
  To: agraf; +Cc: kvm-ppc, kvm

The hardcoded behavior prevents proper SMP support.

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

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
v2: More detailed commit message.

 arch/powerpc/kvm/booke.c |    4 ++--
 arch/powerpc/kvm/e500.c  |    3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index ee45fa0..d967faf 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -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;
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c
index b8f065c..e8f5ec2 100644
--- a/arch/powerpc/kvm/e500.c
+++ b/arch/powerpc/kvm/e500.c
@@ -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;
 }
 
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] KVM: PPC: e500: Don't hardcode PIR=0
  2011-09-02 22:39 ` Scott Wood
@ 2011-09-06 15:18   ` Alexander Graf
  -1 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2011-09-06 15:18 UTC (permalink / raw)
  To: Scott Wood; +Cc: kvm-ppc, kvm


On 03.09.2011, at 00:39, Scott Wood wrote:

> The hardcoded behavior prevents proper SMP support.
> 
> QEMU shall specify the vcpu's PIR as the vcpu id.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Thanks, applied.


Alex


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] KVM: PPC: e500: Don't hardcode PIR=0
@ 2011-09-06 15:18   ` Alexander Graf
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2011-09-06 15:18 UTC (permalink / raw)
  To: Scott Wood; +Cc: kvm-ppc, kvm


On 03.09.2011, at 00:39, Scott Wood wrote:

> The hardcoded behavior prevents proper SMP support.
> 
> QEMU shall specify the vcpu's PIR as the vcpu id.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Thanks, applied.


Alex


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-06 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-02 22:39 [PATCH v2] KVM: PPC: e500: Don't hardcode PIR=0 Scott Wood
2011-09-02 22:39 ` Scott Wood
2011-09-06 15:18 ` Alexander Graf
2011-09-06 15:18   ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.