Re: [PATCH 25/32] tools/nolibc: allow different write callbacks in printf

2025-03-03 Thread Willy Tarreau
On Tue, Mar 04, 2025 at 08:10:55AM +0100, Thomas Weißschuh wrote: > Decouple the formatting logic from the writing logic to later enable > writing straight to a buffer in sprintf(). > > Signed-off-by: Thomas Weißschuh > --- > tools/include/nolibc/stdio.h | 21 + > 1 file chan

[PATCH v2 1/5] tools/nolibc: add support for openat(2)

2025-03-03 Thread Louis Taylor
openat is useful to avoid needing to construct relative paths, so expose a wrapper for using it directly. Signed-off-by: Louis Taylor --- tools/include/nolibc/sys.h | 25 tools/testing/selftests/nolibc/nolibc-test.c | 21 2 files changed, 4

Re: [PATCH 24/32] tools/nolibc: add getopt()

2025-03-03 Thread Willy Tarreau
On Tue, Mar 04, 2025 at 08:10:54AM +0100, Thomas Weißschuh wrote: > diff --git a/tools/include/nolibc/getopt.h b/tools/include/nolibc/getopt.h > new file mode 100644 > index > ..35aee582681b79e21bce8ddbf634ae9dfdef8f1d > --- /dev/null > +++ b/tools/include/n

Re: [PATCH 15/32] tools/nolibc: use intmax definitions from compiler

2025-03-03 Thread Willy Tarreau
Hi Thomas, On Tue, Mar 04, 2025 at 08:10:45AM +0100, Thomas Weißschuh wrote: > The printf format checking in the compiler uses the intmax types from > the compiler, not libc. This can lead to compiler errors. > > Instead use the types already provided by the compiler. > > Example issue with clan

[PATCH 32/32] HACK: selftests/nolibc: demonstrate usage of the kselftest harness

2025-03-03 Thread Thomas Weißschuh
Show how to use the kselftest harness together with nolibc. This just runs the existing harness selftest by crudely replacing the regular nolibc-test.c with the harness-selftest.c to get that wired up easily. In the future nolibc-test can use the harness for itself. Not-Signed-off-by: Thomas Weiß

[PATCH 30/32] selftests/nolibc: add test for snprintf() truncation

2025-03-03 Thread Thomas Weißschuh
Now that we have a proper snprintf() implementation, make sure truncation is handled properly. 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/t

[PATCH 29/32] selftests/nolibc: rename vfprintf test suite

2025-03-03 Thread Thomas Weißschuh
With the addition of snprintf() and its usage in nolibc-test, the name of the "vfprintf" test suite is not accurate anymore. Rename the suite to be more generic. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletio

[PATCH 31/32] tools/nolibc: implement width padding in printf()

2025-03-03 Thread Thomas Weißschuh
printf can pad each argument to a certain width. Implement this for compatibility with the kselftest harness. Currently only padding with spaces is supported. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/stdio.h | 17 - tools/testing/selftests/nolibc/n

[PATCH 28/32] selftests/nolibc: use snprintf() for printf tests

2025-03-03 Thread Thomas Weißschuh
With a proper snprintf() implementation in place, the ugly pipe usage is not necessary anymore. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 30 +++- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/tools/testing/selftes

[PATCH 24/32] tools/nolibc: add getopt()

2025-03-03 Thread Thomas Weißschuh
Introduce a getopt() implementation based on the one from musl. The only deviations are adaption to the kernel coding style and nolibc infrastructure and removal of multi-byte support. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/Makefile | 1 + tools/include/nolibc/getopt.h | 105

[PATCH 26/32] tools/nolibc: allow limiting of printf destination size

2025-03-03 Thread Thomas Weißschuh
snprintf() allows limiting the output buffer, while still returning the number of all bytes that would have been written. Implement the limitation logic in preparation for snprintf(). Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/stdio.h | 16 ++-- 1 file changed, 10 inser

[PATCH 25/32] tools/nolibc: allow different write callbacks in printf

2025-03-03 Thread Thomas Weißschuh
Decouple the formatting logic from the writing logic to later enable writing straight to a buffer in sprintf(). Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/stdio.h | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/include/nolibc/stdio.h

[PATCH 22/32] Revert "selftests/nolibc: use waitid() over waitpid()"

2025-03-03 Thread Thomas Weißschuh
nolibc's waitpid() now uses the waitid() syscall internally. This removes the original reasoning for the reverted commit as waitpid() is now available on all platforms and has an easier interface. Switch back to waitpid(). This reverts commit a0bc8947ac731ff95a56e0c1737e69e8c56d5b78. Signed-off-

[PATCH 21/32] tools/nolibc: implement waitpid() in terms of waitid()

2025-03-03 Thread Thomas Weißschuh
The old wait4() syscall used by waitpid() before is not available everywhere. Switch to the waitid() syscall which is the new replacement. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/sys.h | 68 ++ 1 file changed, 56 insertions(+), 12 dele

[PATCH 23/32] tools/nolibc: add dprintf() and vdprintf()

2025-03-03 Thread Thomas Weißschuh
dprintf() and vdprintf() are printf() variants printing directly into a filedescriptor. As FILE in nolibc is based directly on filedescriptors, the implementation is trivial. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/stdio.h | 24 1 file changed, 24 insert

[PATCH 18/32] tools/nolibc: add tolower() and toupper()

2025-03-03 Thread Thomas Weißschuh
The kselftest harness uses these functions. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/string.h| 17 + tools/testing/selftests/nolibc/nolibc-test.c | 5 + 2 files changed, 22 insertions(+) diff --git a/tools/include/nolibc/string.h b/tools/incl

[PATCH 17/32] tools/nolibc: use ppoll_time64 if available

2025-03-03 Thread Thomas Weißschuh
riscv32 does not have any of the older poll systemcalls. Use ppoll_time64 instead. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/sys.h | 8 1 file changed, 8 insertions(+) diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index 128a11441ba1f95a4331b63ff1c

[PATCH 19/32] tools/nolibc: add _exit()

2025-03-03 Thread Thomas Weißschuh
_exit() is the faster variant of exit(), skipping all cleanup actions. As nolibc does not perform any cleanup anyways, the implementation is trivial. Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/sys.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/in

[PATCH 20/32] tools/nolibc: add setpgrp()

2025-03-03 Thread Thomas Weißschuh
setpgrp() is defined to be identical to setpgid(0, 0). Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/sys.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index d98515120785223aaf74d1848a0ad68e308d6893..43b1bfa7a

[PATCH 13/32] selftests: harness: Stop using setjmp()/longjmp()

2025-03-03 Thread Thomas Weißschuh
Usage of longjmp() was added to ensure that teardown is always run in commit 63e6b2a42342 ("selftests/harness: Run TEARDOWN for ASSERT failures") However instead of calling longjmp() to the teardown handler it is easier to just call the teardown handler directly from __bail(). Any potential duplica

[PATCH 15/32] tools/nolibc: use intmax definitions from compiler

2025-03-03 Thread Thomas Weißschuh
The printf format checking in the compiler uses the intmax types from the compiler, not libc. This can lead to compiler errors. Instead use the types already provided by the compiler. Example issue with clang 19 for arm64: nolibc-test.c:30:2: error: format specifies type 'uintmax_t' (aka 'unsign

[PATCH 16/32] tools/nolibc: use pselect6_time64 if available

2025-03-03 Thread Thomas Weißschuh
riscv32 does not have any of the older select systemcalls. Use pselect6_time64 instead. poll() is also used to implement sleep(). Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/sys.h | 8 1 file changed, 8 insertions(+) diff --git a/tools/include/nolibc/sys.h b/tools/include/

[PATCH 12/32] selftests: harness: Add teardown callback to test metadata

2025-03-03 Thread Thomas Weißschuh
To get rid of setjmp()/longjmp(), the teardown logic needs to be usable from __bail(). Introduce a new callback for it. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/t

[PATCH 11/32] selftests: harness: Move teardown conditional into test metadata

2025-03-03 Thread Thomas Weißschuh
To get rid of setjmp()/longjmp(), the teardown logic needs to be usable from __bail(). To access the atomic teardown conditional from there, move it into the test metadata. This also allows the removal of "setup_completed". Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_ha

[PATCH 14/32] tools/nolibc: handle intmax_t/uintmax_t in printf

2025-03-03 Thread Thomas Weißschuh
In nolibc intmax_t and uintmax_t are always the same as (unsigned) long long/uint64_t as 128bit numbers are not supported. Even libcs that do support 128bit numbers often fix intmax_t to 64bit as it is used in ABIs and any change would break those. Signed-off-by: Thomas Weißschuh --- tools/inclu

[PATCH 10/32] selftests: harness: Always provide "self" and "variant"

2025-03-03 Thread Thomas Weißschuh
Some upcoming changes to the assertion macros need those two symbols also to be available for tests without fixtures. Provide them with a NULL value. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) dif

[PATCH 08/32] selftests: harness: Implement test timeouts through pidfd

2025-03-03 Thread Thomas Weißschuh
Make the harness compatible with nolibc which does not implement signals by replacing the signal logic with pidfds. The code also becomes simpler. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 72 ++--- 1 file changed, 25 insertions(+),

[PATCH 09/32] selftests: harness: Don't set setup_completed for fixtureless tests

2025-03-03 Thread Thomas Weißschuh
This field is unused and has no meaning for tests without fixtures. Don't set it for them. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kse

[PATCH 07/32] selftests: harness: Remove dependency on libatomic

2025-03-03 Thread Thomas Weißschuh
__sync_bool_compare_and_swap() is deprecated and requires libatomic on GCC. Compiler toolchains don't necessarily have libatomic available, so avoid this requirement by using atomics that don't need libatomic. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 4 ++

[PATCH 05/32] selftests: harness: Remove inline qualifier for wrappers

2025-03-03 Thread Thomas Weißschuh
The pointers to the wrappers are stored in function pointers, preventing them from actually being inlined. Remove the innline qualifier, aligning these wrappers with the other functions defined through macros. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 4 ++

[PATCH 06/32] selftests: harness: Guard includes on nolibc

2025-03-03 Thread Thomas Weißschuh
Nolibc doesn't provide all normal header files. Don't try to include these non-existent header files, as the symbols are available unconditionally anyways. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 12 1 file changed, 8 insertions(+), 4 delet

[PATCH 04/32] selftests: harness: Mark functions without prototypes static

2025-03-03 Thread Thomas Weißschuh
With -Wmissing-prototypes the compiler will warn about non-static functions which don't have a prototype defined. As they are not used from a different compilation unit they don't need to be defined globally. Avoid the issue by marking the functions static. Signed-off-by: Thomas Weißschuh --- t

[PATCH 01/32] selftests: harness: Add harness selftest

2025-03-03 Thread Thomas Weißschuh
Add a selftest for the harness itself so any changes can be validated. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/Makefile | 1 + tools/testing/selftests/kselftest/.gitignore | 1 + tools/testing/selftests/kselftest/Makefile | 6 + .../testi

[PATCH 03/32] selftests: harness: Ignore unused variant argument warning

2025-03-03 Thread Thomas Weißschuh
For tests without fixtures the variant argument is unused. This is intentional, prevent to compiler from complaining. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kselft

[PATCH 02/32] selftests: harness: Use C89 comment style

2025-03-03 Thread Thomas Weißschuh
All comments in this file use C89 comment style. Except for this one. Change it to get one step closer to C89 compatibility. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/kselftest_harness.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests

[PATCH 00/32] kselftest harness and nolibc compatibility

2025-03-03 Thread Thomas Weißschuh
Nolibc is useful for selftests as the test programs can be very small, and compiled with just a kernel crosscompiler, without userspace support. Currently nolibc is only usable with kselftest.h, not the more convenient to use kselftest_harness.h This series provides this compatibility by adding new

Re: KASAN: global-out-of-bounds Read in srcu_gp_start_if_needed

2025-03-03 Thread Joel Fernandes
On Mon, Mar 03, 2025 at 11:47:11AM -0500, Steven Rostedt wrote: [...] > > [ 92.322347][ T28] register_lock_class+0xb2/0xfc0 > > [ 92.322366][ T28] ? __lock_acquire+0xb97/0x16a0 > > [ 92.322386][ T28] ? __pfx_register_lock_class+0x10/0x10 > > [ 92.322407][ T28] ? do_perf_trace_lo

Re: [PATCH v4 3/3] rcu: Use _full() API to debug synchronize_rcu()

2025-03-03 Thread Boqun Feng
On Sun, Mar 02, 2025 at 07:15:07PM -0500, Joel Fernandes wrote: > On Fri, Feb 28, 2025 at 05:08:49PM -0800, Paul E. McKenney wrote: > > On Fri, Feb 28, 2025 at 11:59:55AM -0800, Paul E. McKenney wrote: > > > On Fri, Feb 28, 2025 at 08:12:51PM +0100, Uladzislau Rezki wrote: > > > > Hello, Paul! > >

Re: [PATCH v4 3/3] rcu: Use _full() API to debug synchronize_rcu()

2025-03-03 Thread Joel Fernandes
t the fix, do we >> want to squash the fix into this patch and have Boqun take it? >> > > Which "-next" are you talking about? The original patch and the fix is > already in next-20250303 of linux-next: > > > https://web.git.kernel.org/pu

[PATCH v21 10/24] ovpn: store tunnel and transport statistics

2025-03-03 Thread Antonio Quartulli
Byte/packet counters for in-tunnel and transport streams are now initialized and updated as needed. To be exported via netlink. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 12 +++- drivers/net/ovpn/peer.c | 2 ++ drivers/net/ovpn

[PATCH v21 24/24] testing/selftests: add test tool and scripts for ovpn module

2025-03-03 Thread Antonio Quartulli
The ovpn-cli tool can be compiled and used as selftest for the ovpn kernel module. [NOTE: it depends on libmedtls for decoding base64-encoded keys] ovpn-cli implements the netlink and RTNL APIs and can thus be integrated in any script for more automated testing. Along with the tool, a bunch of s

