Commit Graph
100 Commits
Author SHA1 Message Date
Thomas Weißschuh 057caace52 tracing: Create output file from cmd_check_undefined
As the output file is currently never created, the check will run every
time, even if the inputs have not changed.

Create an empty output file which allows make to skip the execution when
it is not necessary.

Cc: Masami Hiramatsu <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Vincent Donnefort <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/20260520-tracing-ringbuffer-check-v1-1-d979cfab1338@weissschuh.net
Fixes: 1211907ac0 ("tracing: Generate undef symbols allowlist for simple_ring_buffer")
Fixes: 58b4bd1839 ("tracing: Adjust cmd_check_undefined to show unexpected undefined symbols")
Reviewed-by: Nathan Chancellor <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
2026-05-21 08:31:55 -04:00
Thomas Weißschuh 75f7c47ccd kbuild: Never respect CONFIG_WERROR / W=e to fixdep
The fixdep hostprog may be built multiple times during a single build.
Once during the configuration phase and later during the regular phase.
As only the regular build phase respects CONFIG_WERROR / W=e, the
compiler flags might change between the phases, leading to rebuilds.

Example, the rebuilds will happen twice on each invocation of the build:

  $ make allyesconfig prepare
  make[1]: Entering directory '/tmp/deleteme'
    HOSTCC  scripts/basic/fixdep
  #
  # No change to .config
  #
    HOSTCC  scripts/basic/fixdep
    DESCEND objtool
    INSTALL libsubcmd_headers
  make[1]: Leaving directory '/tmp/deleteme'

Fix the compilation flags used for scripts/basic/ before
scripts/Makefile.warn is evaluated to stop CONFIG_WERROR / W=e
influencing the fixdep build to avoid the spurious rebuilds.

Fixes: 7ded7d37e5 ("scripts/Makefile.extrawarn: Respect CONFIG_WERROR / W=e for hostprogs")
Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/20260422-kbuild-scripts-basic-werror-v1-1-8c6912ff22e0@weissschuh.net
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-24 13:57:48 +02:00
Thomas Weißschuh 9ce4a8c07b sysfs: attribute_group: Respect is_visible_const() when changing owner
The call to grp->is_visible in sysfs_group_attrs_change_owner() was
missed when support for is_visible_const() was added.

Check for both is_visible variants there too.

Fixes: 7dd9fdb493 ("sysfs: attribute_group: enable const variants of is_visible()")
Cc: [email protected]
Reported-by: Michael Kelley <[email protected]>
Closes: https://lore.kernel.org/lkml/SN6PR02MB4157D5F04608E4E3C21AB56ED45EA@SN6PR02MB4157.namprd02.prod.outlook.com/
Link: https://sashiko.dev/#/patchset/20260403-sysfs-const-hv-v2-0-8932ab8d41db%40weissschuh.net
Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Michael Kelley <[email protected]>
Link: https://patch.msgid.link/20260403-sysfs-is_visible_const-fix-v1-1-f87f26071d2c@weissschuh.net
Signed-off-by: Danilo Krummrich <[email protected]>
2026-04-11 15:57:54 +02:00
Thomas Weißschuh 3023c050af hwmon: (powerz) Avoid cacheline sharing for DMA buffer
Depending on the architecture the transfer buffer may share a cacheline
with the following mutex. As the buffer may be used for DMA, that is
problematic.

Use the high-level DMA helpers to make sure that cacheline sharing can
not happen.

Also drop the comment, as the helpers are documentation enough.

https://sashiko.dev/#/message/20260408175814.934BFC19421%40smtp.kernel.org

Fixes: 4381a36abd ("hwmon: add POWER-Z driver")
Cc: [email protected] # ca085faabb: dma-mapping: add __dma_from_device_group_begin()/end()
Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
2026-04-10 08:33:08 -07:00
Thomas Weißschuh b070dc3629 selftests/nolibc: use gcc 15
Newer compilers tend to detect more problematic code.

Update the testsuite to use gcc 15.2.0 by default.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-09 23:25:45 +02:00
Thomas Weißschuh 3495279d05 tools/nolibc: support UBSAN on gcc
The UBSAN implementation in gcc requires a slightly different function
attribute to skip instrumentation.

Extend __nolibc_no_sanitize_undefined to also handle gcc.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-09 23:25:40 +02:00
Thomas Weißschuh 08ab958072 tools/nolibc: create __nolibc_no_sanitize_ubsan
The logic to disable UBSAN will become a bit more complicated.
Move it out into compiler.h, so crt.h stays readable.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-09 23:25:35 +02:00
Thomas Weißschuh 3d39be2a76 HID: drop 'default !EXPERT' from tristate symbols
There is no reason to build random drivers for obscure hardware into the
core kernel by default.

