lkml.org 
[lkml]   [2023]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH -fixes] mm: Add a call to flush_cache_vmap() in vmap_pfn()
Hi Andrew,

On Wed, Aug 9, 2023 at 8:46 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Wed, 9 Aug 2023 18:46:33 +0200 Alexandre Ghiti <alexghiti@rivosinc.com> wrote:
>
> > flush_cache_vmap() must be called after new vmalloc mappings are
> > installed in the page table in order to allow architectures to make sure
> > the new mapping is visible.
>
> Thanks. What are the user-visible effects of this bug?

It could lead to a panic since on some architectures (like powerpc),
the page table walker could see the wrong pte value and trigger a
spurious page fault that can not be resolved (see commit f1cb8f9beba8
("powerpc/64s/radix: avoid ptesync after set_pte and
ptep_set_access_flags")).

But actually the patch is aiming at riscv: the riscv specification
allows the caching of invalid entries in the TLB, and since we
recently removed the vmalloc page fault handling, we now need to emit
a tlb shootdown whenever a new vmalloc mapping is emitted
(https://lore.kernel.org/linux-riscv/20230725132246.817726-1-alexghiti@rivosinc.com/).
That's a temporary solution, there are ways to avoid that :)

Thanks,

Alex

\
 
 \ /
  Last update: 2023-08-10 09:16    [W:0.114 / U:0.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site