[PATCH v21 15/24] ovpn: implement peer lookup logic

2025-03-03 Thread Antonio Quartulli
In a multi-peer scenario there are a number of situations when a specific peer needs to be looked up. We may want to lookup a peer by: 1. its ID 2. its VPN destination IP 3. its transport IP/port couple For each of the above, there is a specific routing table referencing all peers for fast look u

Re: [PATCH net-next v5 3/4] virtio-net: Map NAPIs to queues

2025-03-03 Thread Jakub Kicinski
On Mon, 3 Mar 2025 13:33:10 -0500 Joe Damato wrote: > > > @@ -2880,6 +2880,13 @@ static void refill_work(struct work_struct *work) > > > bool still_empty; > > > int i; > > > > > > + spin_lock(&vi->refill_lock); > > > + if (!vi->refill_enabled) { > > > + sp

[PATCH v21 13/24] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg

2025-03-03 Thread Antonio Quartulli
Userspace may want to pass the MSG_NOSIGNAL flag to tcp_sendmsg() in order to avoid generating a SIGPIPE. To pass this flag down the TCP stack a new skb sending API accepting a flags argument is introduced. Cc: Eric Dumazet Cc: Paolo Abeni Signed-off-by: Antonio Quartulli --- drivers/net/ovpn

[PATCH v21 11/24] ovpn: implement TCP transport

2025-03-03 Thread Antonio Quartulli
With this change ovpn is allowed to communicate to peers also via TCP. Parsing of incoming messages is implemented through the strparser API. Note that ovpn redefines sk_prot and sk_socket->ops for the TCP socket used to communicate with the peer. For this reason it needs to access inet6_stream_op

[PATCH v21 06/24] ovpn: introduce the ovpn_socket object

2025-03-03 Thread Antonio Quartulli
This specific structure is used in the ovpn kernel module to wrap and carry around a standard kernel socket. ovpn takes ownership of passed sockets and therefore an ovpn specific objects is attached to them for status tracking purposes. Initially only UDP support is introduced. TCP will come in a

[PATCH v21 22/24] ovpn: notify userspace when a peer is deleted

2025-03-03 Thread Antonio Quartulli
Whenever a peer is deleted, send a notification to userspace so that it can react accordingly. This is most important when a peer is deleted due to ping timeout, because it all happens in kernelspace and thus userspace has no direct way to learn about it. Signed-off-by: Antonio Quartulli --- dr

[PATCH v21 21/24] ovpn: kill key and notify userspace in case of IV exhaustion

2025-03-03 Thread Antonio Quartulli
IV wrap-around is cryptographically dangerous for a number of ciphers, therefore kill the key and inform userspace (via netlink) should the IV space go exhausted. Userspace has two ways of deciding when the key has to be renewed before exhausting the IV space: 1) time based approach: after X se

[PATCH v21 23/24] ovpn: add basic ethtool support

2025-03-03 Thread Antonio Quartulli
Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++ 1 file chan

[PATCH v21 18/24] ovpn: add support for peer floating

2025-03-03 Thread Antonio Quartulli
A peer connected via UDP may change its IP address without reconnecting (float). Add support for detecting and updating the new peer IP/port in case of floating. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 8 ++ drivers/net/ovpn/peer.c | 243

[PATCH v21 20/24] ovpn: implement key add/get/del/swap via netlink

2025-03-03 Thread Antonio Quartulli
This change introduces the netlink commands needed to add, get, delete and swap keys for a specific peer. Userspace is expected to use these commands to create, inspect (non sensitive data only), destroy and rotate session keys for a specific peer. Signed-off-by: Antonio Quartulli --- drivers/n

[PATCH v21 16/24] ovpn: implement keepalive mechanism

2025-03-03 Thread Antonio Quartulli
OpenVPN supports configuring a periodic keepalive packet. message to allow the remote endpoint detect link failures. This change implements the keepalive sending and timer expiring logic. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/io.c | 74 drivers/net/ovpn/i

[PATCH v21 19/24] ovpn: implement peer add/get/dump/delete via netlink

2025-03-03 Thread Antonio Quartulli
This change introduces the netlink command needed to add, delete and retrieve/dump known peers. Userspace is expected to use these commands to handle known peer lifecycles. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/netlink.c | 677 - driver

[PATCH v21 17/24] ovpn: add support for updating local UDP endpoint

2025-03-03 Thread Antonio Quartulli
In case of UDP links, the local endpoint used to communicate with a given peer may change without a connection restart. Add support for learning the new address in case of change. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/peer.c | 45 + dr

[PATCH v21 14/24] ovpn: implement multi-peer support

