Skip to content

Commit

Permalink
riscv: Flush the tlb when a page directory is freed
Browse files Browse the repository at this point in the history
[ Upstream commit 97cf301 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Alexandre Ghiti authored and gregkh committed Feb 16, 2024
1 parent 412dc60 commit d3607ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/riscv/include/asm/tlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static void tlb_flush(struct mmu_gather *tlb);
static inline void tlb_flush(struct mmu_gather *tlb)
{
#ifdef CONFIG_MMU
if (tlb->fullmm || tlb->need_flush_all)
if (tlb->fullmm || tlb->need_flush_all || tlb->freed_tables)
flush_tlb_mm(tlb->mm);
else
flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end,
Expand Down

0 comments on commit d3607ac

Please sign in to comment.