Re: [PATCH 1/6] kunit: add parameter generation macro using description from array

2023-12-22 Thread Benjamin Berg
On Fri, 2023-12-22 at 18:02 +0800, David Gow wrote: > On Wed, 20 Dec 2023 at 23:20, wrote: > > > > From: Benjamin Berg > > > > The existing KUNIT_ARRAY_PARAM macro requires a separate function > > to > > get the description. However, in a lot of cases

[PATCH 0/3] signal handling support for nolibc

2025-07-09 Thread Benjamin Berg
From: Benjamin Berg Hi, This patchset adds signal handling to nolibc. Initially, I would like to use this for tests. But in the long run, the goal is to use nolibc for the UML kernel itself. In both cases, signal handling will be needed. Benjamin Benjamin Berg (3): tools/nolibc: show failed

[PATCH 3/3] tools/nolibc: add signal support

2025-07-09 Thread Benjamin Berg
From: Benjamin Berg Add support for sigaction() and implement the normal sa_mask helpers. On many architectures, linux/signal.h pulls in compatibility definitions for the old sigaction syscall instead of rt_sigaction. However, the kernel can be compiled without support for this compatibility

[PATCH 1/3] tools/nolibc: show failed run if test process crashes

2025-07-09 Thread Benjamin Berg
From: Benjamin Berg The logic would not catch if the test process crashes and would incorrectly report a "success" state. Fix this by looking for the final "Total number of errors:" message and printing "failure" if it was not seen. Signed-off-by: Benjamin Berg

[PATCH 2/3] tools/nolibc: add more generic BITSET_* macros for FD_*

2025-07-09 Thread Benjamin Berg
From: Benjamin Berg The FD_* macros are assuming a specific type for the bitset. Add new macros that introspect the type of the passed variable in order to know the size of the bitset. This way the same macros can be used for other purposes. Signed-off-by: Benjamin Berg --- tools/include

Re: [PATCH 3/3] tools/nolibc: add signal support

2025-07-09 Thread Benjamin Berg
On Wed, 2025-07-09 at 23:21 +0200, Thomas Weißschuh wrote: > On 2025-07-09 17:55:12+0200, Benjamin Berg wrote: > (...) > > > --- a/tools/testing/selftests/nolibc/nolibc-test.c > > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > > @@ -1270,6 +1270,72 @@ int test_nam

[PATCH v2 3/4] tools/nolibc: add more generic bitmask macros for FD_*

2025-07-10 Thread Benjamin Berg
From: Benjamin Berg The FD_* macros are assuming a specific type for the bitmask. Add new macros that introspect the type of the passed variable in order to know the size of the bitmask. This way the same macros can be used for other purposes. Signed-off-by: Benjamin Berg --- v2: - Rename

[PATCH v2 4/4] tools/nolibc: add signal support

2025-07-10 Thread Benjamin Berg
From: Benjamin Berg Add support for sigaction() and implement the normal sa_mask helpers. On many architectures, linux/signal.h pulls in compatibility definitions for the old sigaction syscall instead of rt_sigaction. However, the kernel can be compiled without support for this compatibility

[PATCH v2 0/4] signal handling support for nolibc

2025-07-10 Thread Benjamin Berg
From: Benjamin Berg Hi, This patchset adds signal handling to nolibc. Initially, I would like to use this for tests. But in the long run, the goal is to use nolibc for the UML kernel itself. In both cases, signal handling will be needed. v2 contains some bugfixes and has a better test coverage

[PATCH v2 1/4] selftests/nolibc: fix EXPECT_NZ macro

2025-07-10 Thread Benjamin Berg
From: Benjamin Berg The expect non-zero macro was incorrect and never used. Fix its definition. --- tools/testing/selftests/nolibc/nolibc-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc

[PATCH v2 2/4] selftests/nolibc: validate order of constructor calls

2025-07-10 Thread Benjamin Berg
From: Benjamin Berg Add new helpers to track multiple steps as bits in an integer. Store each step in a bit and use the lowest bit to store whether all steps occurred in the correct order and only once. Use this for the constructor tests. Signed-off-by: Benjamin Berg --- v2: - Newly added

