[PATCH 1/1] alpha: Fix pte_swp_exclusive on alpha

From: Magnus Lindholm
Date: Sun Feb 16 2025 - 12:08:42 EST


Function pte_swp_exclusive() checks if _PAGE_SWP_EXCLUSIVE bit is set in
PTE but returns lower 32-bits only. Shift bits right by 32 to return upper
32-bits of PTE which contain the _PAGE_SWP_EXCLUSIVE bit. On alpha this is
bit 39 but on most other architectures this bit already resides somewhere
in the first 32-bits and hence a shift is not necessary on those archs.

---
arch/alpha/include/asm/pgtable.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h
index 02e8817a8921..a96d652629fd 100644
--- a/arch/alpha/include/asm/pgtable.h
+++ b/arch/alpha/include/asm/pgtable.h
@@ -336,7 +336,7 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)

static inline int pte_swp_exclusive(pte_t pte)
{
- return pte_val(pte) & _PAGE_SWP_EXCLUSIVE;
+ return (pte_val(pte) & _PAGE_SWP_EXCLUSIVE)>>32;
}

static inline pte_t pte_swp_mkexclusive(pte_t pte)
--
2.48.1