Commit 030e3474 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/32s: Don't flush all TLBs when flushing one page

When flushing any memory range, the flushing function
flushes all TLBs.

When (start) and (end - 1) are in the same memory page,
flush that page instead.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b30b2eae6960502eaf0d9e36c60820b839693c33.1580542939.git.christophe.leroy@c-s.fr
parent d8e73458
...@@ -79,11 +79,14 @@ static void flush_range(struct mm_struct *mm, unsigned long start, ...@@ -79,11 +79,14 @@ static void flush_range(struct mm_struct *mm, unsigned long start,
int count; int count;
unsigned int ctx = mm->context.id; unsigned int ctx = mm->context.id;
start &= PAGE_MASK;
if (!Hash) { if (!Hash) {
_tlbia(); if (end - start <= PAGE_SIZE)
_tlbie(start);
else
_tlbia();
return; return;
} }
start &= PAGE_MASK;
if (start >= end) if (start >= end)
return; return;
end = (end - 1) | ~PAGE_MASK; end = (end - 1) | ~PAGE_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment