All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/book3s64/radix/tlb: Determine hugepage flush correctly
@ 2020-05-13  3:06 Aneesh Kumar K.V
  2020-05-13  4:30 ` Nicholas Piggin
  2020-06-09  5:28 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2020-05-13  3:06 UTC (permalink / raw)
  To: linuxppc-dev, mpe; +Cc: Aneesh Kumar K.V, npiggin, Bharata B Rao

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@linux.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-09  5:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13  3:06 [PATCH] powerpc/book3s64/radix/tlb: Determine hugepage flush correctly Aneesh Kumar K.V
2020-05-13  4:30 ` Nicholas Piggin
2020-05-18  6:34   ` Michael Ellerman
2020-06-09  5:28 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.