Skip to contentSkip to conversation

Use arch.pid as shadow pid for E500

PATCH In review Liu Yu 2 participants 4 messages Dec 11, 2008 – Dec 12, 2008 PowerPC

lore
Share & tools
lore

Liu Yu

author
#0 lore raw

PATCH 3/11 Use arch.pid as shadow pid for E500

---
 arch/powerpc/kernel/asm-offsets.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
arch/powerpc/kernel/asm-offsets.c +7 -1
index 544a27f..79fe94c 100644
@@ -355,6 +355,13 @@ int main(void)
 	DEFINE(PTE_SIZE, sizeof(pte_t));
 
 #ifdef CONFIG_KVM
+#ifdef CONFIG_44x
+	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, arch.shadow_pid));
+#endif
+#ifdef CONFIG_FSL_BOOKE
+	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, arch.pid));
+#endif
+
 	DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack));
 	DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid));
 	DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr));
@@ -368,7 +375,6 @@ int main(void)
 	DEFINE(VCPU_SPRG5, offsetof(struct kvm_vcpu, arch.sprg5));
 	DEFINE(VCPU_SPRG6, offsetof(struct kvm_vcpu, arch.sprg6));
 	DEFINE(VCPU_SPRG7, offsetof(struct kvm_vcpu, arch.sprg7));
-	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, arch.shadow_pid));
 
 	DEFINE(VCPU_LAST_INST, offsetof(struct kvm_vcpu, arch.last_inst));
 	DEFINE(VCPU_FAULT_DEAR, offsetof(struct kvm_vcpu, arch.fault_dear));
Signature · 1 line
1.5.4
#1 lore raw
Quoted 24 lines · Liu Yu
---
 arch/powerpc/kernel/asm-offsets.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
arch/powerpc/kernel/asm-offsets.c +7 -0
index 544a27f..79fe94c 100644
@@ -355,6 +355,13 @@ int main(void)
 	DEFINE(PTE_SIZE, sizeof(pte_t));
 
 #ifdef CONFIG_KVM
+#ifdef CONFIG_44x
+	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, arch.shadow_pid));
+#endif
+#ifdef CONFIG_FSL_BOOKE
+	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, arch.pid));
+#endif
+
 	DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack));
 	DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid));
 	DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr));

arch/powerpc/kernel/asm-offsets.c int main(void) · line 380

Quoted 7 lines
arch/powerpc/kernel/asm-offsets.c +0 -1
@@ -368,7 +375,6 @@ int main(void)
 	DEFINE(VCPU_SPRG5, offsetof(struct kvm_vcpu, arch.sprg5));
 	DEFINE(VCPU_SPRG6, offsetof(struct kvm_vcpu, arch.sprg6));
 	DEFINE(VCPU_SPRG7, offsetof(struct kvm_vcpu, arch.sprg7));
-	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, arch.shadow_pid));
 
 	DEFINE(VCPU_LAST_INST, offsetof(struct kvm_vcpu, arch.last_inst));
 	DEFINE(VCPU_FAULT_DEAR, offsetof(struct kvm_vcpu, arch.fault_dear));

I can commit this, but we got a significant performance boost from implementing the shadow_pid scheme. Do you think implementing that would be difficult?

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
author
#2 lore raw
In reply to Liu Yu
Quoted 44 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hollis Blanchard
Sent: Friday, December 12, 2008 5:02 AM
To: Liu Yu-B13201
Cc: [email protected]
Subject: Re: [PATCH 03/11] Use arch.pid as shadow pid for E500

Review

Quoted 6 lines · Liu Yu
---
 arch/powerpc/kernel/asm-offsets.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/arch/powerpc/kernel/asm-offsets.c

arch/powerpc/kernel/asm-offsets.c int main(void) · line 359

Quoted 9 lines

index 544a27f..79fe94c 100644

arch/powerpc/kernel/asm-offsets.c +2 -0
@@ -355,6 +355,13 @@ int main(void)
 	DEFINE(PTE_SIZE, sizeof(pte_t));
 
 #ifdef CONFIG_KVM
+#ifdef CONFIG_44x
+	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, 

arch.shadow_pid));

arch/powerpc/kernel/asm-offsets.c int main(void)

Quoted 6 lines
arch/powerpc/kernel/asm-offsets.c +5 -0
+#endif
+#ifdef CONFIG_FSL_BOOKE
+	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, arch.pid));
+#endif
+
 	DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, 

arch.host_stack));

arch/powerpc/kernel/asm-offsets.c int main(void) · line 371

Quoted 7 lines
arch/powerpc/kernel/asm-offsets.c +0 -1
 	DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid));
 	DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr));
