Skip to contentSkip to conversation

kvmppc/e500: Add PVR/PIR init for E500

PATCH In review Liu Yu 3 participants 4 messages Jan 20, 2010 – Jan 21, 2010

Subsystems (2)
lore
Share & tools
lore

Liu Yu

author
#0 lore raw

PATCH 2/3 kvmppc/e500: Add PVR/PIR init for E500

---
 arch/powerpc/kvm/e500.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/powerpc/kvm/e500.c +4 -0
index 64949ee..fd3683d 100644
@@ -60,6 +60,10 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
 
 	kvmppc_e500_tlb_setup(vcpu_e500);
 
+	/* Registers init */
+	vcpu->arch.pvr = mfspr(SPRN_PVR);
+	vcpu->vcpu_id = mfspr(SPRN_PIR);
+
 	return 0;
 }
 
Signature · 1 line
1.6.4
#1 lore raw
Quoted 10 lines · Liu Yu

---
arch/powerpc/kvm/e500.c | 4 ++++

1 files changed, 4 insertions(+), 0 deletions(-)
arch/powerpc/kvm/e500.c +0 -0
index 64949ee..fd3683d 100644

arch/powerpc/kvm/e500.c int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu) · line 65

Quoted 6 lines
arch/powerpc/kvm/e500.c +3 -0
@@ -60,6 +60,10 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
 
 	kvmppc_e500_tlb_setup(vcpu_e500);
 
+	/* Registers init */
+	vcpu->arch.pvr = mfspr(SPRN_PVR);
+	vcpu->vcpu_id = mfspr(SPRN_PIR);

Is this correct? IIUC this should be the number of the vcpu. So if you virtualize a 2-core system, but both vcpu init functions run on core 1, this will break, right?

Alex

#2 lore raw
In reply to Liu Yu
Quoted 26 lines

-----Original Message-----
From: Alexander Graf [mailto:[email protected]]
Sent: Wednesday, January 20, 2010 6:45 PM
To: Liu Yu-B13201
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 2/3] kvmppc/e500: Add PVR/PIR init for E500
Importance: High

Quoted 13 lines · Liu Yu

---
arch/powerpc/kvm/e500.c | 4 ++++

1 files changed, 4 insertions(+), 0 deletions(-)
arch/powerpc/kvm/e500.c +0 -0
index 64949ee..fd3683d 100644
@@ -60,6 +60,10 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
 
 	kvmppc_e500_tlb_setup(vcpu_e500);
 
Quoted 8 lines

arch/powerpc/kvm/e500.c int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu) · line 65

Quoted 3 lines
arch/powerpc/kvm/e500.c +3 -0
+	/* Registers init */
+	vcpu->arch.pvr = mfspr(SPRN_PVR);
+	vcpu->vcpu_id = mfspr(SPRN_PIR);

Is this correct? IIUC this should be the number of the vcpu. So if you virtualize a 2-core system, but both vcpu init functions run on core 1, this will break, right?

Since kvm booke doesn't support more than 1 core virtualization. Can we put a comment here for now?

#3 lore raw
In reply to Liu Yu
Quoted 35 lines · On 21.01.2010, at 04:30, Liu Yu-B13201 wrote:
Quoted 26 lines

-----Original Message-----
From: Alexander Graf [mailto:[email protected]]
Sent: Wednesday, January 20, 2010 6:45 PM
To: Liu Yu-B13201
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 2/3] kvmppc/e500: Add PVR/PIR init for E500
Importance: High

Quoted 13 lines · Liu Yu

---
arch/powerpc/kvm/e500.c | 4 ++++

1 files changed, 4 insertions(+), 0 deletions(-)
arch/powerpc/kvm/e500.c +0 -0
index 64949ee..fd3683d 100644
@@ -60,6 +60,10 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
 
 	kvmppc_e500_tlb_setup(vcpu_e500);
 
Quoted 8 lines

arch/powerpc/kvm/e500.c int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu) · line 65

Quoted 3 lines
arch/powerpc/kvm/e500.c +3 -0
+	/* Registers init */
+	vcpu->arch.pvr = mfspr(SPRN_PVR);
+	vcpu->vcpu_id = mfspr(SPRN_PIR);

Is this correct? IIUC this should be the number of the vcpu. So if you virtualize a 2-core system, but both vcpu init functions run on core 1, this will break, right?

Quoted 2 lines

Since kvm booke doesn't support more than 1 core virtualization. Can we put a comment here for now?

Sure. I'll need to do something clever about it on Book3S as well anyways.

Also, do you really need to set vcpu_id? If you just don't touch it it'll be 0. Shouldn't that be enough if you're only running a single guest core?

Alex