Re: [PATCH v2 1/1] selftests/futex: Check for shmget support at runtime

2025-08-07 Thread Thomas Weißschuh
On Thu, Aug 07, 2025 at 08:00:42PM +0800, Wake Liu wrote: > The futex tests `futex_wait.c` and `futex_waitv.c` rely on the `shmget()` > syscall, which may not be available if the kernel is built without > System V IPC support (CONFIG_SYSVIPC=n). This can lead to test > failures on such systems. >

[PATCH] tools/nolibc: fix error return value of clock_nanosleep()

2025-07-31 Thread Thomas Weißschuh
clock_nanosleep() returns a positive error value. Unlike other libc functions it *does not* return -1 nor set errno. Fix the return value and also adapt nanosleep(). Fixes: 7c02bc4088af ("tools/nolibc: add support for clock_nanosleep() and nanosleep()") Signed-off-by: Thomas

[PATCH RFC 10/14] sparc64: vdso: Switch to the generic vDSO library

2025-07-23 Thread Thomas Weißschuh
The generic vDSO provides a lot common functionality shared between different architectures. SPARC is the last architecture not using it, preventing some necessary code cleanup. Make use of the generic infrastructure. Signed-off-by: Thomas Weißschuh --- arch/sparc/Kconfig

[PATCH RFC 13/14] sparc64: vdso: Implement clock_gettime64()

2025-07-23 Thread Thomas Weißschuh
To be y2038-safe, 32-bit userspace needs to explicitly call the 64-bit safe time APIs. Implement clock_gettime64() in the 32-bit vDSO. Signed-off-by: Thomas Weißschuh --- arch/sparc/vdso/vclock_gettime.c| 8 arch/sparc/vdso/vdso32/vdso32.lds.S | 2 ++ 2 files changed, 10

[PATCH RFC 12/14] sparc64: vdso2c: Remove symbol handling

2025-07-23 Thread Thomas Weißschuh
There are no handled symbols left. Signed-off-by: Thomas Weißschuh --- arch/sparc/vdso/vdso2c.c | 10 -- arch/sparc/vdso/vdso2c.h | 41 + 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/arch/sparc/vdso/vdso2c.c b/arch/sparc/vdso

[PATCH RFC 14/14] sparc64: vdso: Implement clock_getres()

2025-07-23 Thread Thomas Weißschuh
Add a vDSO fastpath for clock_getres(). Signed-off-by: Thomas Weißschuh --- arch/sparc/include/asm/vdso/gettimeofday.h | 42 +- arch/sparc/vdso/vclock_gettime.c | 16 arch/sparc/vdso/vdso.lds.S | 2 ++ arch/sparc/vdso/vdso32

[PATCH RFC 11/14] sparc64: vdso2c: Drop sym_vvar_start handling

2025-07-23 Thread Thomas Weißschuh
After the adoption of the generic vDSO library this symbol does not exist. The alignment invariant is now guaranteed by the generic code. Signed-off-by: Thomas Weißschuh --- arch/sparc/include/asm/vdso.h | 2 -- arch/sparc/vdso/vdso2c.c | 6 -- arch/sparc/vdso/vdso2c.h | 4

[PATCH RFC 09/14] sparc64: vdso: Introduce vdso/processor.h

2025-07-23 Thread Thomas Weißschuh
The generic vDSO library expects a vdso/processor.h with an definition of cpu_relax(). Split out cpu_relax() into this dedicated header. Signed-off-by: Thomas Weißschuh --- arch/sparc/include/asm/processor.h | 3 +++ arch/sparc/include/asm/processor_32.h | 2 -- arch/sparc/include/asm

[PATCH RFC 08/14] sparc64: vdso: Move syscall fallbacks into header

2025-07-23 Thread Thomas Weißschuh
The generic vDSO libraries expected the syscall fallbacks asm/vdso/gettimeofday.h. To prepare the adoption of the generic library, move the existing functions there. While at it, rename them so they match what the generic library expects. Signed-off-by: Thomas Weißschuh --- arch/sparc/include

[PATCH RFC 06/14] sparc64: vdso: Replace code patching with runtime conditional

2025-07-23 Thread Thomas Weißschuh
The patching logic is unnecessarily complicated and stands in the way of the adoption of the generic vDSO framework. Replace it by a simple runtime switch, similar to other architectures. Suggested-by: Thomas Gleixner Link: https://lore.kernel.org/lkml/87ecu9tfhw.ffs@tglx/ Signed-off-by: Thomas

[PATCH RFC 07/14] sparc64: vdso: Move hardware counter read into header

2025-07-23 Thread Thomas Weißschuh
', as the functions are __always_inline anyways * Use the same parameter types * Use the same function names Signed-off-by: Thomas Weißschuh --- arch/sparc/include/asm/vdso/gettimeofday.h | 78 ++ arch/sparc/vdso/vclock_gettime.c | 70 ++--

[PATCH RFC 05/14] sparc64: vdso: Remove obsolete "fake section table" reservation