The usages of 'default !EXPERT' for the HID_PICOLCD suboptions are kept,
as these make some sense, although they probably should use 'default y'.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
2026-04-09 17:53:26 +02:00
Thomas Weißschuh 1a2f61970a scsi: libsas: Delete unused to_dom_device() and to_dev_attr()
These macros are unused and to_dev_attr() will conflict with an upcoming
centralization of general attribute macros.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: John Garry <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>
2026-04-08 21:55:51 -04:00
Thomas Weißschuh 598b670af3 selftests/nolibc: don't skip tests for unimplemented syscalls anymore
The automatic skipping of tests on ENOSYS returns was introduced in
commit 349afc8a52 ("selftests/nolibc: skip tests for unimplemented
syscalls"). It handled the fact that nolibc would return ENOSYS for many
syscall wrappers on riscv32.

Nowadays nolibc handles all these correctly, so this logic is not used
anymore. To make missing nolibc functionality more obvious fail the
tests again if something is not implemented.

Revert the mentioned commit again.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]/
2026-04-07 09:29:26 +02:00
Thomas Weißschuh 9a5206f256 selftests/nolibc: explicitly handle ENOSYS from ptrace()
The automatic ENOSYS handling in EXPECT_SYSER() is about to be removed.
ptrace() will return legitimately return ENOSYS on qemu-user, so handle
it explicitly.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]/
2026-04-07 09:28:32 +02:00
Thomas Weißschuh ce834c9cb9 tools/nolibc: add byteorder conversions
Add some standard functions to convert between different byte orders.
Conveniently the UAPI headers provide all the necessary functionality.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-07 09:27:25 +02:00
Thomas Weißschuh 2eb64b936d tools/nolibc: add the _syscall() macro
The standard syscall() function or macro uses the libc return value
convention. Errors returned from the kernel as negative values are
stored in errno and -1 is returned. Users who want to avoid using
errno don't have a way to call raw syscalls and check the returned
error.

Add a new macro _syscall() which works like the standard syscall()
but passes through the return value from the kernel unchanged.
The naming scheme and return values match the named _sys_foo()
system call wrappers already part of nolibc.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-07 09:27:07 +02:00
Thomas Weißschuh 022bbb5a41 tools/nolibc: move the call to __sysret() into syscall()
__sysret() transforms the return value from the kernel into the libc
return value convention. There is no reason for it to be called in the
middle of the internals of the syscall() implementation macros.

Move the call up, directly into syscall(), to make the code simpler.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-07 09:27:02 +02:00
Thomas Weißschuh 3f5059f01d tools/nolibc: rename the internal macros used in syscall()
These macros are the internal implementation of syscall().
They can not be used by users. Align them with the standard naming
scheme for internal symbols.

The current name also prevents the addition of an application-usable
_syscall() symbol.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-07 09:26:57 +02:00
Thomas Weißschuh 08b96aa962 selftests/nolibc: only use libgcc when really necessary
nolibc should work without libgcc to be compatible with as many
toolchains as possible. Currently the functionality tested by
nolibc-test does not contain any dependencies, make sure it stays
this way by not linking libgcc anymore.

On the ppc target GCC always emits references to '_restgpr_' functions,
so keep linking libgcc there.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-06 19:46:54 +02:00
Thomas Weißschuh e70a7bb575 selftests/nolibc: test the memory allocator
The memory allocator has not seen any testing so far.

Add a simple testcase for it.

Suggested-by: Willy Tarreau <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]/
Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-06 19:46:52 +02:00
Thomas Weißschuh 1e3c374e9f tools/nolibc: check for overflow in calloc() without divisions
On some architectures without native division instructions
the division can generate calls into libgcc/compiler-rt.
This library might not be available, so its use should be avoided.

Use the compiler builtin to check for overflows without needing a
division. The builtin has been available since GCC 3 and clang 3.8.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-06 19:46:52 +02:00
Thomas Weißschuh 12496aad10 tools/nolibc: add support for asprintf()
Add support for dynamically allocating formatted strings through
asprintf() and vasprintf().

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-06 19:46:51 +02:00
Thomas Weißschuh c7c55f0e16 checksyscalls: move instance functionality into generic code
On MIPS the checksyscalls.sh script may be executed multiple times.
Currently these multiple executions are executed on each build as kbuild
see that the commands have changed each time.

Use a dedicated stamp file for each different invocation to avoid the
spurious executions.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Link: https://patch.msgid.link/20260402-kbuild-missing-syscalls-v3-3-6641be1de2db@weissschuh.net
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-05 09:21:32 +02:00
Thomas Weißschuh b34db3fa85 checksyscalls: only run when necessary
Currently checksyscalls.sh is unconditionally executed during each build.
Most of these executions are unnecessary.

Only run checksyscalls.sh if one of its inputs have changed.

