* [PATCH] selftests: riscv: Allow mmap test to compile on 32-bit
@ 2024-08-08 18:41 Charlie Jenkins
2024-09-17 16:30 ` patchwork-bot+linux-riscv
0 siblings, 1 reply; 2+ messages in thread
From: Charlie Jenkins @ 2024-08-08 18:41 UTC (permalink / raw)
To: Shuah Khan, Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: linux-kselftest, linux-riscv, linux-kernel, Charlie Jenkins
Macros needed for 32-bit compilations were hidden behind 64-bit riscv
ifdefs. Fix the 32-bit compilations by moving macros to allow the
memory_layout test to run on 32-bit.
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Fixes: 73d05262a2ca ("selftests: riscv: Generalize mm selftests")
---
tools/testing/selftests/riscv/mm/mmap_test.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/riscv/mm/mmap_test.h b/tools/testing/selftests/riscv/mm/mmap_test.h
index 3b29ca3bb3d4..1c3313c201d5 100644
--- a/tools/testing/selftests/riscv/mm/mmap_test.h
+++ b/tools/testing/selftests/riscv/mm/mmap_test.h
@@ -48,11 +48,11 @@ uint32_t random_addresses[] = {
};
#endif
-// Only works on 64 bit
-#if __riscv_xlen == 64
#define PROT (PROT_READ | PROT_WRITE)
#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS)
+// Only works on 64 bit
+#if __riscv_xlen == 64
/* mmap must return a value that doesn't use more bits than the hint address. */
static inline unsigned long get_max_value(unsigned long input)
{
@@ -80,6 +80,8 @@ static inline unsigned long get_max_value(unsigned long input)
})
#endif /* __riscv_xlen == 64 */
+#define TEST_MMAPS do { } while (0)
+
static inline int memory_layout(void)
{
void *value1 = mmap(NULL, sizeof(int), PROT, FLAGS, 0, 0);
---
base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b
change-id: 20240807-mmap_tests__fixes-651cc2b5fead
--
- Charlie
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests: riscv: Allow mmap test to compile on 32-bit
2024-08-08 18:41 [PATCH] selftests: riscv: Allow mmap test to compile on 32-bit Charlie Jenkins
@ 2024-09-17 16:30 ` patchwork-bot+linux-riscv
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-09-17 16:30 UTC (permalink / raw)
To: Charlie Jenkins
Cc: linux-riscv, shuah, paul.walmsley, palmer, aou, linux-kselftest,
linux-kernel
Hello:
This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:
On Thu, 08 Aug 2024 11:41:40 -0700 you wrote:
> Macros needed for 32-bit compilations were hidden behind 64-bit riscv
> ifdefs. Fix the 32-bit compilations by moving macros to allow the
> memory_layout test to run on 32-bit.
>
> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> Fixes: 73d05262a2ca ("selftests: riscv: Generalize mm selftests")
>
> [...]
Here is the summary with links:
- selftests: riscv: Allow mmap test to compile on 32-bit
https://git.kernel.org/riscv/c/11c2dbd7f241
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-17 17:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-08 18:41 [PATCH] selftests: riscv: Allow mmap test to compile on 32-bit Charlie Jenkins
2024-09-17 16:30 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox