Hi Beata,
On 18/11/2022 13:28, Beata Michalska wrote:
Hi Teo,
On Tue, Nov 15, 2022 at 05:01:07PM +0000, Teo Couprie Diaz wrote:
brk is disabled in purecap, so only check that calling it returns -ENOSYS. Do it explicitly otherwise the test would be skipped by tst_syscall.
This line break looks bit odd. Is that intentional ?
It is both intentional and a bit odd. I didn't think it would fit in the 75 characters without the break but it does so exactly, so moved back on one line.
(I think similar break is in PATCH 1/2) Otherwise just thinking if we could add a reference to ABI specification [1] to give some background on why brk is not supported ?
[1] https://git.morello-project.org/morello/kernel/linux/-/wikis/Morello-pure-ca...
Agreed, good point ! Added for v3.
brk02 cannot be completed in purecap as brk is not implemented. We don't need to add anything as tst_syscall will skip it with TCONF in purecap by detecting the -ENOSYS return.
To be fair I think both brk01 & brk02 cannot be completed.
Yeah, fair !
Not sure I understand why only brk02 is to suffer from lack of support for brk (?) FWIW: brk01 is also using tst_syscall. I assume this is to check that brk is not supported with purecap mode only once?
That was the idea indeed, this way brk01 does the testing and brk02 is just disabled. See my response below regarding using setup.
If so I believe both tests should verify that. Apologies if I suggested smth otherwise in our previous discussions.
Add brk01 and brk02 to the morello_transitional_extended list.
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com
runtest/morello_transitional_extended | 3 +++ testcases/kernel/syscalls/brk/brk01.c | 10 ++++++++++ 2 files changed, 13 insertions(+)
diff --git a/runtest/morello_transitional_extended b/runtest/morello_transitional_extended index 067fe82da..9549f9aa5 100644 --- a/runtest/morello_transitional_extended +++ b/runtest/morello_transitional_extended @@ -1,5 +1,8 @@ #DESCRIPTION: Morello transitional extended ABI system calls +brk01 brk01 +brk02 brk02
- epoll_create01 epoll_create01 epoll_create02 epoll_create02 epoll_create1_01 epoll_create1_01
diff --git a/testcases/kernel/syscalls/brk/brk01.c b/testcases/kernel/syscalls/brk/brk01.c index 919435755..a5de55b0a 100644 --- a/testcases/kernel/syscalls/brk/brk01.c +++ b/testcases/kernel/syscalls/brk/brk01.c @@ -17,6 +17,16 @@ void verify_brk(void) size_t inc = getpagesize() * 2 - 1; unsigned int i; +#ifdef __CHERI_PURE_CAPABILITY__
- /*
* tst_syscall skips the test with TCONF if the syscall returns -ENOSYS.
* Use a direct syscall to check that it does return -ENOSYS correctly
* and explicitly PASS or FAIL.
*/
- TST_EXP_FAIL(syscall(__NR_brk, 0), ENOSYS, "brk is not implemented in purecap");
- return;
+#endif
This is good, though we might add a 'setup' stage to both tests to validate if the syscall is supported prior to running those tests, if at all:
static void setup(void) { #ifdef __CHERI_PURE_CAPABILITY__ ... TST_EXP_FAIL(syscall(__NR_brk, 0), ENOSYS, "brk is not implemented in purecap"); tst_brk(TCONF, "Test not supported."); /* Or TST_SYSCALL_BRK__ to be compatible with LTP's 'old' setup */ #endif }
static struct tst_test test = { .setup = setup, .test_all = verify_brk, }
which would render smth below the lines: TPASS: brk is not implemented in purecap : ENOSYS (38) TCONF: Test not supported.
(second message to be tuned in)
The setup makes it way more logical for me for both tests to check if it works correctly in purecap. Then it's just part of setting up the test, which go on to do (or skip) their own thing.
Will change them to use that for v3.
BR B.
Thanks for the review, Téo
cur_brk = (uintptr_t)tst_syscall(__NR_brk, 0); for (i = 0; i < 33; i++) { -- 2.25.1
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