[PATCH] powerpc/book3s64/radix/tlb: Determine hugepage flush correctly

Aneesh Kumar K.V aneesh.kumar at linux.ibm.com
Wed May 13 13:06:16 AEST 2020


With a 64K page size flush with start and end value as below
(start, end) = (721f680d0000, 721f680e0000) results in
(hstart, hend) = (721f68200000, 721f68000000)

Avoid doing a __tlbie_va_range with the wrong hstart and hend value in this
case.

__tlbie_va_range will skip the actual tlbie operation for start > end.
But we still end up doing the tlbie fixup.

Reported-by: Bharata B Rao <bharata at linux.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.ibm.com>
---
 arch/powerpc/mm/book3s64/radix_tlb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/mm/book3s64/radix_tlb.c b/arch/powerpc/mm/book3s64/radix_tlb.c
index 758ade2c2b6e..d592f9e1c037 100644
--- a/arch/powerpc/mm/book3s64/radix_tlb.c
+++ b/arch/powerpc/mm/book3s64/radix_tlb.c
@@ -884,10 +884,10 @@ static inline void __radix__flush_tlb_range(struct mm_struct *mm,
 		if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) {
 			hstart = (start + PMD_SIZE - 1) & PMD_MASK;
 			hend = end & PMD_MASK;
-			if (hstart == hend)
-				hflush = false;
-			else
+			if (hstart < hend)
 				hflush = true;
+			else
+				hflush = false;
 		}
 
 		if (local) {
-- 
2.26.2



More information about the Linuxppc-dev mailing list