lkml.org 
[lkml]   [2024]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [External] [PATCH -fixes] riscv: Flush the tlb when a page directory is freed
Hi Alexandre,

On Sun, Jan 28, 2024 at 8:04 PM Alexandre Ghiti <alexghiti@rivosinccom> wrote:
>
> The riscv privileged specification mandates to flush the TLB whenever a
> page directory is modified, so add that to tlb_flush().
>
> Fixes: c5e9b2c2ae82 ("riscv: Improve tlb_flush()")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
> arch/riscv/include/asm/tlb.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/include/asm/tlb.h b/arch/riscv/include/asm/tlb.h
> index 1eb5682b2af6..50b63b5c15bd 100644
> --- a/arch/riscv/include/asm/tlb.h
> +++ b/arch/riscv/include/asm/tlb.h
> @@ -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);

Why is it necessary to flush all TLB entries of the process?

Thanks,
Yunhui

\
 
 \ /
  Last update: 2024-05-27 14:37    [W:0.061 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site