* [PATCH] alpha: Add ARCH_HAS_PTE_SPECIAL support
@ 2026-04-03 15:00 Matt Turner
2026-04-04 1:36 ` Michael Cree
0 siblings, 1 reply; 2+ messages in thread
From: Matt Turner @ 2026-04-03 15:00 UTC (permalink / raw)
To: Magnus Lindholm; +Cc: linux-alpha, linux-kernel, Matt Turner
Add _PAGE_SPECIAL using bit 19 (0x80000), which is unused in the Alpha
PTE layout. This enables pte_special()/pte_mkspecial() for marking PTEs
that are not backed by struct page (VDSO mappings, zero page,
io_remap_pfn_range, etc.).
Include _PAGE_SPECIAL in _PAGE_CHG_MASK so it is preserved across
pte_modify() calls.
Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
arch/alpha/Kconfig | 1 +
arch/alpha/include/asm/pgtable.h | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git ./arch/alpha/Kconfig ./arch/alpha/Kconfig
index a5feb98cc088..a29788e588ee 100644
--- ./arch/alpha/Kconfig
+++ ./arch/alpha/Kconfig
@@ -8,6 +8,7 @@ config ALPHA
select ARCH_HAS_FAST_MULTIPLIER
select ARCH_HAS_GCOV_PROFILE_ALL
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
+ select ARCH_HAS_PTE_SPECIAL
select ARCH_HAS_UBSAN
select ARCH_MIGHT_HAVE_PC_PARPORT
select ARCH_MIGHT_HAVE_PC_SERIO
diff --git ./arch/alpha/include/asm/pgtable.h ./arch/alpha/include/asm/pgtable.h
index 849abe2a1f98..832f29340ec6 100644
--- ./arch/alpha/include/asm/pgtable.h
+++ ./arch/alpha/include/asm/pgtable.h
@@ -73,6 +73,7 @@ struct vm_area_struct;
/* .. and these are ours ... */
#define _PAGE_DIRTY 0x20000
#define _PAGE_ACCESSED 0x40000
+#define _PAGE_SPECIAL 0x80000
/* We borrow bit 39 to store the exclusive marker in swap PTEs. */
#define _PAGE_SWP_EXCLUSIVE 0x8000000000UL
@@ -94,7 +95,7 @@ struct vm_area_struct;
#define _PFN_MASK 0xFFFFFFFF00000000UL
#define _PAGE_TABLE (_PAGE_VALID | __DIRTY_BITS | __ACCESS_BITS)
-#define _PAGE_CHG_MASK (_PFN_MASK | __DIRTY_BITS | __ACCESS_BITS)
+#define _PAGE_CHG_MASK (_PFN_MASK | __DIRTY_BITS | __ACCESS_BITS | _PAGE_SPECIAL)
/*
* All the normal masks have the "page accessed" bits on, as any time they are used,
@@ -260,6 +261,8 @@ extern inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~(__ACCESS_BITS); ret
extern inline pte_t pte_mkwrite_novma(pte_t pte){ pte_val(pte) &= ~_PAGE_FOW; return pte; }
extern inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= __DIRTY_BITS; return pte; }
extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; return pte; }
+extern inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; }
+extern inline pte_t pte_mkspecial(pte_t pte) { pte_val(pte) |= _PAGE_SPECIAL; return pte; }
/*
* The smp_rmb() in the following functions are required to order the load of
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] alpha: Add ARCH_HAS_PTE_SPECIAL support
2026-04-03 15:00 [PATCH] alpha: Add ARCH_HAS_PTE_SPECIAL support Matt Turner
@ 2026-04-04 1:36 ` Michael Cree
0 siblings, 0 replies; 2+ messages in thread
From: Michael Cree @ 2026-04-04 1:36 UTC (permalink / raw)
To: Matt Turner; +Cc: Magnus Lindholm, linux-alpha, linux-kernel
Hi Matt,
On Fri, Apr 03, 2026 at 11:00:48AM -0400, Matt Turner wrote:
> Add _PAGE_SPECIAL using bit 19 (0x80000), which is unused in the Alpha
> PTE layout. This enables pte_special()/pte_mkspecial() for marking PTEs
> that are not backed by struct page (VDSO mappings, zero page,
> io_remap_pfn_range, etc.).
>
> Include _PAGE_SPECIAL in _PAGE_CHG_MASK so it is preserved across
> pte_modify() calls.
>
> Assisted-by: Claude:claude-opus-4-6
> Signed-off-by: Matt Turner <mattst88@gmail.com>
> ---
> arch/alpha/Kconfig | 1 +
> arch/alpha/include/asm/pgtable.h | 5 ++++-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git ./arch/alpha/Kconfig ./arch/alpha/Kconfig
> index a5feb98cc088..a29788e588ee 100644
> --- ./arch/alpha/Kconfig
> +++ ./arch/alpha/Kconfig
> @@ -8,6 +8,7 @@ config ALPHA
> select ARCH_HAS_FAST_MULTIPLIER
> select ARCH_HAS_GCOV_PROFILE_ALL
> select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
> + select ARCH_HAS_PTE_SPECIAL
> select ARCH_HAS_UBSAN
> select ARCH_MIGHT_HAVE_PC_PARPORT
> select ARCH_MIGHT_HAVE_PC_SERIO
On what kernel does this patch apply? My master branch has none of:
ARCH_HAS_FAST_MULTIPLIER
ARCH_HAS_GCOV_PROFILE_ALL
ARCH_HAS_UBSAN
and they don't seem to be added at all in the other patches you sent.
Cheers,
Michael.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-04 1:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-03 15:00 [PATCH] alpha: Add ARCH_HAS_PTE_SPECIAL support Matt Turner
2026-04-04 1:36 ` Michael Cree
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox