[PATCH 1/2] ARM: ioremap: Flush PGDs for VMALLOC shadow
Linus Walleij
linus.walleij at linaro.org
Wed Oct 16 11:38:32 PDT 2024
On Wed, Oct 16, 2024 at 1:33 PM Ard Biesheuvel <ardb at kernel.org> wrote:
> > @@ -125,6 +126,12 @@ void __check_vmalloc_seq(struct mm_struct *mm)
(...)
> Then, there is another part to this: in arch/arm/kernel/traps.c, we
> have the following code
>
> void arch_sync_kernel_mappings(unsigned long start, unsigned long end)
> {
> if (start < VMALLOC_END && end > VMALLOC_START)
> atomic_inc_return_release(&init_mm.context.vmalloc_seq);
> }
>
> where we only bump vmalloc_seq if the updated region overlaps with the
> vmalloc region, so this will need a similar treatment afaict.
Not really, right? We bump init_mm.context.vmalloc_seq if the address
overlaps the entire vmalloc area.
Then the previously patched __check_vmalloc_seq() will check that
atomic counter and copy the PGD entries, and with the code in this
patch it will also copy (sync) the corresponding shadow memory
at that point.
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list