riscv: Fix wrong size passed to local_flush_tlb_range_asid()
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Tue, 23 Jan 2024 13:27:30 +0000 (14:27 +0100)
committerDennis Zhou <dennis@kernel.org>
Mon, 29 Jan 2024 08:53:19 +0000 (00:53 -0800)
local_flush_tlb_range_asid() takes the size as argument, not the end of
the range to flush, so fix this by computing the size from the end and
the start of the range.

Fixes: 7a92fc8b4d20 ("mm: Introduce flush_cache_vmap_early()")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
arch/riscv/mm/tlbflush.c

index 8d12b26f5ac37b659687981c2046f3d5b590753c..9619965f65018a54d85f5c0a2ed07178e4cf3155 100644 (file)
@@ -68,7 +68,7 @@ static inline void local_flush_tlb_range_asid(unsigned long start,
 
 void local_flush_tlb_kernel_range(unsigned long start, unsigned long end)
 {
-       local_flush_tlb_range_asid(start, end, PAGE_SIZE, FLUSH_TLB_NO_ASID);
+       local_flush_tlb_range_asid(start, end - start, PAGE_SIZE, FLUSH_TLB_NO_ASID);
 }
 
 static void __ipi_flush_tlb_all(void *info)