This new logic does not work for the multiple invocations done for MIPS.
The effect is that checksyscalls.sh is still executed unconditionally.
However this is not worse than before.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Link: https://patch.msgid.link/20260402-kbuild-missing-syscalls-v3-2-6641be1de2db@weissschuh.net
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-05 09:21:31 +02:00
Thomas Weißschuh e856b6ca14 checksyscalls: fail on all intermediate errors
Make sure that a failure of any intermediate step also fails the
overall execution.

Link: https://sashiko.dev/#/patchset/20260402-kbuild-missing-syscalls-v3-0-6641be1de2db%40weissschuh.net
Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-05 09:21:30 +02:00
Thomas Weißschuh 9fba6131ae checksyscalls: move path to reference table to a variable
An upcoming patch will need to reuse this path.

Move it into a reusable variable.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Link: https://patch.msgid.link/20260402-kbuild-missing-syscalls-v3-1-6641be1de2db@weissschuh.net
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-05 09:21:23 +02:00
Thomas Weißschuh fd2e9f8200 tools/nolibc: use __builtin_offsetof()
The current custom implementation of offsetof() fails UBSAN:
runtime error: member access within null pointer of type 'struct ...'
This means that all its users, including container_of(), free() and
realloc(), fail.

Use __builtin_offsetof() instead which does not have this issue and
has been available since GCC 4 and clang 3.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-04 10:48:14 +02:00
Thomas Weißschuh 867fb336a6 tools/nolibc: use makedev() in fstatat()
fstatat() contains two open-coded copies of makedev() to handle minor
numbers >= 256. Now that the regular makedev() handles both large minor
and major numbers correctly use the common function.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-04 10:29:07 +02:00
Thomas Weißschuh 572246dcdd tools/nolibc: handle all major and minor numbers in makedev() and friends
Remove the limitation of only handling small major and minor numbers.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-04 10:29:02 +02:00
Thomas Weißschuh df4ef52c1d tools/nolibc: make dev_t 64 bits wide
statx() returns both 32-bit minor and major numbers. For both of them to
fit into the 'dev_t' in 'struct stat', that needs to be 64 bits wide.

The other uses of 'dev_t' in nolibc are makedev() and friends and
mknod(). makedev() and friends are going to be adapted in an upcoming
commit and mknod() will silently truncate 'dev_t' to 'unsigned int' in
the kernel, similar to other libcs.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-04 10:28:57 +02:00
Thomas Weißschuh 70091eada3 tools/nolibc: move the logic of makedev() and friends into functions
Functions make it easier to keep the input and output types straight and
avoid duplicate evaluations of their arguments.

Also these functions will become a bit more complex to handle full
64-bit 'dev_t' which is easier to read in a function.

Still stay compatible with code which expects these to be macros.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-04 10:28:50 +02:00
Thomas Weißschuh 5afc7e9b90 selftests/nolibc: add a test for stat().st_rdev
The handling of 'dev_t' values is about to be changed.

Add a test to make sure they are returned correctly from stat().

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-04 10:28:44 +02:00
Thomas Weißschuh 9c0ff257fb selftests/nolibc: add some tests for makedev() and friends
These functions/macros are about to be changed.

Add some tests to make sure they continue working.
As they only handle small dev_t values, only test those for now.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-04 10:28:35 +02:00
Thomas Weißschuh 5471878477 kbuild: vdso_install: drop build ID architecture allow-list
Many architectures which do generate build IDs are missing from this
list. For example arm64, riscv, loongarch, mips.

Now that errors from readelf and binaries without any build ID are
handled gracefully, the allow-list is not necessary anymore, drop it.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-02 17:50:40 +02:00
Thomas Weißschuh e4fb234235 kbuild: vdso_install: gracefully handle images without build ID
If the vDSO does not contain a build ID, skip the symlink step.
This will allow the removal of the explicit list of architectures.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-02 17:50:39 +02:00
Thomas Weißschuh ec2137476d kbuild: vdso_install: hide readelf warnings
If 'readelf -n' encounters a note it does not recognize it emits a
warning. This for example happens when inspecting a compat vDSO for
which the main kernel toolchain was not used.
However the relevant build ID note is always readable, so the
warnings are pointless.

Hide the warnings to make it possible to extract build IDs for more
architectures in the future.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-02 17:50:39 +02:00
Thomas Weißschuh efa13f43c5 kbuild: vdso_install: split out the readelf invocation
Split up the logic as some upcoming changes to the readelf invocation
would create a very long line otherwise.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-04-02 17:50:25 +02:00
Thomas Weißschuh 7933969e1f tools/nolibc: explicitly list architecture headers
Relying on $(wildcard) is brittle and non-deterministic.

similar to all the other headers.
Switch the list of architecture headers to an explicit list,

