Re: [PATCH 0/5] x86/mm/pat: CPA fixes
From: Mike Rapoport
Date: Thu Aug 13 2026 - 04:53:46 EST
On Thu, Aug 13, 2026 at 05:55:44AM +0000, Nikunj A Dadhania wrote:
> On Fri, Aug 07, 2026 at 04:36:08PM +0100, Lorenzo Stoakes (ARM) wrote:
> > +static void poke_vmalloc_pages_safe(struct page **pages, void *addr,
> > + bool cross_page_boundary)
> > +{
> > + guard(mmap_read_lock)(&init_mm);
> > + poke_vmalloc_pages(pages, addr, cross_page_boundary);
> > +}
>
> Tested just the proposed patch from this email (without the rest of the
> CPA fixes series) on the 512-guest concurrent boot harness (details in
For this fix to actually fix anything, the patches that add locking of
mmap_lock to CPA are needed still.
> [1]) and still see the memcmp BUG, I havent hit the first BUG though:
>
> kernel BUG at arch/x86/kernel/alternative.c:2727!
> Oops: invalid opcode: 0000 [#1] SMP NOPTI
> CPU: 1 UID: 0 PID: 485 Comm: (udev-worker) Not tainted 7.2.0-rc5-pokesafe+ #42 PREEMPT(full)
> RIP: 0010:__text_poke.cold+0xdb/0x2af
>
> The instrumentation captured the following before the memcmp BUG:
>
> SMP alternatives: __text_poke: memcmp failed at addr=ffffffffc06ce1bb len=4
> SMP alternatives: __text_poke: expected (src): 2e 2e 31 c0
> SMP alternatives: __text_poke: found (dst): f9 b8 9b d3
> SMP alternatives: __text_poke: pfn at poke time (vmalloc_to_page): 8ece
> SMP alternatives: __text_poke: pfn at readback time (vmalloc_to_page): c6ce
> SMP alternatives: __text_poke: page table dump for addr:
> PGD 2f042067 P4D 2f043067 PUD 2f045067 PMD c6001a1
>
> pfn acquired at the start of __text_poke() (0x8ece) differs from pfn
> at readback time (0xc6ce) in the instrumentaion.
>
> [1] https://lore.kernel.org/all/20260812063316.21371-1-nikunj@xxxxxxx/
>
> Regards,
> Nikunj
--
Sincerely yours,
Mike.