Re: [PATCH] x86/mm: Fix flush_tlb_range() when used for zapping normal PMDs

From: Rik van Riel
Date: Fri Jan 03 2025 - 16:56:01 EST


On Fri, 2025-01-03 at 19:39 +0100, Jann Horn wrote:
> 02fc2aa06e9e0ecdba3fe948cafe5892b72e86c0..3da645139748538daac70166618d
> 8ad95116eb74 100644
> --- a/arch/x86/include/asm/tlbflush.h
> +++ b/arch/x86/include/asm/tlbflush.h
> @@ -242,7 +242,7 @@ void flush_tlb_multi(const struct cpumask
> *cpumask,
>   flush_tlb_mm_range((vma)->vm_mm, start,
> end, \
>      ((vma)->vm_flags &
> VM_HUGETLB) \
>   ?
> huge_page_shift(hstate_vma(vma)) \
> - : PAGE_SHIFT, false)
> + : PAGE_SHIFT, true)
>  
>

The code looks good, but should this macro get
a comment indicating that code that only frees
pages, but not page tables, should be calling
flush_tlb() instead?

--
All Rights Reversed.