2025-03-03 Thread Antonio Quartulli
With this change an ovpn instance will be able to stay connected to multiple remote endpoints. This functionality is strictly required when running ovpn on an OpenVPN server. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/main.c | 64 +-- drivers/net/ovpn/ovpnpriv.h | 1

[PATCH v21 12/24] skb: implement skb_send_sock_locked_with_flags()

2025-03-03 Thread Antonio Quartulli
When sending an skb over a socket using skb_send_sock_locked(), it is currently not possible to specify any flag to be set in msghdr->msg_flags. However, we may want to pass flags the user may have specified, like MSG_NOSIGNAL. Extend __skb_send_sock() with a new argument 'flags' and add a new in

[PATCH v21 09/24] ovpn: implement packet processing

2025-03-03 Thread Antonio Quartulli
This change implements encryption/decryption and encapsulation/decapsulation of OpenVPN packets. Support for generic crypto state is added along with a wrapper for the AEAD crypto kernel API. Signed-off-by: Antonio Quartulli --- drivers/net/Kconfig| 4 + drivers/net/ovpn/Makefile

[PATCH v21 07/24] ovpn: implement basic TX path (UDP)

2025-03-03 Thread Antonio Quartulli
Packets sent over the ovpn interface are processed and transmitted to the connected peer, if any. Implementation is UDP only. TCP will be added by a later patch. Note: no crypto/encapsulation exists yet. Packets are just captured and sent. Signed-off-by: Antonio Quartulli --- drivers/net/Kconf

[PATCH v21 08/24] ovpn: implement basic RX path (UDP)

2025-03-03 Thread Antonio Quartulli
Packets received over the socket are forwarded to the user device. Implementation is UDP only. TCP will be added by a later patch. Note: no decryption/decapsulation exists yet, packets are forwarded as they arrive without much processing. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/i

[PATCH v21 05/24] ovpn: introduce the ovpn_peer object

2025-03-03 Thread Antonio Quartulli
An ovpn_peer object holds the whole status of a remote peer (regardless whether it is a server or a client). This includes status for crypto, tx/rx buffers, napi, etc. Only support for one peer is introduced (P2P mode). Multi peer support is introduced with a later patch. Along with the ovpn_pee

[PATCH v21 01/24] net: introduce OpenVPN Data Channel Offload (ovpn)