Link: https://patch.msgid.link/[email protected]
Signed-off-by: Thomas Weißschuh <[email protected]>
2026-04-02 17:11:53 +02:00
Thomas Weißschuh b972b37cb6 tools/nolibc: drop superfluous definition of Q
Q is already defined by tools/scripts/Makefile.include which is included
at the top of tools/include/nolibc/Makefile.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-02 17:11:48 +02:00
Thomas Weißschuh 010d03d0e8 tools/nolibc: drop superfluous invocation of mkdir
The call to 'mkdir -p $(OUTPUT)sysroot/include' will also create the
sysroot directory.

Drop the unnecessary explicit invocation of mkdir.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-02 17:11:42 +02:00
Thomas Weißschuh 5bf4b30ed4 tools/nolibc: drop superfluous invocation of 'make headers'
The headers_install target of the toplevel Makefile will already make
sure that the headers are up-to-date.

Drop the superfluous explicit invocation.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-04-02 17:11:37 +02:00
Thomas Weißschuh 5247c783dc m68k: uapi: Add ucontext.h
ucontext.h should be an UAPI header as it is used for the kernel's
signal handling interface.

Move the header to the uapi/ directory.

While at it, also add some necessary includes to the new header.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Geert Uytterhoeven <[email protected]>
2026-03-30 13:47:32 +02:00
Thomas Weißschuh 9b93f7e327 tools/getdelays: use the static UAPI headers from tools/include/uapi
The include directory ../../usr/include is only present if an in-tree
kernel build with CONFIG_HEADERS_INSTALL was done before.
Otherwise the system UAPI headers are used, which most likely are not
the most recent ones.

To make sure to always have access to up-to-date UAPI headers,
use the static copy in tools/include/uapi.

Link: https://lkml.kernel.org/r/[email protected]
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]/
Signed-off-by: Thomas Weißschuh <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Balbir Singh <[email protected]>
Cc: Jiang Kun <[email protected]>
Cc: Wang Yaxin <[email protected]>
Cc: xu xin <[email protected]>
Cc: Yang Yang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2026-03-27 21:19:43 -07:00
Thomas Weißschuh e5bbb35a07 tools headers UAPI: sync linux/taskstats.h
Patch series "tools/getdelays: use the static UAPI headers from
tools/include/uapi".

The include directory ../../usr/include is only present if an in-tree
kernel build with CONFIG_HEADERS_INSTALL was done before.  Otherwise the
system UAPI headers are used, which most likely are not the most recent
ones.

To make sure to always have access to up-to-date UAPI headers, use the
static copy in tools/include/uapi.


This patch (of 2):

To give the accounting tools access to the new fields introduced in commit
503efe850c ("delayacct: add timestamp of delay max")

Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Weißschuh <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Balbir Singh <[email protected]>
Cc: Jiang Kun <[email protected]>
Cc: Wang Yaxin <[email protected]>
Cc: xu xin <[email protected]>
Cc: Yang Yang <[email protected]>
Cc: kernel test robot <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2026-03-27 21:19:43 -07:00
Thomas Weißschuh dcc99abebf kbuild: uapi: also test UAPI headers against C++ compilers
C++ language requirements differ from those of C.

Also test the headers against C++ compilers to make sure no errors
creep in accidentally.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-25 13:24:42 +01:00
Thomas Weißschuh b187c1a1a0 kbuild: uapi: provide a C++ compatible dummy definition of NULL
NULL works differently in C++ compared to C.

To allow testing the UAPI headers against C++ compilers, provide
a variant of NULL which works with those.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-25 13:24:41 +01:00
Thomas Weißschuh b4ec38cb73 kbuild: uapi: handle UML in architecture-specific exclusion lists
When building User Mode Linux SRCARCH is set to 'um', while the actual
underlying architecture is provided in HEADER_ARCH.

Allow the exclusion lists to work on UML by comparing against
HEADER_ARCH when that is available.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-25 13:24:41 +01:00
Thomas Weißschuh cf82241309 kbuild: uapi: move all include path flags together
The argument to add the root of the UAPI header tree to the include path
is separated from the other arguments concerning the include path.

Move all include path arguments together for more consistency and
balanced line lengths.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-25 13:24:40 +01:00
Thomas Weißschuh 55d68ec5b9 kbuild: uapi: move some compiler arguments out of the command definition
Simplify the definition of cmd_hdrtest by moving some of it to a new
variable. This will both enable the upcoming reuse of those flags
and also the extension of cmd_hdrtest.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-25 13:24:40 +01:00
Thomas Weißschuh 6285f0881e tools/nolibc: rename sys_foo() functions to _sys_foo()
The sys_foo() naming scheme used by the syscall wrappers may collide
with application symbols. Especially as 'sys_' is an obvious naming
scheme an application may choose for its own custom systemcall wrappers.

