public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Magnus Lindholm <linmag7@gmail.com>
To: linmag7@gmail.com, richard.henderson@linaro.org,
	mattst88@gmail.com, glaubitz@physik.fu-berlin.de,
	ink@unseen.parts, kees@kernel.org, arnd@arndb.de,
	linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org
Subject: [PATCH 1/1] alpha: Fix pte_swp_exclusive on alpha
Date: Sun, 16 Feb 2025 18:04:53 +0100	[thread overview]
Message-ID: <20250216170748.2258-2-linmag7@gmail.com> (raw)
In-Reply-To: <20250216170748.2258-1-linmag7@gmail.com>

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


  reply	other threads:[~2025-02-16 17:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-16 17:04 [PATCH 0/1] alpha: Fix pte_swp_exclusive on alpha Magnus Lindholm
2025-02-16 17:04 ` Magnus Lindholm [this message]
2025-02-16 17:17   ` [PATCH 1/1] " Al Viro
2025-02-16 17:22     ` Al Viro
2025-02-16 17:26     ` Al Viro
2025-02-17 10:54     ` Magnus Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250216170748.2258-2-linmag7@gmail.com \
    --to=linmag7@gmail.com \
    --cc=arnd@arndb.de \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=ink@unseen.parts \
    --cc=kees@kernel.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox