RISC-V: mm: Add tests for RISC-V mm
authorCharlie Jenkins <charlie@rivosinc.com>
Wed, 9 Aug 2023 23:22:02 +0000 (16:22 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 23 Aug 2023 21:54:13 +0000 (14:54 -0700)
commit4d0c04eac0c2d4e0100bbc67cc2fb48c3a53d8c8
treeff140f785e630109cc4e55afb20f8d0adb8cc8fa
parentadd2cc6b6515f78d3a150f1fbbaf12c28c4bb20a
RISC-V: mm: Add tests for RISC-V mm

Add tests that enforce mmap hint address behavior. mmap should default
to sv48. mmap will provide an address at the highest address space that
can fit into the hint address, unless the hint address is less than sv39
and not 0, then it will return a sv39 address.

These tests are split into two files: mmap_default.c and mmap_bottomup.c
because a new process must be exec'd in order to change the mmap layout.
The run_mmap.sh script sets the stack to be unlimited for the
mmap_bottomup.c test which triggers a bottomup layout.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20230809232218.849726-3-charlie@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
tools/testing/selftests/riscv/Makefile
tools/testing/selftests/riscv/mm/.gitignore [new file with mode: 0644]
tools/testing/selftests/riscv/mm/Makefile [new file with mode: 0644]
tools/testing/selftests/riscv/mm/testcases/mmap_bottomup.c [new file with mode: 0644]
tools/testing/selftests/riscv/mm/testcases/mmap_default.c [new file with mode: 0644]
tools/testing/selftests/riscv/mm/testcases/mmap_test.h [new file with mode: 0644]
tools/testing/selftests/riscv/mm/testcases/run_mmap.sh [new file with mode: 0755]