Re: [PATCH v2 3/6] alpha: describe the PTE read and write enable bits
From: Magnus Lindholm
Date: Thu Oct 08 2026 - 10:35:18 EST
Hi Matt,
On Thu, Oct 8, 2026 at 5:24 AM Matt Turner <mattst88@xxxxxxxxx> wrote:
>
> The comments on _PAGE_KRE and _PAGE_URE said only "xxx". Describe the
> four enable bits as the Alpha Linux PTE defines them, in Table 22-3 of
> the Alpha Architecture Reference Manual: kernel and user read enable in
> bits 8 and 9, kernel and user write enable in bits 12 and 13, with bits
> <11:10> and <15:14> reserved. There are only two processor modes, user
> and kernel (section 22.5.1). Linux uses the read enables as its accessed
> bit and the write enables as its dirty bit, so say which of
> __ACCESS_BITS and __DIRTY_BITS each one belongs to.
>
> The names differ from what the hardware calls those bits on the 21264.
> Its PALcode loads the PTE unchanged into DTB_PTE (21264/EV67 Hardware
> Reference Manual, section 6.9), where bits 9 and 13 are the Executive
> read and write enables (Figure 5-27), Executive being mode 1 of the four
> the processor implements (Table 5-5). That is a detail below the PALcode
> interface, and it is also the layout of the OpenVMS PTE in Table 11-2,
> which is not the one Linux uses.
>
> No functional change.
>
> Suggested-by: Magnus Lindholm <linmag7@xxxxxxxxx>
> Signed-off-by: Matt Turner <mattst88@xxxxxxxxx>
> ---
> arch/alpha/include/asm/pgtable.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h
> index 8a175e0c2b42..d22e28b956fb 100644
> --- a/arch/alpha/include/asm/pgtable.h
> +++ b/arch/alpha/include/asm/pgtable.h
> @@ -65,10 +65,10 @@ struct vm_area_struct;
> #define _PAGE_FOW 0x0004 /* used for page protection (fault on write) */
> #define _PAGE_FOE 0x0008 /* used for page protection (fault on exec) */
> #define _PAGE_ASM 0x0010
> -#define _PAGE_KRE 0x0100 /* xxx - see below on the "accessed" bit */
> -#define _PAGE_URE 0x0200 /* xxx */
> -#define _PAGE_KWE 0x1000 /* used to do the dirty bit in software */
> -#define _PAGE_UWE 0x2000 /* used to do the dirty bit in software */
> +#define _PAGE_KRE 0x0100 /* kernel read enable, in __ACCESS_BITS */
> +#define _PAGE_URE 0x0200 /* user read enable, in __ACCESS_BITS */
> +#define _PAGE_KWE 0x1000 /* kernel write enable, in __DIRTY_BITS */
> +#define _PAGE_UWE 0x2000 /* user write enable, in __DIRTY_BITS */
>
> /* .. and these are ours ... */
> #define _PAGE_DIRTY 0x20000
>
> --
> 2.55.0
>
Looks good to me.
Reviewed-by: Magnus Lindholm <linmag7@xxxxxxxxx>