From: "tip-bot2 for Arnd Bergmann" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Thomas Gleixner <tglx@linutronix.de>,
Anders Roxell <anders.roxell@linaro.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/vdso] vdso: Change PAGE_MASK to signed on all 32-bit architectures
Date: Mon, 28 Oct 2024 17:13:34 -0000 [thread overview]
Message-ID: <173013561467.1442.5521979410105153215.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20241024133447.3117273-1-arnd@kernel.org>
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: d4a65302dd849fade9e2ca712826c35b8d068ecb
Gitweb: https://git.kernel.org/tip/d4a65302dd849fade9e2ca712826c35b8d068ecb
Author: Arnd Bergmann <arnd@arndb.de>
AuthorDate: Thu, 24 Oct 2024 13:34:26
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 28 Oct 2024 16:56:15 +01:00
vdso: Change PAGE_MASK to signed on all 32-bit architectures
With the introduction of an architecture-independent defintion of
PAGE_MASK, we had to make a choice between defining it as 'unsigned long'
as on 64-bit architectures, or as signed 'long' as required for
architectures with a 64-bit phys_addr_t.
To reduce the risk for regressions and minimize the changes in behavior,
the result was using the signed value only when CONFIG_PHYS_ADDR_T_64BIT
is set, but that ended up causing a regression after all in the
early_init_dt_add_memory_arch() function that uses 64-bit integers for
address calculation.
Presumably the same regression also affects mips32 and powerpc32 when
dealing with large amounts of memory on DT platforms: like arm32, they were
using the signed version unconditionally.
The two most sensible options for addressing the regression are either to
go back to an architecture specific definition, using a signed constant on
arm/powerpc/mips and unsigned on the others, or to use the same definition
everywhere.
Use the simpler of those two and change them all to the signed version, in
the hope that this does not cause a different type of bug. Most of the
other 32-bit architectures have no large physical address support and are
rarely used, so it seems more likely that using the same definition helps
than hurts here.
In particular, x86-32 does have physical addressing extensions, so it
already changed to the signed version after the previous patch, so it makes
sense to use the same version on non-PAE as well.
Fixes: efe8419ae78d ("vdso: Introduce vdso/page.h")
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/all/20241024133447.3117273-1-arnd@kernel.org
Link: https://lore.kernel.org/lkml/CA+G9fYt86bUAu_v5dXPWnDUwQNVipj+Wq3Djir1KUSKdr9QLNg@mail.gmail.com/
---
include/vdso/page.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/vdso/page.h b/include/vdso/page.h
index 4ada1ba..710ae24 100644
--- a/include/vdso/page.h
+++ b/include/vdso/page.h
@@ -14,13 +14,14 @@
#define PAGE_SIZE (_AC(1,UL) << CONFIG_PAGE_SHIFT)
-#if defined(CONFIG_PHYS_ADDR_T_64BIT) && !defined(CONFIG_64BIT)
+#if !defined(CONFIG_64BIT)
/*
- * Applies only to 32-bit architectures with a 64-bit phys_addr_t.
+ * Applies only to 32-bit architectures.
*
* Subtle: (1 << CONFIG_PAGE_SHIFT) is an int, not an unsigned long.
* So if we assign PAGE_MASK to a larger type it gets extended the
- * way we want (i.e. with 1s in the high bits)
+ * way we want (i.e. with 1s in the high bits) while masking a
+ * 64-bit value such as phys_addr_t.
*/
#define PAGE_MASK (~((1 << CONFIG_PAGE_SHIFT) - 1))
#else
prev parent reply other threads:[~2024-10-28 17:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 13:34 [PATCH] vdso: change " Arnd Bergmann
2024-10-28 13:29 ` Vincenzo Frascino
2024-10-28 17:13 ` tip-bot2 for Arnd Bergmann [this message]
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=173013561467.1442.5521979410105153215.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=anders.roxell@linaro.org \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=naresh.kamboju@linaro.org \
--cc=tglx@linutronix.de \
--cc=vincenzo.frascino@arm.com \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®