Avoid these conflicts by using an leading underscore which moves the
names into the implementation's namespace. This naming scheme was chosen
over a '__nolibc_' prefix, as these functions are not an implementation
detail but a documented interface meant to be used by applications.

While this may break some existing users, adapting them should be
straightforward. Given that nolibc is most-likely vendored, no
unexpected breakage should happen. No in-tree users are affected.

These conflicts happen when compiling some of the kernel selftests
with nolibc.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-22 11:03:59 +01:00
Thomas Weißschuh c8f6a4bbad selftests/nolibc: enable -Wundef
Users might use -Wundef, so also use it in the nolibc testsuite to
ensure no warnings are triggered.

The existing line with warning options is getting too long,
so move all warnings to a dedicated line.

Acked-by: Willy Tarreau <[email protected]>
Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-22 11:03:59 +01:00
Thomas Weißschuh 3eb97c4cbd tools/nolibc: avoid -Wundef warning for __STDC_VERSION__
With -std=c89 the macro __STDC_VERSION__ is not defined.
While undefined identifiers in '#if' directives are assumed to be '0',
with -Wundef a warning is emitted.

Avoid the warning by explicitly falling back to '0' if __STDC_VERSION__
is not provided by the preprocessor.

Fixes: 37219aa5b1 ("tools/nolibc: add __nolibc_static_assert()")
Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-22 11:03:58 +01:00
Thomas Weißschuh 9da0f529c0 tools/nolibc: add err.h
Add a few convenient helpers to print error and warning messages.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-22 10:40:37 +01:00
Thomas Weißschuh b74be92274 tools/nolibc: add support for program_invocation_{,short_}name
Add support for the GNU extensions 'program_invocation_name' and
'program_invocation_short_name'. These are useful to print error
messages, which by convention include the program name.

As these are global variables which take up memory even if not used,
similar to 'errno', gate them behind NOLIBC_IGNORE_ERRNO.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-22 10:40:30 +01:00
Thomas Weißschuh d1895c15fc x86/um: fix vDSO installation
The generic vDSO installation logic used by 'make vdso_install' requires
that $(vdso-install-y) is defined by the top-level architecture Makefile
and that it contains a path relative to the root of the tree.
For UML neither of these is satisfied.

Move the definition of $(vdso-install-y) to a place which is included by
the arch/um/Makefile and use the full relative path.

Fixes: f1c2bb8b99 ("um: implement a x86_64 vDSO")
Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
2026-03-21 10:43:21 +01:00
Thomas Weißschuh 5662ec000d selftests/nolibc: validate NOLIBC_IGNORE_ERRNO compilation
When NOLIBC_IGNORE_ERRNO is set, various bits of nolibc are disabled.

Make sure that all the ifdeffery does not result in any compilation
errors by compiling a dummy source file.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-20 17:58:28 +01:00
Thomas Weißschuh e290017632 selftests/nolibc: add a variable for nolibc-test source files
The list of the nolibc-test source files is repeated many times.
Another source file is about to be added, adding to the mess.

Introduce a common variable instead.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-20 17:58:27 +01:00
Thomas Weißschuh 8ba600aa57 selftests/nolibc: fix test_file_stream() on musl libc
fwrite() modifying errno is non-standard.

Only validate this behavior on those libc implementations which
implement it.

Fixes: a5f00be9b3 ("tools/nolibc: Add a simple test for writing to a FILE and reading it back")
Signed-off-by: Thomas Weißschuh <[email protected]>
2026-03-20 17:44:06 +01:00
Thomas Weißschuh 3141e0e536 blk-mq: make blk_mq_hw_ctx_sysfs_entry instances const
The blk_mq_hw_ctx_sysfs_entry structures are never modified,
mark them as const.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: John Garry <[email protected]>
Link: https://patch.msgid.link/20260316-b4-sysfs-const-attr-block-v1-4-a35d73b986b0@weissschuh.net
Signed-off-by: Jens Axboe <[email protected]>
2026-03-17 19:29:16 -06:00
Thomas Weißschuh f00d826f1b blk-crypto: make blk_crypto_attr instances const
The blk_crypto_attrs structures are never modified, mark them as const.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: John Garry <[email protected]>>
Link: https://patch.msgid.link/20260316-b4-sysfs-const-attr-block-v1-3-a35d73b986b0@weissschuh.net
Signed-off-by: Jens Axboe <[email protected]>
2026-03-17 19:29:16 -06:00
Thomas Weißschuh 3c91226309 block: ia-ranges: make blk_ia_range_sysfs_entry instances const
The blk_ia_range_sysfs_entry structures are never modified,
mark them as const.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: John Garry <[email protected]>
Link: https://patch.msgid.link/20260316-b4-sysfs-const-attr-block-v1-2-a35d73b986b0@weissschuh.net
Signed-off-by: Jens Axboe <[email protected]>
2026-03-17 19:29:16 -06:00
Thomas Weißschuh 223983874d block: make queue_sysfs_entry instances const
The queue_sysfs_entry structures are never modified, mark them as const.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: John Garry <[email protected]>
Link: https://patch.msgid.link/20260316-b4-sysfs-const-attr-block-v1-1-a35d73b986b0@weissschuh.net
Signed-off-by: Jens Axboe <[email protected]>
2026-03-17 19:29:16 -06:00
Thomas Weißschuh aa5903b47d xtensa: uapi: Reuse asm-generic ucontext.h
Drop the custom non-uapi definition which is the same as the generic
uapi one.

