From: Vasily Gorbik <gor@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
Subject: [PATCH 1/3] s390/boot: Fix physical memory search range
Date: Thu, 27 Aug 2026 14:01:28 +0200 [thread overview]
Message-ID: <p01-03.g46f7a6bfbc01.ttkffvj@ub.hpns> (raw)
In-Reply-To: <c00-03.ttkffvj@ub.hpns>
search_mem_end() calculates the number of 1MB blocks with a signed int
literal. CONFIG_MAX_PHYSMEM_BITS values of 51 and above either overflow
the signed int or shift beyond its width. This produces an invalid search
range when the binary-search memory detection fallback is used.
Use an unsigned long literal so the full supported physical address range
is represented.
Fixes: 4d14c2666b6b ("s390/mem_detect: replace tprot loop with binary search")
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
---
arch/s390/boot/physmem_info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/boot/physmem_info.c b/arch/s390/boot/physmem_info.c
index 1f2ca5435838..0ebb2174713f 100644
--- a/arch/s390/boot/physmem_info.c
+++ b/arch/s390/boot/physmem_info.c
@@ -141,7 +141,7 @@ static int tprot(unsigned long addr)
static unsigned long search_mem_end(void)
{
- unsigned long range = 1 << (MAX_PHYSMEM_BITS - 20); /* in 1MB blocks */
+ unsigned long range = 1UL << (MAX_PHYSMEM_BITS - 20); /* in 1MB blocks */
unsigned long offset = 0;
unsigned long pivot;
--
2.53.0
next prev parent reply other threads:[~2026-08-27 12:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 12:01 [PATCH 0/3] s390/boot: Fix couple of early boot edge cases Vasily Gorbik
2026-08-27 12:01 ` Vasily Gorbik [this message]
2026-08-27 12:06 ` [PATCH 1/3] s390/boot: Fix physical memory search range sashiko-bot
2026-08-27 13:36 ` Heiko Carstens
2026-08-27 12:01 ` [PATCH 2/3] s390/boot: Avoid IPL parameter append past command line Vasily Gorbik
2026-08-27 12:06 ` sashiko-bot
2026-08-27 13:36 ` Heiko Carstens
2026-08-27 12:01 ` [PATCH 3/3] s390/boot: Bound command line facility ranges Vasily Gorbik
2026-08-27 12:09 ` sashiko-bot
2026-08-27 13:49 ` Heiko Carstens
2026-08-27 15:59 ` [PATCH 0/3] s390/boot: Fix couple of early boot edge cases Vasily Gorbik
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=p01-03.g46f7a6bfbc01.ttkffvj@ub.hpns \
--to=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=linux-s390@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.