2025-07-23 Thread Thomas Weißschuh
eservation was only cleaned up in commit 24b7c77bbb24 ("x86/vdso: Remove obsolete "fake section table" reservation"). Remove the reservation for SPARC, too. Fixes: 9a08862a5d2e ("vDSO for sparc") Signed-off-by: Thomas Weißschuh --- arch/sparc/vdso/vdso-layout.lds.

[PATCH RFC 03/14] clocksource: remove ARCH_CLOCKSOURCE_DATA

2025-07-23 Thread Thomas Weißschuh
From: Arnd Bergmann After sparc64, there are no remaining users of ARCH_CLOCKSOURCE_DATA and it can just be removed. Signed-off-by: Arnd Bergmann Acked-by: John Stultz [Thomas: drop sparc64 bits from the patch] Signed-off-by: Thomas Weißschuh --- include/linux/clocksource.h | 6

[PATCH RFC 04/14] sparc64: vdso: Link with -z noexecstack

2025-07-23 Thread Thomas Weißschuh
org/ Fixes: 9a08862a5d2e ("vDSO for sparc") Signed-off-by: Thomas Weißschuh --- arch/sparc/vdso/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile index fdc4a8f5a49c5b27fbae

[PATCH RFC 02/14] sparc64: time: Remove architecture-specific clocksource data

2025-07-23 Thread Thomas Weißschuh
There is a dedicated field in 'struct clocksource' for the vDSO clock mode. Use that field and get rid of 'select ARCH_CLOCKSOURCE_DATA'. Signed-off-by: Thomas Weißschuh --- arch/sparc/Kconfig | 1 - arch/sparc/include/asm/clocksource.h | 4 arch/sp

[PATCH RFC 00/14] sparc64: vdso: Switch to generic vDSO library

2025-07-23 Thread Thomas Weißschuh
https://lore.kernel.org/lkml/20250707144726.4008707-1-a...@kernel.org/ Only tested on QEMU. Based von v6.16-rc1. Marked as RFC for testing and review only. Will be properly resubmitted after v6.17-rc1. Signed-off-by: Thomas Weißschuh --- Arnd Bergmann (1): clocksource: remove ARCH_CLOCKSOURCE

[PATCH RFC 01/14] vdso: add struct __kernel_old_timeval forward declaration to gettime.h

2025-07-23 Thread Thomas Weißschuh
The prototype of __vdso_gettimeofday() uses this struct. However gettime.h's own includes do not provide a definition for it. Add a forward declaration, similar to other used structs. Fixes: 42874e4eb35b ("arch: vdso: consolidate gettime prototypes") Signed-off-by: Thomas Weißschu

[PATCH 0/3] selftests/nolibc: enable qemu-system tests with LLVM builds