Signed-off-by: Thomas Weißschuh <[email protected]>
Message-ID: <[email protected]>
[Max: Move new generic-y line to the arch/xtensa/include/uapi/asm/Kbuild]
Signed-off-by: Max Filippov <[email protected]>
2026-03-14 06:56:20 -07:00
Thomas Weißschuh febb5c81fa kbuild: uapi: remove now unneeded guard headers
The test compilation does not allow usage of the toolchain headers
anymore, so these dummy headers are not needed anymore.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Nicolas Schier <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-12 12:48:09 +01:00
Thomas Weißschuh 510c7a5736 kbuild: uapi: simplify libc dependency logic
The only left user of the condition inverts it.

Invert the condition completely and simplify its user.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Nicolas Schier <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-12 12:48:08 +01:00
Thomas Weißschuh 579f103fb9 kbuild: uapi: use custom stub headers instead of libc ones
Now that custom stub headers are provided for all libc headers used from
the UAPI headers, the dependency on the toolchain libc can be dropped.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Nicolas Schier <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-12 12:48:08 +01:00
Thomas Weißschuh aad94ba683 kbuild: uapi: provide stub includes for some libc headers
Some UAPI headers incorrectly use libc headers. To compile-test these
UAPI headers, their respective libc dependencies need to be present.
Not all kernel toolchains provide these headers, reducing test coverage.

Introduce some stub headers which provide just enough symbols to test
all UAPI headers. Most headers are empty anyways, as their symbols are
only used in macros which are not actually evaluated.

As these headers are only ever used with newer kernel toolchains, they
can defer to compiler builtins in many cases.

As more UAPI headers are cleaned up to not require these stubs anymore,
they can be removed again.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Nicolas Schier <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-12 12:48:08 +01:00
Thomas Weißschuh 0ef1b7a66b kbuild: uapi: only use dummy-include for headers which use libc
The headers which do not rely on libc are using built using -nostdinc.
For them the dummy headers are pointless.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Nicolas Schier <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-12 12:48:08 +01:00
Thomas Weißschuh 60a16beedf kbuild: uapi: completely exclude linux/bpf_perf_event.h on nios2
This header is actually not buildable on nios. As nobody built nios2
with CONFIG_CC_CAN_LINK=y so far, this produced no errors.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Nicolas Schier <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-12 12:48:07 +01:00
Thomas Weißschuh 45bd8643c1 kbuild: uapi: deduplicate linux/bpf_perf_event.h exclusions
This header is excluded for multiple architectures.
Use a single exclusion for all of them.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Nicolas Schier <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-12 12:48:07 +01:00
Thomas Weißschuh a8c9d3cc23 kbuild: uapi: test linux/bpf_perf_event.h on powerpc
This header works now, so test it.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Nicolas Schier <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-12 12:48:07 +01:00
Thomas Weißschuh 4782a916f0 EDAC/mpc85xx: Constify device sysfs attributes
Now that the EDAC core allows the registration of read-only attributes,
make use of that in the mpc85xx driver.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-11 22:34:07 +01:00
Thomas Weißschuh 2f1260c893 EDAC/device: Allow addition of const sysfs attributes
The generic EDAC sysfs code does not need to modify these structs.
Allow the drivers to add read-only ones.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-11 22:33:38 +01:00
Thomas Weißschuh d2b7cdcd1d EDAC/pci_sysfs: Constify instance sysfs attributes
These structures are never modified, mark them read-only.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-11 22:26:38 +01:00
Thomas Weißschuh e72e70870a EDAC/device: Constify info sysfs attributes
These structures are never modified, mark them read-only.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-11 22:20:20 +01:00
Thomas Weißschuh 495e77a575 EDAC/device: Drop unnecessary and dangerous casts of attributes
These casts assume that the struct attribute is at the beginning of struct
edac_dev_sysfs_block_attribute. This is can silently break if the field is
moved, either manually or through struct randomization.

