Re: [PATCH] arm64: mm: refresh stale pmd snapshot after split_contpmd()
From: David Hildenbrand (Arm)
Date: Fri Jun 26 2026 - 12:03:53 EST
On 6/26/26 15:03, Dev Jain wrote:
>
>
> On 25/06/26 5:09 pm, lirongqing wrote:
>> From: Li RongQing <lirongqing@xxxxxxxxx>
>>
>> split_contpmd() modifies the pmd entries in-place by clearing the CONT
>> bit, but the local 'pmd' variable still holds the old snapshot with CONT
>> set. The subsequent split_pmd() call uses this stale value to derive the
>> pgprot for the new PTE entries via pmd_pgprot(), causing the resulting
>> PTEs to be populated with incorrect protection bits.
>
> Since the block was CONTPMD, it means the pgprot was uniform on that block,
> so after splitting, it should be safe to derive the pgprot from individual pmd's
> right?
I'm also confused by that, can we get some details why (and how) the cont bit
misguides pmd_pgprot?
--
Cheers,
David