On Fri, Apr 19, 2024 at 03:24:28PM +0100, Kevin Brodsky wrote:
A mapping that has just been created at a new location by mmap() cannot generally be expanded in PCuABI, because it cannot exceed the bounds of its underlying reservation. To allow this test to pass in PCuABI, pass MREMAP_MAYMOVE to mremap().
Might be just me but the commit message reads like the MREMAP_MAYMOVE flag is used as a workaround here. Maybe expanding on what that flags means wrt reservations would make things more .... clear ?
--- BR Beata
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com
testcases/kernel/syscalls/mmap/mmap16.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/mmap/mmap16.c b/testcases/kernel/syscalls/mmap/mmap16.c index 64fb02fa4034..275f6461554b 100644 --- a/testcases/kernel/syscalls/mmap/mmap16.c +++ b/testcases/kernel/syscalls/mmap/mmap16.c @@ -43,6 +43,12 @@ static int parentfd = -1; static int childfd = -1; +#ifdef __CHERI_PURE_CAPABILITY__ +#define MREMAP_FLAGS MREMAP_MAYMOVE +#else +#define MREMAP_FLAGS 0 +#endif
static void do_child(void) { int offset; @@ -74,7 +80,7 @@ static void do_child(void) SAFE_FTRUNCATE(childfd, page_size * 2);
- addr = mremap(addr, FS_BLOCKSIZE, 2 * page_size, 0);
- addr = mremap(addr, FS_BLOCKSIZE, 2 * page_size, MREMAP_FLAGS); if (addr == MAP_FAILED) tst_brk(TBROK | TERRNO, "mremap failed unexpectedly");
2.43.0
linux-morello-ltp mailing list -- linux-morello-ltp@op-lists.linaro.org To unsubscribe send an email to linux-morello-ltp-leave@op-lists.linaro.org