Skip to content

Commit 5fb5a93

Browse files
riastradhriastradh
authored andcommitted
t_signal_and_sp: contextsplink test may not be broken on n64.
n32 and n64 have the same stack alignment requirement (16-byte), so if there were a problem it would probably manifest on n32 too. But the only things that __resumecontext does with a misaligned sp are: 1. syscall getcontext (not even via the syscall stub, but via the syscall instruction directly), which is unlikely to care; and 2. tail-call setcontext, which does a syscall (again, unlikely to care) that will discard the caller's sp and replace it altogether. So I'm not sure we can even test potential adverse consequences of misalignment inside __resumecontext, short of interposing our own setcontext symbol to artificially verify its stack alignment before passing on to the syscall -- which, while feasible, is maybe not worth the effort. PR kern/59327: user stack pointer is not aligned properly
1 parent e0b4992 commit 5fb5a93

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

tests/kernel/t_signal_and_sp.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: t_signal_and_sp.c,v 1.11 2025/04/24 16:57:27 riastradh Exp $ */
1+
/* $NetBSD: t_signal_and_sp.c,v 1.12 2025/04/24 17:00:25 riastradh Exp $ */
22

33
/*
44
* Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
2727
*/
2828

2929
#include <sys/cdefs.h>
30-
__RCSID("$NetBSD: t_signal_and_sp.c,v 1.11 2025/04/24 16:57:27 riastradh Exp $");
30+
__RCSID("$NetBSD: t_signal_and_sp.c,v 1.12 2025/04/24 17:00:25 riastradh Exp $");
3131

3232
#include <sys/wait.h>
3333

@@ -315,11 +315,6 @@ ATF_TC_BODY(contextsplink, tc)
315315
fprintf(stderr, "stack2 @ [%p,%p)\n",
316316
stack2, stack2 + SIGSTKSZ + STACK_ALIGNBYTES);
317317

318-
#ifdef __mips_n64
319-
atf_tc_expect_fail("PR kern/59327:"
320-
" user stack pointer is not aligned properly");
321-
#endif
322-
323318
for (i = 0; i <= STACK_ALIGNBYTES; i++) {
324319
contextsp = NULL;
325320
test_context_done = false;

0 commit comments

Comments
 (0)