Use proper member syntax to get the field address and drop the casts.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-11 22:20:11 +01:00
Thomas Weißschuh c43c3b8fb3 EDAC/device: Drop unused macro to_edacdev_attr()
This macro is unused, drop it.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-11 20:58:16 +01:00
Thomas Weißschuh 04beb11c57 EDAC/altera: Drop unused field eccmgr_sysfs_attr
This field is unused, drop it.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-03-11 20:46:52 +01:00
Thomas Weißschuh d6a093c3bf usb: endpoint: drop custom sysfs attribute structure
Nowadays the USB endpoints use device attributes,
so the custom structure is unused.

Drop it.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2026-03-11 15:48:20 +01:00
Thomas Weißschuh 28c829977f dmaengine: ioatdma: make sysfs attributes const
The ioat_sysfs_entry structures are never modified, mark them as
read-only.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Dave Jiang <[email protected]>
Reviewed-by: Frank Li <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2026-03-09 08:28:21 +01:00
Thomas Weißschuh 81ca3ad09b dmaengine: ioatdma: make ioat_ktype const
ioat_ktype is never modified, so make it const.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Dave Jiang <[email protected]>
Reviewed-by: Frank Li <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2026-03-09 08:28:21 +01:00
Thomas Weißschuh bc94ca718f dmaengine: ioatdma: move sysfs entry definition out of header
Move struct ioat_sysfs_entry into sysfs.c because it is only used in it.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Frank Li <[email protected]>
Acked-by: Dave Jiang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2026-03-09 08:28:21 +01:00
Thomas Weißschuh 0124b354a4 dmaengine: ioatdma: make some sysfs structures static
These structures are only used in sysfs.c, where are defined.

Make them static and remove them from the header.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Frank Li <[email protected]>
Acked-by: Dave Jiang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
2026-03-09 08:28:21 +01:00
Thomas Weißschuh 1984dc2c2f powerpc/ima: Drop unnecessary check for CONFIG_MODULE_SIG
When CONFIG_MODULE_SIG is disabled set_module_sig_enforced() is defined
as an empty stub, so the check is unnecessary.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Mimi Zohar <[email protected]>
Reviewed-by: Aaron Tomlin <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
2026-03-08 08:26:08 -04:00
Thomas Weißschuh 658d5c72fc ima: efi: Drop unnecessary check for CONFIG_MODULE_SIG/CONFIG_KEXEC_SIG
When configuration settings are disabled the guarded functions are
defined as empty stubs, so the check is unnecessary.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Mimi Zohar <[email protected]>
Reviewed-by: Aaron Tomlin <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
[[email protected]: fixed merge conflict with commit 63e8a44395a4]
Signed-off-by: Mimi Zohar <[email protected]>
2026-03-08 08:26:08 -04:00
Thomas Weißschuh 7239ae5331 tools/build: Reject unexpected values for LLVM=
Since commit 502678b88c ("kbuild: Reject unexpected values for LLVM=")
the regular kbuild rejects unexpected values of LLVM=1 instead of
silently treating them as LLVM=1.

Align the tools build to kbuild.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-03 17:42:11 +01:00
Thomas Weißschuh 8830b2e590 Documentation/llvm: drop note about LLVM=0
Since commit 502678b88c ("kbuild: Reject unexpected values for LLVM=")
LLVM=0 generates an error instead of silently behaving unexpectedly.

Drop the now unnecessary note.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nicolas Schier <[email protected]>
2026-03-03 17:41:50 +01:00
Thomas Weißschuh 1b0b124a9c platform/x86: dell-wmi-sysman: Use standard kobj_sysfs_ops
wmi_sysman_kobj_sysfs_ops are identical to the standard kobj_sysfs_ops.

Drop the unnecessary custom copy.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/20260223-sysfs-const-dell-wmi-sysman-v1-1-8a690884044e@weissschuh.net
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
2026-03-02 18:29:08 +02:00
Thomas Weißschuh 9042e77a5c mm/slab: constify sysfs attributes
These attributes are never modified, make them read-only.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Harry Yoo <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Vlastimil Babka (SUSE) <[email protected]>
2026-02-26 15:25:06 +01:00
Thomas Weißschuh 5aa2a02b98 mm/slab: create sysfs attribute through default_groups
The driver core can automatically create custom type attributes.
This makes the code and error-handling shorter.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Harry Yoo <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Vlastimil Babka (SUSE) <[email protected]>
2026-02-26 15:25:06 +01:00
Thomas Weißschuh 55f1d6a9d6 tools/nolibc: rename my_syscallX() to __nolibc_syscallX()
The naming convention of the my_syscallX() macros is a bit unfortunate.
They may conflict with application code and the name is very generic.

