Skip to contentSkip to conversation

KVM: PPC: Book3S HV: Make sure to load LPID for radix VCPUs

PATCH In review Paul Mackerras 2 participants 2 messages May 13, 2019 – May 14, 2019

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

PATCH 1/1 KVM: PPC: Book3S HV: Make sure to load LPID for radix VCPUs

Commit 70ea13f6e609 ("KVM: PPC: Book3S HV: Flush TLB on secondary radix threads", 2019-04-29) aimed to make radix guests that are using the real-mode entry path load the LPID register and flush the TLB in the same place where those things are done for HPT guests. However, it omitted to remove a branch which branches around that code for radix guests. The result is that with indep_thread_mode = N, radix guests don't run correctly. (With indep_threads_mode = Y, which is the default, radix guests use a different entry path.)

This removes the offending branch, and also the load and compare that the branch depends on, since the cr7 setting is now unused.

Fixes 70ea13f6e609 ("KVM: PPC: Book3S HV: Flush TLB on secondary radix threads")
---
 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 ------
 1 file changed, 6 deletions(-)
arch/powerpc/kvm/book3s_hv_rmhandlers.S +0 -6
index ad1fc01..ad7bee9 100644
@@ -581,11 +581,8 @@ kvmppc_hv_entry:
 1:
 #endif
 
-	/* Use cr7 as an indication of radix mode */
 	ld	r5, HSTATE_KVM_VCORE(r13)
 	ld	r9, VCORE_KVM(r5)	/* pointer to struct kvm */
-	lbz	r0, KVM_RADIX(r9)
-	cmpwi	cr7, r0, 0
 
 	/*
 	 * POWER7/POWER8 host -> guest partition switch code.
@@ -608,9 +605,6 @@ kvmppc_hv_entry:
 	cmpwi	r6,0
 	bne	10f
 
-	/* Radix has already switched LPID and flushed core TLB */
-	bne	cr7, 22f
-
 	lwz	r7,KVM_LPID(r9)
 BEGIN_FTR_SECTION
 	ld	r6,KVM_SDR1(r9)
Signature · 1 line
2.7.4
Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines · Paul Mackerras

Commit 70ea13f6e609 ("KVM: PPC: Book3S HV: Flush TLB on secondary radix
threads", 2019-04-29) aimed to make radix guests that are using the real-mode entry path load the LPID register and flush the TLB in the same place where those things are done for HPT guests. However, it omitted to remove a branch which branches around that code for radix guests. The result is that with indep_thread_mode = N, radix guests don't run correctly. (With indep_threads_mode = Y, which is the default, radix guests use a different entry path.)

Quoted 7 lines

This removes the offending branch, and also the load and compare that the branch depends on, since the cr7 setting is now unused.

Fixes 70ea13f6e609 ("KVM: PPC: Book3S HV: Flush TLB on secondary

radix threads")

Quoted 32 lines
---
 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 ------
 1 file changed, 6 deletions(-)
arch/powerpc/kvm/book3s_hv_rmhandlers.S +0 -3
index ad1fc01..ad7bee9 100644
@@ -581,11 +581,8 @@ kvmppc_hv_entry:
 1:
 #endif
 
-	/* Use cr7 as an indication of radix mode */
 	ld	r5, HSTATE_KVM_VCORE(r13)
 	ld	r9, VCORE_KVM(r5)	/* pointer to struct kvm
 */
-	lbz	r0, KVM_RADIX(r9)
-	cmpwi	cr7, r0, 0
 
 	/*
arch/powerpc/kvm/book3s_hv_rmhandlers.S +0 -3
 	 * POWER7/POWER8 host -> guest partition switch code.
@@ -608,9 +605,6 @@ kvmppc_hv_entry:
 	cmpwi	r6,0
 	bne	10f
 
-	/* Radix has already switched LPID and flushed core TLB */
-	bne	cr7, 22f
-
 	lwz	r7,KVM_LPID(r9)
 BEGIN_FTR_SECTION
 	ld	r6,KVM_SDR1(r9)