Skip to contentSkip to conversation

Remove duplicate setting of the B field in tlbie

RFC PATCH Superseded Balbir Singh 2 participants 3 messages Sep 13, 2016 – Sep 14, 2016

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Remove duplicate setting of the B field in tlbie

Remove duplicate setting of the the "B" field when doing a tlbie(l). In compute_tlbie_rb(), the "B" field is set again just before returning the rb value to be used for tlbie(l).

---
Quickly boot tested a VM with these changes in kvm with 64k as the page size for the guest.

 arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/include/asm/kvm_book3s_64.h +0 -1
index 88d17b4..63b6900 100644
@@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
 	/* This covers 14..54 bits of va*/
 	rb = (v & ~0x7fUL) << 16;		/* AVA field */
 
-	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
 	/*
 	 * AVA in v had cleared lower 23 bits. We need to derive
 	 * that from pteg index
Signature · 1 line
2.5.5
#1 lore raw
Quoted 17 lines · Balbir Singh

Remove duplicate setting of the the "B" field when doing a tlbie(l). In compute_tlbie_rb(), the "B" field is set again just before returning the rb value to be used for tlbie(l).

---
Quickly boot tested a VM with these changes in kvm with 64k as the page size for the guest.

 arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/include/asm/kvm_book3s_64.h +0 -0
index 88d17b4..63b6900 100644

arch/powerpc/include/asm/kvm_book3s_64.h static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r, · line 164

Quoted 7 lines
arch/powerpc/include/asm/kvm_book3s_64.h +0 -1
@@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
 	/* This covers 14..54 bits of va*/
 	rb = (v & ~0x7fUL) << 16;		/* AVA field */
 
-	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
 	/*
 	 * AVA in v had cleared lower 23 bits. We need to derive
 	 * that from pteg index

Can we keep this and remove the other. This is much easier to follow than

	rb |= (v >> 54) & 0x300;		/* B field */

-aneesh

#2 lore raw
Quoted 30 lines · Aneesh Kumar K.V
Quoted 17 lines · Balbir Singh

Remove duplicate setting of the the "B" field when doing a tlbie(l). In compute_tlbie_rb(), the "B" field is set again just before returning the rb value to be used for tlbie(l).

---
Quickly boot tested a VM with these changes in kvm with 64k as the page size for the guest.

 arch/powerpc/include/asm/kvm_book3s_64.h | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/include/asm/kvm_book3s_64.h +0 -0
index 88d17b4..63b6900 100644

arch/powerpc/include/asm/kvm_book3s_64.h static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r, · line 164

Quoted 7 lines
arch/powerpc/include/asm/kvm_book3s_64.h +0 -1
@@ -159,7 +159,6 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
 	/* This covers 14..54 bits of va*/
 	rb = (v & ~0x7fUL) << 16;		/* AVA field */
 
-	rb |= (v >> HPTE_V_SSIZE_SHIFT) << 8;	/*  B field */
 	/*
 	 * AVA in v had cleared lower 23 bits. We need to derive
 	 * that from pteg index

Can we keep this and remove the other. This is much easier to follow than

Quoted 2 lines
	rb |= (v >> 54) & 0x300;		/* B field */

OK, but I think for 64K page size

                rb &= ~((1ul << mmu_psize_defs[a_psize].shift) - 1);

ends up cleaning up the "B" field. That is why we've had the two "B" field settings.

Let me double check with some coffee.

Balbir Singh.