Re: [PATCH] arm64/mm: Define PTE_SHIFT
From: Ard Biesheuvel
Date: Fri Mar 07 2025 - 06:16:53 EST
On Fri, 7 Mar 2025 at 10:21, Anshuman Khandual
<anshuman.khandual@xxxxxxx> wrote:
>
>
>
> On 3/7/25 14:37, Ryan Roberts wrote:
> > On 07/03/2025 05:08, Anshuman Khandual wrote:
> >> Address bytes shifted with a single 64 bit page table entry (any page table
> >> level) has been always hard coded as 3 (aka 2^3 = 8). Although intuitive it
> >> is not very readable or easy to reason about. Besides it is going to change
> >> with D128, where each 128 bit page table entry will shift address bytes by
> >> 4 (aka 2^4 = 16) instead.
> >>
> >> Let's just formalise this address bytes shift value into a new macro called
> >> PTE_SHIFT establishing a logical abstraction, thus improving readability as
> >> well. This does not cause any functional change.
> >>
> >> Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
> >> Cc: Will Deacon <will@xxxxxxxxxx>
> >> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> >> Cc: Andrey Ryabinin <ryabinin.a.a@xxxxxxxxx>
> >> Cc: Alexander Potapenko <glider@xxxxxxxxxx>
> >> Cc: Andrey Konovalov <andreyknvl@xxxxxxxxx>
> >> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx>
> >> Cc: Ard Biesheuvel <ardb@xxxxxxxxxx>
> >> Cc: Ryan Roberts <ryan.roberts@xxxxxxx>
> >> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> >> Cc: linux-kernel@xxxxxxxxxxxxxxx
> >> Cc: kasan-dev@xxxxxxxxxxxxxxxx
> >> Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
> >
> >
> > +1 for PTDESC_ORDER
>
> Alright.
>
Agreed.
> >
> > Implementation looks good to me so:
> >
> > Reviewed-by: Ryan Roberts <ryan.roberts@xxxxxxx>
>
With PTDESC_ORDER used throughout,
Acked-by: Ard Biesheuvel <ardb@xxxxxxxxxx>