Switch to __nolibc_syscallX(). The leading underscores place the symbols
in the implementation-defined namespace, avoiding conflicting names.
It is also clearer that these are non-standard extensions from nolibc.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Willy Tarreau <[email protected]>
Link: https://patch.msgid.link/[email protected]
2026-02-25 08:21:17 +01:00
Thomas Weißschuh 098921ec68 selftests: riscv: vstate_exec_nolibc: Use the regular prctl() function
The my_syscall*() macros are internal implementation details of nolibc.

Now that nolibc has a normal prctl() function, use that.

Signed-off-by: Thomas Weißschuh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paul Walmsley <[email protected]>
2026-02-09 15:27:33 -07:00
Thomas Weißschuh d8ad80a85b kbuild: remove dependency of run-command on config
The run-command target does not always require a kernel configuration
to be present.

Drop the dependency so it can be executed without one.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Nicolas Schier <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Nathan Chancellor <[email protected]>
2026-02-07 16:09:14 -06:00
Thomas Weißschuh afa7c56ec4 hwmon: (cros_ec) Add support for temperature thresholds
Implement reading temperature thresholds through
EC_CMD_THERMAL_GET_THRESHOLD/EC_CMD_THERMAL_SET_THRESHOLD.

Thresholds are mapped as follows between the EC and hwmon:

hwmon_temp_max       - EC_TEMP_THRESH_WARN
hwmon_temp_crit      - EC_TEMP_THRESH_HIGH
hwmon_temp_emergency - EC_TEMP_THRESH_HALT

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Tzung-Bi Shih <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[groeck: Rearrange code to no longer use unreachable() since that causes
 a hiccup with some versions of gcc and objtool]
Signed-off-by: Guenter Roeck <[email protected]>
2026-02-07 09:32:20 -08:00
Thomas Weißschuh 11c5802d28 hwmon: (cros_ec) Move temperature channel params to a macro
An upcoming change will add more channel parameters.
This leads to a lot of churn and very long lines.

Use a macro to encapsulate all of the shared values.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Tzung-Bi Shih <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
2026-01-31 07:38:33 -08:00
Thomas Weißschuh bd7a455aee hwmon: (cros_ec) Add support for fan target speed
Use EC_CMD_PWM_GET_FAN_TARGET_RPM to retrieve the target fan speed.
The EC only supports this for the first fan.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Tzung-Bi Shih <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
2026-01-31 07:38:33 -08:00
Thomas Weißschuh 18ccf48656 hwmon: (cros_ec) Split up supported features in the documentation
The wall of text of supported features is hard to read and messy to
extend. Split it into a definition list with an explanations for each
supported feature.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Tzung-Bi Shih <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
2026-01-31 07:38:33 -08:00
Thomas Weißschuh ffb569d59c tools/docs: sphinx-build-wrapper: only generate rust docs when requested
When the user explicitly specifies SPHINXDIRS to build a specific
subdirectory it is unexpected that the rust docs are also generated.
Especially as their generation may dominate the execution time.

Only generate the rust docs when they are part of the SPHINXDIRS
requested by the user. 'rust/rustdocs' is not considered, as it is
not a valid SPHINXDIRS anyways.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Tested-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
Message-ID: <[email protected]>
2026-01-23 11:27:22 -07:00
Thomas Weißschuh 6f9a96cc96 tools/docs: sphinx-build-wrapper: compute sphinxdirs_list earlier
An upcoming patch will require sphinxdirs_list to be available before
the call to check_rust().

Move it up in the function.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Tested-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
Message-ID: <[email protected]>
2026-01-23 11:27:22 -07:00
Thomas Weißschuh 2d652135a1 tools/docs: sphinx-build-wrapper: make 'rustdoc' a local variable
All users of this variable are now in the same method.

Demote the instance variable to a local one.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Tested-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
Message-ID: <[email protected]>
2026-01-23 11:27:22 -07:00
Thomas Weißschuh 5094f7d5ff tools/docs: sphinx-build-wrapper: generate rust docs only once
Currently the rust docs are generated for each entry in SPHINXDIRS.
This is unnecessary as they will be the same for each one.

Move the generation, so it is executed only once.

Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Tested-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
Message-ID: <[email protected]>
2026-01-23 11:27:22 -07:00
Thomas Weißschuh c1b12cd933 padata: Constify padata_sysfs_entry structs
These structs are never modified.

To prevent malicious or accidental modifications due to bugs,
mark them as const.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
2026-01-23 13:48:44 +08:00
Thomas Weißschuh 2a369c4942 kselftest/arm64: Use syscall() macro over nolibc my_syscall()
The my_syscall*() macros are internal implementation details of nolibc.
Nolibc also provides the regular syscall(2), which is also a macro
and directly expands to the correct my_syscall().

Use syscall() instead.

As a side-effect this fixes some return value checks, as my_syscall()
returns the raw value as set by the kernel and does not set errno.

Signed-off-by: Thomas Weißschuh <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
2026-01-22 11:21:09 +00:00