linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/16] selftests: vDSO: parse_vdso: Make compatible with nolibc
@ 2025-02-26 11:44 Thomas Weißschuh
  2025-02-26 11:44 ` [PATCH v2 01/16] MAINTAINERS: Add vDSO selftests Thomas Weißschuh
                   ` (16 more replies)
  0 siblings, 17 replies; 40+ messages in thread
From: Thomas Weißschuh @ 2025-02-26 11:44 UTC (permalink / raw)
  To: Kees Cook, Eric Biederman, Shuah Khan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Andy Lutomirski,
	Thomas Gleixner, Vincenzo Frascino, Willy Tarreau,
	Thomas Weißschuh
  Cc: Jason A. Donenfeld, Christophe Leroy, linux-mm, linux-kernel,
	linux-kselftest, llvm, Thomas Weißschuh

For testing the functionality of the vDSO, it is necessary to build
userspace programs for multiple different architectures.
It is additional work to acquire matching userspace cross-compilers with
full C libraries and then building root images out of those.
The kernel tree already contains nolibc, a small, header-only C library.
By using it, it is possible to build userspace programs without any
additional dependencies.
For example the kernel.org crosstools or multi-target clang can be used
to build test programs for a multitude of architectures.
While nolibc is very limited, it is enough for many selftests.
With some minor adjustments it is possible to make parse_vdso.c
compatible with nolibc.
As an example, vdso_standalone_test_x86 is now built from the same C
code as the regular vdso_test_gettimeofday, while still being completely
standalone.
Also drop the dependency of parse_vdso.c on the elf.h header from libc and only
use the one from the kernel's UAPI.

While this series is useful on its own now, it will also integrate with the
kunit UAPI framework currently under development:
https://lore.kernel.org/lkml/20250217-kunit-kselftests-v1-0-42b4524c3b0a@linutronix.de/

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Changes in v2:
- Provide a limits.h header in nolibc
- Pick up Reviewed-by tags from Kees
- Link to v1: https://lore.kernel.org/r/20250203-parse_vdso-nolibc-v1-0-9cb6268d77be@linutronix.de

---
Thomas Weißschuh (16):
      MAINTAINERS: Add vDSO selftests
      elf, uapi: Add definition for STN_UNDEF
      elf, uapi: Add definition for DT_GNU_HASH
      elf, uapi: Add definitions for VER_FLG_BASE and VER_FLG_WEAK
      elf, uapi: Add type ElfXX_Versym
      elf, uapi: Add types ElfXX_Verdef and ElfXX_Veraux
      tools/include: Add uapi/linux/elf.h
      selftests: Add headers target
      tools/nolibc: add limits.h shim header
      selftests: vDSO: vdso_standalone_test_x86: Use vdso_init_form_sysinfo_ehdr
      selftests: vDSO: parse_vdso: Drop vdso_init_from_auxv()
      selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers
      selftests: vDSO: parse_vdso: Test __SIZEOF_LONG__ instead of ULONG_MAX
      selftests: vDSO: vdso_test_gettimeofday: Clean up includes
      selftests: vDSO: vdso_test_gettimeofday: Make compatible with nolibc
      selftests: vDSO: vdso_standalone_test_x86: Switch to nolibc

 MAINTAINERS                                        |   1 +
 include/uapi/linux/elf.h                           |  38 ++
 tools/include/nolibc/Makefile                      |   1 +
 tools/include/nolibc/limits.h                      |   7 +
 tools/include/uapi/linux/elf.h                     | 524 +++++++++++++++++++++
 tools/testing/selftests/lib.mk                     |   5 +-
 tools/testing/selftests/vDSO/Makefile              |  11 +-
 tools/testing/selftests/vDSO/parse_vdso.c          |  19 +-
 tools/testing/selftests/vDSO/parse_vdso.h          |   1 -
 .../selftests/vDSO/vdso_standalone_test_x86.c      | 143 +-----
 .../selftests/vDSO/vdso_test_gettimeofday.c        |   4 +-
 11 files changed, 590 insertions(+), 164 deletions(-)
---
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20241017-parse_vdso-nolibc-e069baa7ff48

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh@linutronix.de>



^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2025-04-04 13:03 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-26 11:44 [PATCH v2 00/16] selftests: vDSO: parse_vdso: Make compatible with nolibc Thomas Weißschuh
2025-02-26 11:44 ` [PATCH v2 01/16] MAINTAINERS: Add vDSO selftests Thomas Weißschuh
2025-02-28 12:22   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 02/16] elf, uapi: Add definition for STN_UNDEF Thomas Weißschuh
2025-02-28 12:23   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 03/16] elf, uapi: Add definition for DT_GNU_HASH Thomas Weißschuh
2025-02-28 12:23   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 04/16] elf, uapi: Add definitions for VER_FLG_BASE and VER_FLG_WEAK Thomas Weißschuh
2025-02-28 12:24   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 05/16] elf, uapi: Add type ElfXX_Versym Thomas Weißschuh
2025-02-28 12:24   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 06/16] elf, uapi: Add types ElfXX_Verdef and ElfXX_Veraux Thomas Weißschuh
2025-02-28 12:25   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 07/16] tools/include: Add uapi/linux/elf.h Thomas Weißschuh
2025-02-28 12:25   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 08/16] selftests: Add headers target Thomas Weißschuh
2025-02-28 12:26   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 09/16] tools/nolibc: add limits.h shim header Thomas Weißschuh
2025-02-28 12:27   ` Vincenzo Frascino
2025-03-01 11:30   ` Willy Tarreau
2025-02-26 11:44 ` [PATCH v2 10/16] selftests: vDSO: vdso_standalone_test_x86: Use vdso_init_form_sysinfo_ehdr Thomas Weißschuh
2025-02-28 12:28   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 11/16] selftests: vDSO: parse_vdso: Drop vdso_init_from_auxv() Thomas Weißschuh
2025-02-28 12:28   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 12/16] selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers Thomas Weißschuh
2025-02-28 12:29   ` Vincenzo Frascino
2025-03-20 13:23   ` Mark Brown
2025-03-26 13:02     ` Mark Brown
2025-03-28 23:08       ` Shuah Khan
2025-03-31 11:56         ` Mark Brown
2025-04-04 13:03           ` Mark Brown
2025-02-26 11:44 ` [PATCH v2 13/16] selftests: vDSO: parse_vdso: Test __SIZEOF_LONG__ instead of ULONG_MAX Thomas Weißschuh
2025-02-28 12:29   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 14/16] selftests: vDSO: vdso_test_gettimeofday: Clean up includes Thomas Weißschuh
2025-02-28 12:29   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 15/16] selftests: vDSO: vdso_test_gettimeofday: Make compatible with nolibc Thomas Weißschuh
2025-02-28 12:30   ` Vincenzo Frascino
2025-02-26 11:44 ` [PATCH v2 16/16] selftests: vDSO: vdso_standalone_test_x86: Switch to nolibc Thomas Weißschuh
2025-02-28 12:31   ` Vincenzo Frascino
2025-02-26 21:18 ` [PATCH v2 00/16] selftests: vDSO: parse_vdso: Make compatible with nolibc Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).