Skip to content

Commit 97cf301

Browse files
Alexandre Ghitipalmer-dabbelt
authored andcommitted
riscv: Flush the tlb when a page directory is freed
The riscv privileged specification mandates to flush the TLB whenever a page directory is modified, so add that to tlb_flush(). Fixes: c5e9b2c ("riscv: Improve tlb_flush()") Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Charlie Jenkins <charlie@rivosinc.com> Link: https://lore.kernel.org/r/20240128120405.25876-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 168b849 commit 97cf301

File tree

1 file changed

+1
-1
lines changed
  • arch/riscv/include/asm

1 file changed

+1
-1
lines changed

arch/riscv/include/asm/tlb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static void tlb_flush(struct mmu_gather *tlb);
1616
static inline void tlb_flush(struct mmu_gather *tlb)
1717
{
1818
#ifdef CONFIG_MMU
19-
if (tlb->fullmm || tlb->need_flush_all)
19+
if (tlb->fullmm || tlb->need_flush_all || tlb->freed_tables)
2020
flush_tlb_mm(tlb->mm);
2121
else
2222
flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end,

0 commit comments

Comments
 (0)