Re: [PATCH v2 4/4] tools/nolibc: add signal support

2025-07-11 Thread Benjamin Berg
On Fri, 2025-07-11 at 07:40 +0200, Thomas Weißschuh wrote: > On 2025-07-10 12:39:50+0200, Benjamin Berg wrote: > > From: Benjamin Berg > > > > Add support for sigaction() and implement the normal sa_mask helpers. > > > > On many architectures, linu

Re: [RFC v2] tools/nolibc: add sigaction()

2025-07-02 Thread Benjamin Berg
Hi, On Wed, 2025-07-02 at 00:04 +0200, Thomas Weißschuh wrote: > [SNIP] > > --- a/tools/include/nolibc/arch-i386.h > > +++ b/tools/include/nolibc/arch-i386.h > > @@ -10,6 +10,19 @@ > >  #include "compiler.h" > >  #include "crt.h" > >   > > +/* Needed to get the correct struct sigaction definition

Re: [PATCH v2 4/4] tools/nolibc: add signal support

2025-07-14 Thread Benjamin Berg
On Sun, 2025-07-13 at 17:50 +0200, Willy Tarreau wrote: > On Sun, Jul 13, 2025 at 05:02:27PM +0200, Thomas Weißschuh wrote: > > On 2025-07-11 09:25:26+0200, Benjamin Berg wrote: > > > On Fri, 2025-07-11 at 07:40 +0200, Thomas Weißschuh wrote: > > > > On 2025-07-1

[RFC v2] tools/nolibc: add sigaction()

2025-07-01 Thread Benjamin Berg
From: Benjamin Berg In preparation to add tests that use it. Note that some architectures do not have a usable linux/signal.h include file. However, in those cases we can use asm-generic/signal.h instead. Signed-off-by: Benjamin Berg --- Another attempt at signal handling for nolibc which

[PATCH v3 3/4] tools/nolibc: add more generic bitmask macros for FD_*

2025-07-31 Thread Benjamin Berg
From: Benjamin Berg The FD_* macros are assuming a specific type for the bitmask. Add new macros that introspect the type of the passed variable in order to know the size of the bitmask. This way the same macros can be used for other purposes. Signed-off-by: Benjamin Berg --- v2: - Rename

[PATCH v3 1/4] selftests/nolibc: fix EXPECT_NZ macro

2025-07-31 Thread Benjamin Berg
From: Benjamin Berg The expect non-zero macro was incorrect and never used. Fix its definition. Fixes: 362aecb2d8cfa ("selftests/nolibc: add basic infrastructure to ease creation of nolibc tests") Signed-off-by: Benjamin Berg --- tools/testing/selftests/nolibc/nolibc-test.c | 4 ++

[PATCH v3 4/4] tools/nolibc: add signal support

2025-07-31 Thread Benjamin Berg
From: Benjamin Berg Add support for sigaction() using the rt_sigaction syscall and implement the normal sa_mask helpers. For the uapi definitions, everything is copied into nolibc. This avoids issues with kernel architecture headers that are not usable with the rt_sigaction syscall. Signed-off

[PATCH v3 0/4] signal handling support for nolibc

2025-07-31 Thread Benjamin Berg
From: Benjamin Berg Hi, This patchset adds signal handling to nolibc. Initially, I would like to use this for tests. But in the long run, the goal is to use nolibc for the UML kernel itself. In both cases, signal handling will be needed. With v3 everything is now included in nolibc instead of

[PATCH v3 2/4] selftests/nolibc: remove outdated comment about construct order

2025-07-31 Thread Benjamin Berg
From: Benjamin Berg The constructor order is not (and should not) be tested. Remove the comment. Fixes: a782d45c867c ("selftests/nolibc: stop testing constructor order") Signed-off-by: Benjamin Berg --- tools/testing/selftests/nolibc/nolibc-test.c | 1 - 1 file changed, 1 deletio