Skip to content

Commit

Permalink
RISC-V: Issue a tlb page flush if possible
Browse files Browse the repository at this point in the history
If tlbflush request is for page only, there is no need to do a
complete local tlb shootdown.

Just do a local tlb flush for the given address.

Signed-off-by: Atish Patra <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Paul Walmsley <[email protected]>
(cherry picked from commit 6efb16b)
Signed-off-by: Seth Forshee <[email protected]>
  • Loading branch information
atishp04 authored and Seth Forshee committed Mar 19, 2020
1 parent 05c2d02 commit d015c8a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/riscv/mm/tlbflush.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start,

if (cpumask_any_but(cmask, cpuid) >= nr_cpu_ids) {
/* local cpu is the only cpu present in cpumask */
local_flush_tlb_all();
if (size <= PAGE_SIZE)
local_flush_tlb_page(start);
else
local_flush_tlb_all();
} else {
riscv_cpuid_to_hartid_mask(cmask, &hmask);
sbi_remote_sfence_vma(cpumask_bits(&hmask), start, size);
Expand Down

0 comments on commit d015c8a

Please sign in to comment.