@@ -368,7 +375,6 @@ int main(void)
 	DEFINE(VCPU_SPRG5, offsetof(struct kvm_vcpu, arch.sprg5));
 	DEFINE(VCPU_SPRG6, offsetof(struct kvm_vcpu, arch.sprg6));
 	DEFINE(VCPU_SPRG7, offsetof(struct kvm_vcpu, arch.sprg7));
-	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, 

arch.shadow_pid));

arch/powerpc/kernel/asm-offsets.c int main(void) · line 378

Quoted 2 lines
arch/powerpc/kernel/asm-offsets.c +0 -0
 	DEFINE(VCPU_LAST_INST, offsetof(struct kvm_vcpu, 
Quoted 9 lines

arch.last_inst));

arch/powerpc/kernel/asm-offsets.c int main(void) · line 379

Quoted 1 line
arch/powerpc/kernel/asm-offsets.c +0 -0
 	DEFINE(VCPU_FAULT_DEAR, offsetof(struct kvm_vcpu, 

arch.fault_dear));

I can commit this, but we got a significant performance boost from implementing the shadow_pid scheme. Do you think implementing that would
be difficult?

Not difficult.
But I want to compare it with some other ways before apply it.

As you know, E500 has a large TLB0, so it has more room to handle multi-VMs on a single core.
Current shadow pid trick indeed boost performance in the case of one VM, but for multi-VMs, your pid mapping idea seems better for E500.

author
#3 lore raw
In reply to Liu Yu
Quoted 62 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Liu Yu-B13201
Sent: Friday, December 12, 2008 10:21 AM
To: Hollis Blanchard
Cc: [email protected]
Subject: RE: [PATCH 03/11] Use arch.pid as shadow pid for E500

Quoted 43 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Hollis Blanchard
Sent: Friday, December 12, 2008 5:02 AM
To: Liu Yu-B13201
Cc: [email protected]
Subject: Re: [PATCH 03/11] Use arch.pid as shadow pid for E500

Review

Quoted 6 lines · Liu Yu
---
 arch/powerpc/kernel/asm-offsets.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/arch/powerpc/kernel/asm-offsets.c

arch/powerpc/kernel/asm-offsets.c int main(void) · line 359

Quoted 9 lines

index 544a27f..79fe94c 100644

arch/powerpc/kernel/asm-offsets.c +2 -0
@@ -355,6 +355,13 @@ int main(void)
 	DEFINE(PTE_SIZE, sizeof(pte_t));
 
 #ifdef CONFIG_KVM
+#ifdef CONFIG_44x
+	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, 

arch.shadow_pid));

arch/powerpc/kernel/asm-offsets.c int main(void)

Quoted 6 lines
arch/powerpc/kernel/asm-offsets.c +5 -0
+#endif
+#ifdef CONFIG_FSL_BOOKE
+	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, arch.pid));
+#endif
+
 	DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, 

arch.host_stack));

arch/powerpc/kernel/asm-offsets.c int main(void) · line 371

Quoted 7 lines
arch/powerpc/kernel/asm-offsets.c +0 -1
 	DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid));
 	DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr));
@@ -368,7 +375,6 @@ int main(void)
 	DEFINE(VCPU_SPRG5, offsetof(struct kvm_vcpu, arch.sprg5));
 	DEFINE(VCPU_SPRG6, offsetof(struct kvm_vcpu, arch.sprg6));
 	DEFINE(VCPU_SPRG7, offsetof(struct kvm_vcpu, arch.sprg7));
-	DEFINE(VCPU_SHADOW_PID, offsetof(struct kvm_vcpu, 

arch.shadow_pid));

arch/powerpc/kernel/asm-offsets.c int main(void) · line 378

Quoted 2 lines
arch/powerpc/kernel/asm-offsets.c +0 -0
 	DEFINE(VCPU_LAST_INST, offsetof(struct kvm_vcpu, 
Quoted 9 lines

arch.last_inst));

arch/powerpc/kernel/asm-offsets.c int main(void) · line 379

Quoted 1 line
arch/powerpc/kernel/asm-offsets.c +0 -0
 	DEFINE(VCPU_FAULT_DEAR, offsetof(struct kvm_vcpu, 

arch.fault_dear));

I can commit this, but we got a significant performance boost from implementing the shadow_pid scheme. Do you think implementing that would
be difficult?

Quoted 8 lines

Not difficult.
But I want to compare it with some other ways before apply it.

As you know, E500 has a large TLB0, so it has more room to handle multi-VMs on a single core.
Current shadow pid trick indeed boost performance in the case of one VM,
but for multi-VMs, your pid mapping idea seems better for E500.

I can use arch.shadow_pid, however I will keep arch.shadow_pid equal to arch.pid.
What do you think?