2025-07-19 Thread Thomas Weißschuh
Currently the test setup does not support running nolibc-test built with LLVM in qemu-system. Enable this. FYI, sparc32 on LLVM seems to be broken at the moment. To me this looks like a LLVM regression, emitting invalid object code. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (3

[PATCH 3/3] selftests/nolibc: always compile the kernel with GCC

2025-07-19 Thread Thomas Weißschuh
testsuite the kernel does not need to be built with LLVM. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile.nolibc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/Makefile.nolibc b/tools/testing/selftests/nolibc/Makefile.nolibc

[PATCH 2/3] selftests/nolibc: don't pass CC to toplevel Makefile

2025-07-19 Thread Thomas Weißschuh
The toplevel Makefile is capable of calculating CC from CROSS_COMPILE and/or ARCH. Stop passing the unnecessary variable. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile.nolibc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing

[PATCH 1/3] selftests/nolibc: deduplicate invocations of toplevel Makefile

2025-07-19 Thread Thomas Weißschuh
Various targets of the testsuite call back into the toplevel kernel Makefile. These calls use various parameters and are quite long. Introduce a common variable to make future changes smaller and the lines shorter. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc

Re: [PATCH 06/14] vdso/gettimeofday: Return bool from clock_gettime() helpers

2025-07-18 Thread Thomas Weißschuh
Hi Mark, On Wed, Jul 16, 2025 at 03:35:09PM +0100, Mark Brown wrote: > On Wed, Jul 16, 2025 at 03:23:24PM +0200, Thomas Weißschuh wrote: > > > Can you try the following? > > I missed this despite the double-checking after the last reported issue. > > I needed to f

Re: [PATCH 06/14] vdso/gettimeofday: Return bool from clock_gettime() helpers

2025-07-16 Thread Thomas Weißschuh
On Wed, Jul 16, 2025 at 01:50:22PM +0100, Mark Brown wrote: > On Wed, Jul 16, 2025 at 02:34:52PM +0200, Thomas Weißschuh wrote: > > On Wed, Jul 16, 2025 at 01:25:06PM +0100, Mark Brown wrote: > > > > This issue has been present in -next for a week and is causing a bunch &

Re: [PATCH 06/14] vdso/gettimeofday: Return bool from clock_gettime() helpers

2025-07-16 Thread Thomas Weißschuh
On Wed, Jul 16, 2025 at 01:25:06PM +0100, Mark Brown wrote: > On Wed, Jul 09, 2025 at 10:04:21AM +0200, Marek Szyprowski wrote: > > On 09.07.2025 09:34, Thomas Weißschuh wrote: > > > On Tue, Jul 08, 2025 at 05:49:18PM +0200, Marek Szyprowski wrote: > > > >

[PATCH 1/2] tools/nolibc: define time_t in terms of __kernel_old_time_t

2025-07-12 Thread Thomas Weißschuh
being the same type. While timespec::tv_sec comes from the kernel and is of type __kernel_old_time_t, time_t is defined within nolibc. Switch to the __kernel_old_time_t to always get the correct type. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/std.h | 4 +++- 1 file changed, 3 insert

[PATCH 0/2] tools/nolibc: add x32 support

2025-07-12 Thread Thomas Weißschuh
Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (2): tools/nolibc: define time_t in terms of __kernel_old_time_t selftests/nolibc: add x32 test configuration tools/include/nolibc/std.h | 4 +++- tools/testing/selftests/nolibc/Makefile.nolibc | 12

[PATCH 2/2] selftests/nolibc: add x32 test configuration

2025-07-12 Thread Thomas Weißschuh
Nolibc supports the x32 ABI on x86. Add a testcase to make sure the support stays functional. QEMU user does not have support for x32, so skip the test there. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile.nolibc | 12 tools/testing/selftests/nolibc

Re: [PATCH v2 0/3] module: make structure definitions always visible

2025-07-11 Thread Thomas Weißschuh
On Fri, Jul 11, 2025 at 03:39:04PM +0200, Daniel Gomez wrote: > > On Fri, 11 Jul 2025 15:31:35 +0200, Thomas Weißschuh wrote: > > Code using IS_ENABLED(CONFIG_MODULES) as a C expression may need access > > to the module structure definitions to compile. > > Make sure the

[PATCH v2 3/3] kunit: test: Drop CONFIG_MODULE ifdeffery

2025-07-11 Thread Thomas Weißschuh
The function stubs exposed by module.h allow the code to compile properly without the ifdeffery. The generated object code stays the same, as the compiler can optimize away all the dead code. As the code is still typechecked developer errors can be detected faster. Signed-off-by: Thomas Weißschuh

[PATCH v2 1/3] module: move 'struct module_use' to internal.h

2025-07-11 Thread Thomas Weißschuh
The struct was moved to the public header file in commit c8e21ced08b3 ("module: fix kdb's illicit use of struct module_use."). Back then the structure was used outside of the module core. Nowadays this is not true anymore, so the structure can be made internal. Signed-off-by: T

[PATCH v2 2/3] module: make structure definitions always visible

2025-07-11 Thread Thomas Weißschuh
need to be visible, too. Many structure members are still gated by specific configuration settings. The assumption for those is that the code using them will be gated behind the same configuration setting anyways. Signed-off-by: Thomas Weißschuh Reviewed-by: Daniel Gomez --- include/linux/mod

[PATCH v2 0/3] module: make structure definitions always visible

2025-07-11 Thread Thomas Weißschuh
o the module subsys") from the sysctl tree, but the resolution is trivial. Signed-off-by: Thomas Weißschuh --- Changes in v2: - Pick up tags from v1 - Keep MODULE_ARCH_INIT and 'struct module' definitions together - Link to v1: https://lore.kernel.org/r/20250612-kunit-ifdef-mo

Re: [PATCH 2/3] module: make structure definitions always visible

2025-07-10 Thread Thomas Weißschuh
CH depends on CONFIG_MODULES in kconfig then IS_ENABLED(CONFIG_LIVEPATCH) will depend on CONFIG_MODULES automatically. There is no need for another explicit IS_ENABLED(CONFIG_MODULES). > > > > Signed-off-by: Thomas Weißschuh > > --- > > include/linux/module.h | 23 +++

Re: [PATCH] vdso/gettimeofday: Fix code refactoring

2025-07-09 Thread Thomas Weißschuh
Hi Marek, On Thu, Jul 10, 2025 at 08:22:49AM +0200, Marek Szyprowski wrote: > Commit fcc8e46f768f ("vdso/gettimeofday: Return bool from clock_gettime() > helpers") changed the return value from clock_gettime() helpers, but it > missed updating the one call to the do_hres() function, what breaks VD

Re: [PATCH 06/14] vdso/gettimeofday: Return bool from clock_gettime() helpers

2025-07-09 Thread Thomas Weißschuh
Hi Marek, On Tue, Jul 08, 2025 at 05:49:18PM +0200, Marek Szyprowski wrote: > On 08.07.2025 17:17, Marek Szyprowski wrote: > > On 01.07.2025 10:58, Thomas Weißschuh wrote: > >> The internal helpers are effectively using boolean results, > >> while pretending to use erro

[PATCH 5/5] selftests: vDSO: Drop vdso_test_clock_getres

2025-07-07 Thread Thomas Weißschuh
vdso_test_abi provides the exact same functionality, properly uses kselftest.h and explicitly calls into the vDSO without relying on the libc. Drop the pointless testcase. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/Makefile | 2 - .../selftests/vDSO

[PATCH 1/5] selftests: vDSO: vdso_test_abi: Use ksft_finished()

2025-07-07 Thread Thomas Weißschuh
The existing logic is just an open-coded ksft_finished(). Replace it with the real thing. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools

[PATCH 0/5] selftests: vDSO: Clean up vdso_test_abi and drop vdso_test_clock_getres

2025-07-07 Thread Thomas Weißschuh
Some cleanups for the vDSO selftests. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (5): selftests: vDSO: vdso_test_abi: Use ksft_finished() selftests: vDSO: vdso_test_abi: Drop clock availability tests selftests: vDSO: vdso_test_abi: Use explicit indices for name array

[PATCH 4/5] selftests: vDSO: vdso_test_abi: Test CPUTIME clocks

2025-07-07 Thread Thomas Weißschuh
As the framework is already there anyways also test the CPUTIME clocks. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/selftests

[PATCH 2/5] selftests: vDSO: vdso_test_abi: Drop clock availability tests

2025-07-07 Thread Thomas Weißschuh
pointless checks. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 24 1 file changed, 24 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/selftests/vDSO/vdso_test_abi.c index

[PATCH 3/5] selftests: vDSO: vdso_test_abi: Use explicit indices for name array

2025-07-07 Thread Thomas Weißschuh
The array relies on the numeric values of the clock IDs. When reading the code it is not obvious that the order is correct. Make the code easier to read by using explicit indices. While at it make the array static. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO

Re: [PATCH] selftests/arm64: Prevent build warnings from -Wmaybe-uninitialized

2025-07-07 Thread Thomas Weißschuh
Hi Anshuman, On Wed, Jun 25, 2025 at 03:01:38AM +0100, Anshuman Khandual wrote: > Arguments passed into WEXITSTATUS() should have been initialized earlier. > Otherwise following warning show up while building platform selftests on > arm64. Hence just zero out all the relevant local variables to av

Re: [PATCH 14/14] selftests/timers/auxclock: Test vDSO functionality

2025-07-07 Thread Thomas Weißschuh
On Sun, Jul 06, 2025 at 10:26:31PM +0200, Thomas Gleixner wrote: > On Tue, Jul 01 2025 at 10:58, Thomas Weißschuh wrote: > > > Extend the auxclock test to also cover the vDSO. > > I'm not really convinved, that this is the right thing to do. Why can't > this just e

Re: [PATCH 13/14] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers"

2025-07-06 Thread Thomas Weißschuh
On Sun, Jul 06, 2025 at 10:43:47PM +0200, Thomas Gleixner wrote: > On Tue, Jul 01 2025 at 10:58, Thomas Weißschuh wrote: > > This reverts commit c9fbaa879508 ("selftests: vDSO: parse_vdso: Use UAPI > > headers instead of libc headers") > > > > The kernel h

Re: [PATCH] tools/nolibc: add support for clock_nanosleep() and nanosleep()

2025-07-06 Thread Thomas Weißschuh
On 2025-07-06 08:26:33+0200, Willy Tarreau wrote: > On Fri, Jul 04, 2025 at 04:19:48PM +0200, Thomas Weißschuh wrote: > > +static __attribute__((unused)) > > +int sys_clock_nanosleep(clockid_t clockid, int flags, const struct > > timespec *rqtp, > > +

[PATCH] tools/nolibc: add support for clock_nanosleep() and nanosleep()

2025-07-04 Thread Thomas Weißschuh
Also add some tests. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/time.h | 34 tools/testing/selftests/nolibc/nolibc-test.c | 1 + 2 files changed, 35 insertions(+) diff --git a/tools/include/nolibc/time.h b/tools/include/nolibc/time.h

[PATCH 1/2] selftests/nolibc: create /dev/full when running as PID 1

2025-07-04 Thread Thomas Weißschuh
An upcoming testcase will use /dev/full. Make sure it is always present. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing

[PATCH 0/2] selftests/nolibc: correctly report errors from printf() and friends

2025-07-04 Thread Thomas Weißschuh
When an error is encountered by printf() it needs to be reported. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (2): selftests/nolibc: create /dev/full when running as PID 1 selftests/nolibc: correctly report errors from printf() and friends tools/include/nolibc/stdio.h

[PATCH 2/2] selftests/nolibc: correctly report errors from printf() and friends

2025-07-04 Thread Thomas Weißschuh
Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/stdio.h | 4 ++-- tools/testing/selftests/nolibc/nolibc-test.c | 23 +++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/std

Re: [PATCH v3 0/4] kselftest/arm64: Add coverage for the interaction of vfork() and GCS

2025-07-04 Thread Thomas Weißschuh
On 2025-07-03 17:00:14+0100, Mark Brown wrote: > I had cause to look at the vfork() support for GCS and realised that we > don't have any direct test coverage, this series does so by adding > vfork() to nolibc and then using that in basic-gcs to provide some > simple vfork() coverage. Thanks. I ap

[PATCH 05/14] vdso/gettimeofday: Return bool from clock_getres() helpers

2025-07-01 Thread Thomas Weißschuh
The internal helpers are effectively using boolean results, while pretending to use error numbers. Switch the return type to bool for more clarity. Signed-off-by: Thomas Weißschuh --- lib/vdso/gettimeofday.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff

[PATCH 13/14] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers"

2025-07-01 Thread Thomas Weißschuh
re not possible build parse_vdso.c as part of the same compilation unit as its caller as sys/auxv.h is needed for getauxval(). In the meantime nolibc gained its own elf.h, providing compatibility with the documented libc interfaces. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/M

[PATCH 12/14] vdso/gettimeofday: Add support for auxiliary clocks

2025-07-01 Thread Thomas Weißschuh
Expose the auxiliary clocks through the vDSO. Architectures not using the generic vDSO time framework, namely SPARC64, are not supported. Signed-off-by: Thomas Weißschuh --- include/vdso/datapage.h | 2 ++ lib/vdso/gettimeofday.c | 49 - 2 files

[PATCH 14/14] selftests/timers/auxclock: Test vDSO functionality

2025-07-01 Thread Thomas Weißschuh
Extend the auxclock test to also cover the vDSO. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/timers/auxclock.c | 95 +-- 1 file changed, 91 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/timers/auxclock.c b/tools/testing

[PATCH 09/14] vdso/gettimeofday: Introduce vdso_get_timestamp()

2025-07-01 Thread Thomas Weißschuh
This code is duplicated and with the introduction of auxiliary clocks will be duplicated even more. Introduce a helper. Signed-off-by: Thomas Weißschuh --- lib/vdso/gettimeofday.c | 43 --- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a

[PATCH 11/14] vdso/vsyscall: Update auxiliary clock data in the datapage

2025-07-01 Thread Thomas Weißschuh
Expose the auxiliary clock data so it can be read from the vDSO. Architectures not using the generic vDSO time framework, namely SPARC64, are not supported. Signed-off-by: Thomas Weißschuh --- include/linux/timekeeper_internal.h | 13 include/vdso/datapage.h | 3

[PATCH 10/14] vdso: Introduce aux_clock_resolution_ns()

2025-07-01 Thread Thomas Weißschuh
Move the constant resolution to a shared header, so the vDSO can use it and return it without going through a syscall. Signed-off-by: Thomas Weißschuh --- include/vdso/auxclock.h | 13 + kernel/time/timekeeping.c | 6 -- 2 files changed, 17 insertions(+), 2 deletions(-) diff

[PATCH 08/14] vdso/gettimeofday: Introduce vdso_set_timespec()

2025-07-01 Thread Thomas Weißschuh
This code is duplicated and with the introduction of auxiliary clocks will be duplicated even more. Introduce a helper. Signed-off-by: Thomas Weißschuh --- lib/vdso/gettimeofday.c | 32 ++-- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/lib/vdso

[PATCH 07/14] vdso/gettimeofday: Introduce vdso_clockid_valid()

2025-07-01 Thread Thomas Weißschuh
With the upcoming addition of auxiliary clocks the clockid validation will become more complicated. Split it into a dedicated function to keep the code readable. Signed-off-by: Thomas Weißschuh --- lib/vdso/gettimeofday.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff

[PATCH 06/14] vdso/gettimeofday: Return bool from clock_gettime() helpers

2025-07-01 Thread Thomas Weißschuh
The internal helpers are effectively using boolean results, while pretending to use error numbers. Switch the return type to bool for more clarity. Signed-off-by: Thomas Weißschuh --- lib/vdso/gettimeofday.c | 58 + 1 file changed, 30 insertions

[PATCH 03/14] vdso/vsyscall: Split up __arch_update_vsyscall() into __arch_update_vdso_clock()

2025-07-01 Thread Thomas Weißschuh
The upcoming auxiliary clocks need this hook, too. To separate the architecture hooks from the timekeeper internals, refactor the hook to only operate on a single vDSO clock. While at it, use a more robust #define for the hook override. Signed-off-by: Thomas Weißschuh --- arch/arm64/include

[PATCH 01/14] selftests/timers: Add testcase for auxiliary clocks

2025-07-01 Thread Thomas Weißschuh
Auxiliary clocks behave differently from regular ones. Add a testcase to validate their functionality. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/timers/.gitignore | 1 + tools/testing/selftests/timers/Makefile | 2 +- tools/testing/selftests/timers/auxclock.c | 319

[PATCH 00/14] vdso: Add support for auxiliary clocks

2025-07-01 Thread Thomas Weißschuh
t;tools headers: Synchronize linux/bits.h with the kernel sources"). Another fix for this is pending [0] and should make it into v6.16. [0] https://lore.kernel.org/lkml/20250630-uapi-genmask-v1-1-eb0ad956a...@linutronix.de/ Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (14): selftests/

[PATCH 02/14] vdso/vsyscall: Introduce a helper to fill clock configurations

2025-07-01 Thread Thomas Weißschuh
The logic to configure a 'struct vdso_clock' from a 'struct tk_read_base' is copied two times. Split it into a shared function to reduce the duplication, especially as another user will be added for auxiliary clocks. Signed-off-by: Thomas Weißschuh --- kernel/

[PATCH 04/14] vdso/helpers: Add helpers for seqlocks of single vdso_clock

2025-07-01 Thread Thomas Weißschuh
Auxiliary clocks will have their vDSO data in a dedicated 'struct vdso_clock', which needs to be synchronized independently. Add a helper to synchronize a single vDSO clock. Signed-off-by: Thomas Weißschuh --- include/vdso/helpers.h | 40 +++- 1 fi

[PATCH] kunit: Enable PCI on UML without triggering WARN()

2025-06-27 Thread Thomas Weißschuh
IG_UML_PCI which itself is not directly configurable. Instead of going through CONFIG_UML_PCI_OVER_VIRTIO, introduce a custom configuration option which enables CONFIG_UML_PCI without triggering warnings or building dead code. Signed-off-by: Thomas Weißschuh --- lib/kunit/Kconfig

Re: [PATCH 0/3] tools/nolibc: add support for SuperH

2025-06-25 Thread Thomas Weißschuh
Hi Rob, On 2025-06-24 21:41:14-0500, Rob Landley wrote: > On 6/9/25 04:28, Thomas Weißschuh wrote: > > Add support for SuperH/"sh" to nolibc. > > Only sh4 is tested for now. > > > > This is only tested on QEMU so far. > > Additional testing would be v

Re: [PATCH 3/4] selftests/nolibc: rename Makefile

2025-06-23 Thread Thomas Weißschuh
On 2025-06-21 10:47:39+0200, Willy Tarreau wrote: > On Sat, Jun 21, 2025 at 10:34:38AM +0200, Thomas Weißschuh wrote: > > On 2025-06-21 06:14:21+0200, Willy Tarreau wrote: > > > Hi Thomas, > > > > > > On Fri, Jun 20, 2025 at 11:39:32PM +0200, Thomas Weißschuh

[PATCH v2 3/3] tools/nolibc: add support for SuperH

2025-06-23 Thread Thomas Weißschuh
rrupts "sp". __builtin_unreachable() is necessary for __attribute__((noreturn)). Also depending on compiler flags (for example -fPIC) even more prologue is generated. Work around this by defining a nested function in asm. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70216 Signed-off-by: Thomas

[PATCH v3 3/4] tools/nolibc: MIPS: drop noreorder option

2025-06-23 Thread Thomas Weißschuh
.org/lkml/alpine.deb.2.21.2502172208570.65...@angie.orcam.me.uk/ Signed-off-by: Thomas Weißschuh Tested-by: Sebastian Andrzej Siewior --- tools/include/nolibc/arch-mips.h | 4 1 file changed, 4 deletions(-) diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/noli

[PATCH] selftests/nolibc: avoid GCC 15 -Wunterminated-string-initialization

2025-06-23 Thread Thomas Weißschuh
rs. Fixes: 1063649cf531 ("selftests/nolibc: Add tests for strlcat() and strlcpy()") Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/sel

[PATCH v2 1/3] selftests/nolibc: fix EXTRACONFIG variables ordering

2025-06-23 Thread Thomas Weißschuh
The variable block got disordered at some point. Use the correct ordering. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile.nolibc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc

[PATCH v3 2/4] tools/nolibc: MIPS: drop manual stack pointer alignment

2025-06-23 Thread Thomas Weißschuh
.2.21.2502161523290.65...@angie.orcam.me.uk/ Signed-off-by: Thomas Weißschuh Tested-by: Sebastian Andrzej Siewior --- tools/include/nolibc/arch-mips.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/include/nolibc/arch-mips.h b/tools/include/nolibc/arch-mips.h index

[PATCH v3 1/4] tools/nolibc: MIPS: drop $gp setup

2025-06-23 Thread Thomas Weißschuh
t;. Remove the unnecessary $gp setup, simplifying the code and opening the road for some other cleanups. Suggested-by: Maciej W. Rozycki Link: https://lore.kernel.org/lkml/alpine.deb.2.21.2502172208570.65...@angie.orcam.me.uk/ Signed-off-by: Thomas Weißschuh Tested-by: Sebastian Andrzej

[PATCH v3 4/4] tools/nolibc: MIPS: add support for N64 and N32 ABIs

2025-06-23 Thread Thomas Weißschuh
Add support for the MIPS 64bit N64 and ILP32 N32 ABIs. In addition to different byte orders and ABIs there are also different releases of the MIPS architecture. To avoid blowing up the test matrix, only add a subset of all possible test combinations. Signed-off-by: Thomas Weißschuh Tested-by

[PATCH v3 0/4] tools/nolibc: MIPS: entrypoint cleanups and N32/N64 ABIs

2025-06-23 Thread Thomas Weißschuh
Introduce support for the N32 and N64 ABIs. As preparation, the entrypoint is first simplified significantly. Thanks to Maciej for all the valuable information. Signed-off-by: Thomas Weißschuh --- Changes in v3: - Rebase onto latest nolibc-next - Link to v2: https://lore.kernel.org/r/20250225

[PATCH v2 2/3] selftests/nolibc: use file driver for QEMU serial

2025-06-23 Thread Thomas Weißschuh
s sufficient for the nolibc-test usecase. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau --- tools/testing/selftests/nolibc/Makefile.nolibc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile.nolibc b/tools/testing/selftests/no

[PATCH v2 0/3] tools/nolibc: add support for SuperH

2025-06-23 Thread Thomas Weißschuh
olibc-test nolibc-test: ELF 32-bit LSB executable, Renesas SH, version 1 (SYSV), statically linked, not stripped $ ./nolibc-test Running test 'startup' 0 argc = 1[OK] ... Total number of errors: 0 Exiting with status 0 Signed-off-

Re: [PATCH 3/4] selftests/nolibc: rename Makefile

2025-06-21 Thread Thomas Weißschuh
On 2025-06-21 06:14:21+0200, Willy Tarreau wrote: > Hi Thomas, > > On Fri, Jun 20, 2025 at 11:39:32PM +0200, Thomas Weißschuh wrote: > > The nolibc tests are not real kselftests, they work differently and > > provide a different interface. Users trying to use them like real

[PATCH 4/4] selftests/nolibc: integrate with kselftests

2025-06-20 Thread Thomas Weißschuh
Hook up nolibc-test with the kselftests framework. This enables CI systems and developers to easily execute the tests. While nolibc-test does not emit KTAP output itself that is not a problem, as the kselftest executor will wrap the output in KTAP. Signed-off-by: Thomas Weißschuh --- tools

[PATCH 3/4] selftests/nolibc: rename Makefile

2025-06-20 Thread Thomas Weißschuh
the way. The custom tests are still useful to keep as they provide functionality not provided by kselftests. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/{Makefile => Makefile.nolibc} | 0 tools/testing/selftests/nolibc/run-tests.sh | 2 +- 2 files chan

[PATCH 2/4] selftests/nolibc: split out CFLAGS logic

2025-06-20 Thread Thomas Weißschuh
Some upcoming changes will reuse the CFLAGS. Split the computation into a reusable Makefile. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 12 tools/testing/selftests/nolibc/Makefile.include | 10 ++ 2 files changed, 14 insertions

[PATCH 0/4] selftests/nolibc: integrate with kselftests

2025-06-20 Thread Thomas Weißschuh
Hook up nolibc-test with the kselftests framework. This enables CI systems and developers to easily execute the tests. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (4): selftests/nolibc: drop implicit defconfig executions selftests/nolibc: split out CFLAGS logic

[PATCH 1/4] selftests/nolibc: drop implicit defconfig executions

2025-06-20 Thread Thomas Weißschuh
d-by: Mark Brown Closes: https://lore.kernel.org/all/3d5128b9-b4b6-4a8e-94ce-ea5ff4ea6...@sirena.org.uk/ Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/nolibc/Makefile b/too

[PATCH] selftests: vDSO: fix -Wunitialized in powerpc VDSO_CALL() wrapper

2025-06-18 Thread Thomas Weißschuh
ot Closes: https://lore.kernel.org/oe-kbuild-all/202506180223.book5jdk-...@intel.com/ Fixes: 6eda706a535c ("selftests: vDSO: fix the way vDSO functions are called for powerpc") Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/vdso_call.h | 7 +++ 1 file changed, 3

Re: [PATCH 3/3] kunit: test: Drop CONFIG_MODULE ifdeffery

2025-06-17 Thread Thomas Weißschuh
On Tue, Jun 17, 2025 at 09:44:49AM +0200, Petr Pavlu wrote: > On 6/12/25 4:53 PM, Thomas Weißschuh wrote: > > The function stubs exposed by module.h allow the code to compile properly > > without the ifdeffery. The generated object code stays the same, as the > > compiler can

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-12 Thread Thomas Weißschuh
On Thu, Jun 12, 2025 at 11:58:01AM -0300, Jason Gunthorpe wrote: > On Thu, Jun 12, 2025 at 04:27:41PM +0200, Thomas Weißschuh wrote: > > > If the assumption is that this is most likely a kernel bug, > > shouldn't it be fixed properly rather than worked around? > > Af

[PATCH 3/3] kunit: test: Drop CONFIG_MODULE ifdeffery

2025-06-12 Thread Thomas Weißschuh
The function stubs exposed by module.h allow the code to compile properly without the ifdeffery. The generated object code stays the same, as the compiler can optimize away all the dead code. As the code is still typechecked developer errors can be detected faster. Signed-off-by: Thomas Weißschuh

[PATCH 1/3] module: move 'struct module_use' to internal.h

2025-06-12 Thread Thomas Weißschuh
The struct was moved to the public header file in commit c8e21ced08b3 ("module: fix kdb's illicit use of struct module_use."). Back then the structure was used outside of the module core. Nowadays this is not true anymore, so the structure can be made internal. Signed-off-by: T

[PATCH 2/3] module: make structure definitions always visible

2025-06-12 Thread Thomas Weißschuh
need to be visible, too. Many structure members are still gated by specific configuration settings. The assumption for those is that the code using them will be gated behind the same configuration setting anyways. Signed-off-by: Thomas Weißschuh --- include/linux/module.h | 23 -

[PATCH 0/3] module: make structure definitions always visible

2025-06-12 Thread Thomas Weißschuh
Code using IS_ENABLED(CONFIG_MODULES) as a C expression may need access to the module structure definitions to compile. Make sure these structure definitions are always visible. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (3): module: move 'struct module_use' to

Re: [PATCH v4 09/14] selftests: harness: Move teardown conditional into test metadata

2025-06-12 Thread Thomas Weißschuh
On Thu, Jun 12, 2025 at 10:58:02AM -0300, Jason Gunthorpe wrote: > On Wed, Jun 11, 2025 at 11:59:00PM -0700, Nicolin Chen wrote: > > > We can see the 64MB was rounded up to 512MB by ksys_mmap_pgoff() > > when being passed in to hugetlb_file_setup() at: > > https://git.kernel.org/pub/scm/linux/kern

[PATCH v3 1/9] selftests: vDSO: chacha: Correctly skip test if necessary

2025-06-11 Thread Thomas Weißschuh
implemented on architecture The SKIP line should start with "ok 1" as the plan only contains one test. Fixes: 3b5992eaf730 ("selftests: vDSO: unconditionally build chacha test") Reviewed-by: Muhammad Usama Anjum Signed-off-by: Thomas Weißschuh --- I'm not sure if thi

[PATCH v4 1/2] MIPS: Don't crash in stack_top() for tasks without ABI or vDSO

2025-06-11 Thread Thomas Weißschuh
point if it is set. The GIC page is also included as it is specific to the vDSO. Also move the randomization adjustment into the same conditional. Signed-off-by: Thomas Weißschuh Reviewed-by: David Gow --- arch/mips/kernel/process.c | 16 +--- 1 file changed, 9 insertions(+), 7

[PATCH v4 2/2] kunit: qemu_configs: Add MIPS configurations

2025-06-11 Thread Thomas Weißschuh
Add basic support to run various MIPS variants via kunit_tool using the virtualized malta platform. Signed-off-by: Thomas Weißschuh Reviewed-by: David Gow --- tools/testing/kunit/qemu_configs/mips.py | 18 ++ tools/testing/kunit/qemu_configs/mips64.py | 19

[PATCH v4 0/2] kunit: qemu_configs: Add MIPS configurations

2025-06-11 Thread Thomas Weißschuh
Add basic support to run various MIPS variants via kunit_tool using the virtualized malta platform. Signed-off-by: Thomas Weißschuh --- Changes in v4: - Rebase on v6.16-rc1 - Pick up reviews from David - Clarify that GIC page is linked to vDSO - Link to v3: https://lore.kernel.org/r/20250415

[PATCH v3 7/9] selftests: vDSO: vdso_test_correctness: Fix -Wstrict-prototypes

2025-06-11 Thread Thomas Weißschuh
use an empty argument list. Now that all selftests a free of this warning, enable it in the Makefile. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/Makefile| 2 +- tools/testing/selftests/vDSO/vdso_test_correctness.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH v3 3/9] selftests: vDSO: vdso_test_getrandom: Drop unused include of linux/compiler.h

2025-06-11 Thread Thomas Weißschuh
The header is unused. Furthermore this is not a real UAPI header, but only exists in tools/include/. This prevents building the selftest against real UAPI headers. Drop the include. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/vdso_test_getrandom.c | 1 - 1 file changed, 1

[PATCH v3 9/9] selftests: vDSO: vdso_standalone_test_x86: Replace source file with symlink

2025-06-11 Thread Thomas Weißschuh
ned-off-by: Thomas Weißschuh --- If symlinks are problematic an #include shim would also work. These are not handled really well by the kselftests build system though, as #include dependencies are not tracked by it. --- .../selftests/vDSO/vdso_standalone_test_x86.c | 59 +---

[PATCH v3 8/9] selftests: vDSO: vdso_test_getrandom: Always print TAP header

2025-06-11 Thread Thomas Weißschuh
The TAP specification requires that the output begins with a header line. If vgetrandom_init() fails and skips the test, that header line is missing. Call vgetrandom_init() after ksft_print_header(). Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests

  1   2   3   4   5   6   >