diff options
author | Alexandre Ghiti <alexghiti@rivosinc.com> | 2023-09-15 12:01:13 +0200 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2023-09-20 02:29:26 -0700 |
commit | b06fab003ae181c6690fe6d1f806636f816f4e50 (patch) | |
tree | 3ad30d25f201056442ae0d2fb45a4157b1c37eea /tools/testing/selftests/riscv/mm/mmap_bottomup.c | |
parent | 8eb8fe67e2c84324398f5983c41b4f831d0705b3 (diff) | |
download | linux-stable-b06fab003ae181c6690fe6d1f806636f816f4e50.tar.gz linux-stable-b06fab003ae181c6690fe6d1f806636f816f4e50.tar.bz2 linux-stable-b06fab003ae181c6690fe6d1f806636f816f4e50.zip |
riscv: kselftests: Fix mm build by removing testcases subdirectory
kselftests fails to build because the mm/testcases subdirectory is not
created and then the compiler fails to output the binary there.
So fix this by simply removing this subdirectory which is not very
useful.
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20230915100113.13131-1-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'tools/testing/selftests/riscv/mm/mmap_bottomup.c')
-rw-r--r-- | tools/testing/selftests/riscv/mm/mmap_bottomup.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/testing/selftests/riscv/mm/mmap_bottomup.c b/tools/testing/selftests/riscv/mm/mmap_bottomup.c new file mode 100644 index 000000000000..1757d19ca89b --- /dev/null +++ b/tools/testing/selftests/riscv/mm/mmap_bottomup.c @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <sys/mman.h> +#include <mmap_test.h> + +#include "../../kselftest_harness.h" + +TEST(infinite_rlimit) +{ +// Only works on 64 bit +#if __riscv_xlen == 64 + struct addresses mmap_addresses; + + EXPECT_EQ(BOTTOM_UP, memory_layout()); + + do_mmaps(&mmap_addresses); + + EXPECT_NE(MAP_FAILED, mmap_addresses.no_hint); + EXPECT_NE(MAP_FAILED, mmap_addresses.on_37_addr); + EXPECT_NE(MAP_FAILED, mmap_addresses.on_38_addr); + EXPECT_NE(MAP_FAILED, mmap_addresses.on_46_addr); + EXPECT_NE(MAP_FAILED, mmap_addresses.on_47_addr); + EXPECT_NE(MAP_FAILED, mmap_addresses.on_55_addr); + EXPECT_NE(MAP_FAILED, mmap_addresses.on_56_addr); + + EXPECT_GT(1UL << 47, (unsigned long)mmap_addresses.no_hint); + EXPECT_GT(1UL << 38, (unsigned long)mmap_addresses.on_37_addr); + EXPECT_GT(1UL << 38, (unsigned long)mmap_addresses.on_38_addr); + EXPECT_GT(1UL << 38, (unsigned long)mmap_addresses.on_46_addr); + EXPECT_GT(1UL << 47, (unsigned long)mmap_addresses.on_47_addr); + EXPECT_GT(1UL << 47, (unsigned long)mmap_addresses.on_55_addr); + EXPECT_GT(1UL << 56, (unsigned long)mmap_addresses.on_56_addr); +#endif +} + +TEST_HARNESS_MAIN |