All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] hugemmap24: Restrict the 1TB slice layout to 64-bit powerpc
@ 2026-09-07  1:45 Victor Cheng-Yen Yang via ltp
  2026-09-07  6:32 ` Andrea Cervesato via ltp
  2026-09-07  6:32 ` Andrea Cervesato via ltp
  0 siblings, 2 replies; 3+ messages in thread
From: Victor Cheng-Yen Yang via ltp @ 2026-09-07  1:45 UTC (permalink / raw)
  To: ltp

The 1TB-slice branch of init_slice_boundary() is guarded by __LP64__
minus a blocklist of architectures that do not have powerpc slices.
Every new 64-bit architecture has to be added to that blocklist, and rv64
is the next one to trip over it.

The virtual address space of an rv64 kernel in Sv39 MMU mode is split in
half between user and kernel, leaving TASK_SIZE = 0x4000000000 (256 GB).
Every candidate boundary from 1 TB up is above the end of the user
address space, so the MAP_FIXED mmap() fails with ENOMEM on all
iterations and the test reports a bogus failure:

  hugemmap24.c:62: TINFO: can't use slice_boundary: 0x100000000000: ENOMEM (12)
  hugemmap24.c:71: TFAIL: couldn't find 2 free neighbour slices: ENOMEM (12)

Invert the check instead of extending the blocklist. 1 TB slices only
exist on 64-bit powerpc. Every other architecture falls back to the
256 MB layout at low addresses. Sv48 and Sv57 do provide a large enough
user range, but the test must also pass on Sv39, so RISC-V takes the
fallback unconditionally.

Suggested-by: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Victor Cheng-Yen Yang <cyyang772@andestech.com>
---
v2: Invert the exclusion into a 64-bit powerpc allowlist, per Andrea.
Link to v1: https://lore.kernel.org/ltp/20260824082350.70245-1-cyyang772@andestech.com/
---
 testcases/kernel/mem/hugetlb/hugemmap/hugemmap24.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap24.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap24.c
index 0de44d58a..9e23c253f 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap24.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap24.c
@@ -28,12 +28,12 @@ static int init_slice_boundary(int fd)
 	unsigned long slice_size;
 	void *p, *heap;
 	int i;
-#if defined(__LP64__) && !defined(__aarch64__) && !defined(__loongarch__)
+#if defined(__powerpc64__) || (defined(__powerpc__) && defined(__LP64__))
 	/* powerpc: 1TB slices starting at 1 TB */
 	slice_boundary = 0x10000000000;
 	slice_size = 0x10000000000;
 #else
-	/* powerpc: 256MB slices up to 4GB */
+	/* powerpc (32-bit) and other arches: 256MB slices up to 4GB */
 	slice_boundary = 0x00000000;
 	slice_size = 0x10000000;
 #endif
-- 
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH v2] hugemmap24: Restrict the 1TB slice layout to 64-bit powerpc
  2026-09-07  1:45 [LTP] [PATCH v2] hugemmap24: Restrict the 1TB slice layout to 64-bit powerpc Victor Cheng-Yen Yang via ltp
@ 2026-09-07  6:32 ` Andrea Cervesato via ltp
  2026-09-07  6:32 ` Andrea Cervesato via ltp
  1 sibling, 0 replies; 3+ messages in thread
From: Andrea Cervesato via ltp @ 2026-09-07  6:32 UTC (permalink / raw)
  To: Victor Cheng-Yen Yang; +Cc: ltp

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LTP] [PATCH v2] hugemmap24: Restrict the 1TB slice layout to 64-bit powerpc
  2026-09-07  1:45 [LTP] [PATCH v2] hugemmap24: Restrict the 1TB slice layout to 64-bit powerpc Victor Cheng-Yen Yang via ltp
  2026-09-07  6:32 ` Andrea Cervesato via ltp
@ 2026-09-07  6:32 ` Andrea Cervesato via ltp
  1 sibling, 0 replies; 3+ messages in thread
From: Andrea Cervesato via ltp @ 2026-09-07  6:32 UTC (permalink / raw)
  To: Victor Cheng-Yen Yang; +Cc: ltp

Merged, Thanks!

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-07  6:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07  1:45 [LTP] [PATCH v2] hugemmap24: Restrict the 1TB slice layout to 64-bit powerpc Victor Cheng-Yen Yang via ltp
2026-09-07  6:32 ` Andrea Cervesato via ltp
2026-09-07  6:32 ` Andrea Cervesato via ltp

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.