2025-03-03 Thread Antonio Quartulli
OpenVPN is a userspace software existing since around 2005 that allows users to create secure tunnels. So far OpenVPN has implemented all operations in userspace, which implies several back and forth between kernel and user land in order to process packets (encapsulate/decapsulate, encrypt/decrypt

[PATCH v21 00/24] Introducing OpenVPN Data Channel Offload

2025-03-03 Thread Antonio Quartulli
Notable changes since v20: * removed newline at the end of message in NL_SET_ERR_MSG_FMT_MOD * dropped udp_init() and related build_protos() and directly use .encap_destroy [instead of overriding sk->close()] * defered peer_del() call to worker in case of transport errors, as we may be in non-s

[PATCH v21 03/24] ovpn: add basic interface creation/destruction/management routines

2025-03-03 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Tested-by: Donald Hunter Signed-off-by: Antonio Quartulli --- Documentation/netlink/specs/rt_link.yaml | 16 + drivers/net/ovpn/Makefile| 1 + drivers/net/ovpn/io.c| 22 ++ drivers/net/ovpn/io

[PATCH v21 04/24] ovpn: keep carrier always on for MP interfaces

2025-03-03 Thread Antonio Quartulli
An ovpn interface configured in MP mode will keep carrier always on and let the user decide when to bring it administratively up and down. This way a MP node (i.e. a server) will keep its interface always up and running, even when no peer is connected. Signed-off-by: Antonio Quartulli --- drive

[PATCH v21 02/24] ovpn: add basic netlink support

2025-03-03 Thread Antonio Quartulli
This commit introduces basic netlink support with family registration/unregistration functionalities and stub pre/post-doit. More importantly it introduces the YAML uAPI description along with its auto-generated files: - include/uapi/linux/ovpn.h - drivers/net/ovpn/netlink-gen.c - drivers/net/ovpn

Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Linus Walleij
On Mon, Mar 3, 2025 at 9:39 PM Andy Shevchenko wrote: > > Maybe add a comment in the code that this is wrong and the > > driver and DTS files should be fixed. > > Or maybe fix in the driver and schema and add a quirk to gpiolib-of.c? Even better! Yours, Linus Walleij

[PATCH v2 0/4] RISC-V KVM PMU fix and selftest improvement

2025-03-03 Thread Atish Patra
This series adds a fix for KVM PMU code and improves the pmu selftest by allowing generating precise number of interrupts. It also provided another additional option to the overflow test that allows user to generate custom number of LCOFI interrupts. Signed-off-by: Atish Patra --- Changes in v2:

[PATCH v2 2/4] KVM: riscv: selftests: Do not start the counter in the overflow handler

2025-03-03 Thread Atish Patra
There is no need to start the counter in the overflow handler as we intend to trigger precise number of LCOFI interrupts through these tests. The overflow irq handler has already stopped the counter. As a result, the stop call from the test function may return already stopped error which is fine as

[PATCH v2 1/4] RISC-V: KVM: Disable the kernel perf counter during configure

2025-03-03 Thread Atish Patra
The perf event should be marked disabled during the creation as it is not ready to be scheduled until there is SBI PMU start call or config matching is called with auto start. Otherwise, event add/start gets called during perf_event_create_kernel_counter function. It will be enabled and scheduled t

Re: [RFC PATCH 0/5] KVM: guest_memfd: support for uffd missing

2025-03-03 Thread Peter Xu
On Mon, Mar 03, 2025 at 01:30:06PM +, Nikita Kalyazin wrote: > This series is built on top of the v3 write syscall support [1]. > > With James's KVM userfault [2], it is possible to handle stage-2 faults > in guest_memfd in userspace. However, KVM itself also triggers faults > in guest_memfd

[PATCH v2 4/4] KVM: riscv: selftests: Allow number of interrupts to be configurable

2025-03-03 Thread Atish Patra
It is helpful to vary the number of the LCOFI interrupts generated by the overflow test. Allow additional argument for overflow test to accommodate that. It can be easily cross-validated with /proc/interrupts output in the host. Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv/sb

[PATCH v2 3/4] KVM: riscv: selftests: Change command line option

2025-03-03 Thread Atish Patra
The PMU test commandline option takes an argument to disable a certain test. The initial assumption behind this was a common use case is just to run all the test most of the time. However, running a single test seems more useful instead. Especially, the overflow test has been helpful to validate PM

Re: [PATCH bpf-next v2 00/10] selftests/bpf: Migrate test_tunnel.sh to test_progs

2025-03-03 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf-next.git (master) by Martin KaFai Lau : On Mon, 03 Mar 2025 09:22:48 +0100 you wrote: > Hi all, > > This patch series continues the work to migrate the *.sh tests into > prog_tests framework. > > The test_tunnel.sh script has already been partly migrate

Re: [PATCH 3/4] KVM: riscv: selftests: Change command line option

2025-03-03 Thread Atish Kumar Patra
On Thu, Feb 27, 2025 at 12:08 AM Andrew Jones wrote: > > On Wed, Feb 26, 2025 at 12:25:05PM -0800, Atish Patra wrote: > > The PMU test commandline option takes an argument to disable a > > certain test. The initial assumption behind this was a common use case > > is just to run all the test most o

Re: [PATCH 4/4] KVM: riscv: selftests: Allow number of interrupts to be configurable

2025-03-03 Thread Atish Kumar Patra
On Thu, Feb 27, 2025 at 12:16 AM Andrew Jones wrote: > > On Wed, Feb 26, 2025 at 12:25:06PM -0800, Atish Patra wrote: > > It is helpful to vary the number of the LCOFI interrupts generated > > by the overflow test. Allow additional argument for overflow test > > to accommodate that. It can be easi

Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
Mon, Mar 03, 2025 at 09:00:39PM +0100, Linus Walleij kirjoitti: > On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko > wrote: ... > > reinit_completion(&priv->ca8210_is_awake); > > msleep(ms); > > - gpio_set_value(pdata->gpio_reset, 1); > > + gpiod_set_value(pdata->reset_

Re: [PATCH net-next v2 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-03 Thread Linus Walleij
On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko wrote: > Sparse complains that the driver doesn't respect the bitwise types: > > drivers/net/ieee802154/ca8210.c:1796:27: warning: incorrect type in > assignment (different base types) > drivers/net/ieee802154/ca8210.c:1796:27:expected restricte

Re: [PATCH 3/3] rcu/exp: Remove needless CPU up quiescent state report

2025-03-03 Thread Paul E. McKenney
On Fri, Feb 14, 2025 at 12:25:59AM +0100, Frederic Weisbecker wrote: > A CPU coming online checks for an ongoing grace period and reports > a quiescent state accordingly if needed. This special treatment that > shortcuts the expedited IPI finds its origin as an optimization purpose > on the followi

Re: [PATCH bpf-next v4 2/6] net: tun: enable transfer of XDP metadata to skb

2025-03-03 Thread Martin KaFai Lau
On 3/3/25 8:13 AM, Marcus Wichelmann wrote: Am 28.02.25 um 20:49 schrieb Martin KaFai Lau: On 2/27/25 6:23 AM, Marcus Wichelmann wrote: When the XDP metadata area was used, it is expected that the same metadata can also be accessed from TC, as can be read in the description of the bpf_xdp_adjus

Re: [PATCH v4 3/3] rcu: Use _full() API to debug synchronize_rcu()

2025-03-03 Thread Joel Fernandes
On 3/3/2025 1:55 PM, Paul E. McKenney wrote: >> I tried the following command and it shows the patch in question in the first >> line of output. Basically the question that the command asks is "What is in >> Paul's dev branch that is not in RCU tree's -next branch". This question is >> asked fo

Re: [PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Linus Walleij
On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko wrote: > This updates the driver to gpiod API, and removes yet another use of > of_get_named_gpio(). > > Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij But note: > @@ -632,10 +630,10 @@ static void ca8210_reset_send(struct spi_device

Re: [PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()

2025-03-03 Thread Linus Walleij
On Mon, Mar 3, 2025 at 5:49 PM Andy Shevchenko wrote: > Access to platform data via dev_get_platdata() getter to make code cleaner. > > Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij Yours, Linus Walleij

Re: [PATCH net-next v5 3/4] virtio-net: Map NAPIs to queues

2025-03-03 Thread Joe Damato
On Mon, Mar 03, 2025 at 12:00:10PM -0500, Joe Damato wrote: > On Mon, Mar 03, 2025 at 11:46:10AM -0500, Joe Damato wrote: > > On Fri, Feb 28, 2025 at 06:27:59PM -0800, Jakub Kicinski wrote: > > > On Thu, 27 Feb 2025 18:50:13 + Joe Damato wrote: > > > > @@ -2870,9 +2883,15 @@ static void refill_

Re: [PATCH v4 3/3] rcu: Use _full() API to debug synchronize_rcu()

2025-03-03 Thread Paul E. McKenney
ize_rcu_full() > >> GP-start > >> detection" is not yet on -next. Once we are convinced about the fix, do we > >> want to squash the fix into this patch and have Boqun take it? > >> > > > > Which "-next" are you talking a

Re: [PATCH v1 2/2] mm/slab/kvfree_rcu: Switch to WQ_MEM_RECLAIM wq

2025-03-03 Thread Joel Fernandes
On Fri, Feb 28, 2025 at 01:13:56PM +0100, Uladzislau Rezki (Sony) wrote: > Currently kvfree_rcu() APIs use a system workqueue which is > "system_unbound_wq" to driver RCU machinery to reclaim a memory. > > Recently, it has been noted that the following kernel warning can > be observed: > > > wor

Re: [PATCH net-next v1 2/2] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Miquel Raynal
Hi Andy, > @@ -350,8 +348,8 @@ struct work_priv_container { > * @extclockenable: true if the external clock is to be enabled > * @extclockfreq: frequency of the external clock > * @extclockgpio: ca8210 output gpio of the external clock > - * @gpio_reset: gpio number of ca8210 reset l

Re: [PATCH v4 3/3] rcu: Use _full() API to debug synchronize_rcu()

2025-03-03 Thread Joel Fernandes
art >>> detection" is not yet on -next. Once we are convinced about the fix, do we >>> want to squash the fix into this patch and have Boqun take it? >>> >> >> Which "-next" are you talking about? The original patch and the fix is >> already

Re: [PATCH v7 8/8] vhost: Add a KConfig knob to enable IOCTL VHOST_FORK_FROM_OWNER

2025-03-03 Thread Michael S. Tsirkin
On Mon, Mar 03, 2025 at 01:52:06PM +0800, Jason Wang wrote: > On Sun, Mar 2, 2025 at 10:34 PM Cindy Lu wrote: > > > > Introduce a new config knob `CONFIG_VHOST_ENABLE_FORK_OWNER_IOCTL`, > > to control the availability of the `VHOST_FORK_FROM_OWNER` ioctl. > > When CONFIG_VHOST_ENABLE_FORK_OWNER_IO

Re: [PATCH v4 3/3] rcu: Use _full() API to debug synchronize_rcu()

2025-03-03 Thread Boqun Feng
and have Boqun take it? > Which "-next" are you talking about? The original patch and the fix is already in next-20250303 of linux-next: https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?h=next-20250303&qt=range&q=153fc45000e0058435ec0609258f

Re: [PATCH net-next v5 3/4] virtio-net: Map NAPIs to queues

2025-03-03 Thread Joe Damato
On Mon, Mar 03, 2025 at 11:46:10AM -0500, Joe Damato wrote: > On Fri, Feb 28, 2025 at 06:27:59PM -0800, Jakub Kicinski wrote: > > On Thu, 27 Feb 2025 18:50:13 + Joe Damato wrote: > > > @@ -2870,9 +2883,15 @@ static void refill_work(struct work_struct *work) > > > for (i = 0; i < vi->curr_queu

Re: [PATCH v15 02/15] irqdomain: Add IRQ_DOMAIN_FLAG_MSI_IMMUTABLE and irq_domain_is_msi_immutable()

2025-03-03 Thread Frank Li
On Sat, Mar 01, 2025 at 11:10:35AM +, Marc Zyngier wrote: > On Tue, 11 Feb 2025 19:21:55 +, > Frank Li wrote: > > > > Add the flag IRQ_DOMAIN_FLAG_MSI_IMMUTABLE and the API function > > irq_domain_is_msi_immutable() to check if the MSI controller retains an > > immutable address/data pair

Re: [PATCH v15 04/15] irqchip/gic-v3-its: Add support for device tree msi-map and msi-mask

2025-03-03 Thread Frank Li
On Sat, Mar 01, 2025 at 11:37:14AM +, Marc Zyngier wrote: > On Tue, 11 Feb 2025 19:21:57 +, > Frank Li wrote: > > > > Some platform devices create child devices dynamically and require the > > parent device's msi-map to map device IDs to actual sideband information. > > > > A typical use c

[PATCH net-next v2 3/3] ieee802154: ca8210: Switch to using gpiod API

2025-03-03 Thread Andy Shevchenko
This updates the driver to gpiod API, and removes yet another use of of_get_named_gpio(). Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 57 +++-- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b/d

[PATCH net-next v2 2/3] ieee802154: ca8210: Get platform data via dev_get_platdata()

2025-03-03 Thread Andy Shevchenko
Access to platform data via dev_get_platdata() getter to make code cleaner. Signed-off-by: Andy Shevchenko --- drivers/net/ieee802154/ca8210.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c index

Re: [PATCH v4 3/3] rcu: Use _full() API to debug synchronize_rcu()

2025-03-03 Thread Joel Fernandes
On Sun, Mar 02, 2025 at 07:17:10PM -0500, Joel Fernandes wrote: > On Sun, Mar 02, 2025 at 07:15:07PM -0500, Joel Fernandes wrote: > > On Fri, Feb 28, 2025 at 05:08:49PM -0800, Paul E. McKenney wrote: > > > On Fri, Feb 28, 2025 at 11:59:55AM -0800, Paul E. McKenney wrote: > > > > On Fri, Feb 28, 202

Re: KASAN: global-out-of-bounds Read in srcu_gp_start_if_needed

2025-03-03 Thread Steven Rostedt
On Mon, 3 Mar 2025 08:44:48 +0800 Strforexc yn wrote: > [ 92.191636][T12405] bcachefs (loop4): accounting_read... done > [ 92.214058][T12405] bcachefs (loop4): alloc_read... done > [ 92.214581][T12405] bcachefs (loop4): stripes_read... done > [ 92.215097][T12405] bcachefs (loop4): snapsho

[PATCH v2 0/3] ieee802154: ca8210: Sparse fix and GPIOd conversion

2025-03-03 Thread Andy Shevchenko
The main part is the patch 3 that converts the driver to GPIO descriptor APIs, the first one is just an ad-hoc fix WRT sparse complains on the bitwise types misuse. The second one is a small cleanup that helps patch 3 to be nicer. In v2: - split and extended cleanup pieces into patch 2 (Miquel) -

Re: KASAN: global-out-of-bounds Read in srcu_gp_start_if_needed

2025-03-03 Thread Steven Rostedt
On Mon, 3 Mar 2025 11:47:11 -0500 Steven Rostedt wrote: > > [ 92.322619][ T28] ? srcu_gp_start_if_needed+0x1a9/0x5f0 > > [ 92.322636][ T28] srcu_gp_start_if_needed+0x1a9/0x5f0 > > The lock taken is from the passed in rcu_pending pointer. > > > [ 92.322655][ T28] rcu_pending_enq

[PATCH net-next v2 1/3] ieee802154: ca8210: Use proper setter and getters for bitwise types

2025-03-03 Thread Andy Shevchenko
Sparse complains that the driver doesn't respect the bitwise types: drivers/net/ieee802154/ca8210.c:1796:27: warning: incorrect type in assignment (different base types) drivers/net/ieee802154/ca8210.c:1796:27:expected restricted __le16 [addressable] [assigned] [usertype] pan_id drivers/net/

Re: [PATCH net-next v5 3/4] virtio-net: Map NAPIs to queues

2025-03-03 Thread Joe Damato
On Fri, Feb 28, 2025 at 06:27:59PM -0800, Jakub Kicinski wrote: > On Thu, 27 Feb 2025 18:50:13 + Joe Damato wrote: > > @@ -2870,9 +2883,15 @@ static void refill_work(struct work_struct *work) > > for (i = 0; i < vi->curr_queue_pairs; i++) { > > struct receive_queue *rq = &vi->rq

  1   2   >