Skip to contentSkip to conversation

KVM: PPC: Book3S: PR: Optimize entry path

PATCH New Alexander Graf 1 participant 2 messages Apr 25, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 KVM: PPC: Book3S: PR: Optimize entry path

By shuffling a few instructions around we can execute more memory loads in parallel, giving us a small performance boost.

With this patch and a simple priviledged SPR access loop guest, I get a speed bump from 2013052 to 2035607 exits per second.

---
 arch/powerpc/kvm/book3s_segment.S |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
arch/powerpc/kvm/book3s_segment.S +7 -6
index 64f9018..f34a070 100644
@@ -128,24 +128,25 @@ no_dcbz32_on:
 	/* First clear RI in our current MSR value */
 	li	r0, MSR_RI
 	andc	r6, r6, r0
-	MTMSR_EERI(r6)
-	mtsrr0	r9
-	mtsrr1	r4
 
 	PPC_LL	r0, SVCPU_R0(r3)
 	PPC_LL	r1, SVCPU_R1(r3)
 	PPC_LL	r2, SVCPU_R2(r3)
-	PPC_LL	r4, SVCPU_R4(r3)
 	PPC_LL	r5, SVCPU_R5(r3)
-	PPC_LL	r6, SVCPU_R6(r3)
 	PPC_LL	r7, SVCPU_R7(r3)
 	PPC_LL	r8, SVCPU_R8(r3)
-	PPC_LL	r9, SVCPU_R9(r3)
 	PPC_LL	r10, SVCPU_R10(r3)
 	PPC_LL	r11, SVCPU_R11(r3)
 	PPC_LL	r12, SVCPU_R12(r3)
 	PPC_LL	r13, SVCPU_R13(r3)
 
+	MTMSR_EERI(r6)
+	mtsrr0	r9
+	mtsrr1	r4
+
+	PPC_LL	r4, SVCPU_R4(r3)
+	PPC_LL	r6, SVCPU_R6(r3)
+	PPC_LL	r9, SVCPU_R9(r3)
 	PPC_LL	r3, (SVCPU_R3)(r3)
 
 	RFI
Signature · 1 line
1.6.0.2
#1 lore raw

PATCH 2/2 KVM: PPC: Book3S: PR: No isync in slbie path

While messing around with the SLBs we're running in real mode. The entry to guest space goes through rfid, which is context synchronizing, so there's no need to manually synchronize anything through isync.

With this patch and a simple priviledged SPR access loop guest, I get a speed bump from 2035607 to 2181301 exits per second.

---
 arch/powerpc/kvm/book3s_64_slb.S |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
arch/powerpc/kvm/book3s_64_slb.S +0 -2
index f2e6e48..56b983e 100644
@@ -90,8 +90,6 @@ slb_exit_skip_ ## num:
 	or      r10, r10, r12
 	slbie	r10
 
-	isync
-
 	/* Fill SLB with our shadow */
 
 	lbz	r12, SVCPU_SLB_MAX(r3)
Signature · 1 line
1.6.0.2