[RFC 0/2] Experimental kunit test for signal context handling

Benjamin Berg benjamin at sipsolutions.net
Thu Jun 26 12:57:12 PDT 2025


From: Benjamin Berg <benjamin.berg at intel.com>

Hi,

so I saw the UAPI testing framework patches and wondered whether I could
hack up a kunit test for userspace signal mcontext handling. I already
had some code, but never knew where to include it. Having it as a kunit
test in this way seems nice as it makes running the test really simple.

This is a very rough attempt with an extra patch to add sigaction
support as that is needed by the test.

Note that this type of test could possibly be shared with the x86
architecture (though UM does not support all features). And, a 64 bit
build might even want to include a second 32 bit binary. So, I suppose
one would ideally want the test to be in arch/x86/tests, with some way
to pick up it up in arch/x86/um/tests.

Does this seem sensible in general?

Benjamin

Benjamin Berg (2):
  tools/nolibc: add sigaction()
  um: add a mcontext FP register handling test

 arch/x86/um/Makefile                     |   2 +
 arch/x86/um/tests/Makefile               |  12 +++
 arch/x86/um/tests/registers.c            |  22 +++++
 arch/x86/um/tests/test-fp-save-restore.c | 118 +++++++++++++++++++++++
 tools/include/nolibc/nolibc.h            |   3 +
 tools/include/nolibc/signal.h            |  34 +++++++
 6 files changed, 191 insertions(+)
 create mode 100644 arch/x86/um/tests/Makefile
 create mode 100644 arch/x86/um/tests/registers.c
 create mode 100644 arch/x86/um/tests/test-fp-save-restore.c

-- 
2.50.0




More information about the linux-um mailing list