Re: [PATCH v6] lib/math: Add int_sqrt test suite

2024-12-11 Thread Andrew Morton
On Wed, 11 Dec 2024 21:12:58 -0500 Luis Felipe Hernandez wrote: > Adds test suite for integer based square root function. > > The test suite is designed to verify the correctness of the int_sqrt() > math library function. > my x86_64 allmodconfig build says AR built-in.a AR vml

Re: [PATCH net v4 0/6] virtio_net: correct netdev_tx_reset_queue() invocation points

2024-12-11 Thread Michael S. Tsirkin
On Fri, Dec 06, 2024 at 10:10:41AM +0900, Koichiro Den wrote: > When virtnet_close is followed by virtnet_open, some TX completions can > possibly remain unconsumed, until they are finally processed during the > first NAPI poll after the netdev_tx_reset_queue(), resulting in a crash > [1]. Commit b

[PATCH v6] riscv: selftests: Fix warnings pointer masking test

2024-12-11 Thread Charlie Jenkins
When compiling the pointer masking tests with -Wall this warning is present: pointer_masking.c: In function ‘test_tagged_addr_abi_sysctl’: pointer_masking.c:203:9: warning: ignoring return value of ‘pwrite’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 203 | pwrite(fd, &

[PATCH v6] lib/math: Add int_sqrt test suite

2024-12-11 Thread Luis Felipe Hernandez
Adds test suite for integer based square root function. The test suite is designed to verify the correctness of the int_sqrt() math library function. Signed-off-by: Luis Felipe Hernandez --- Changes in v2 - Add new line at the end of int_sqrt_kunit.c - Add explicit header includes for MODULE

Re: [PATCH v2 3/6] KVM: VMX: Handle vectoring error in check_emulate_instruction

2024-12-11 Thread Sean Christopherson
On Wed, Dec 11, 2024, Ivan Orlov wrote: > On 12/11/24 18:15, Sean Christopherson wrote: > > Hmm, this should probably be "pf_mmio", not just "mmio". E.g. if KVM is > > emulating > > large swaths of guest code because unrestricted guest is disabled, then can > > end up > > emulating an MMIO acces

Re: [PATCH 1/4] KVM: VMX: read the PML log in the same order as it was written

2024-12-11 Thread Sean Christopherson
On Wed, Dec 11, 2024, Maxim Levitsky wrote: > X86 spec specifies that the CPU writes to the PML log 'backwards' SDM, because this is Intel specific. > or in other words, it first writes entry 511, then entry 510 and so on, > until it writes entry 0, after which the 'PML log full' VM exit happens.

[PATCH v2 3/3] drivers: base: test: Add ...find_device_by...(... NULL) tests

2024-12-11 Thread Brian Norris
We recently updated these device_match*() (and therefore, various *find_device_by*()) functions to return a consistent 'false' value when trying to match a NULL handle. Add tests for this. This provides regression-testing coverage for the sorts of bugs that underly commit 5c8418cf4025 ("PCI/pwrctr

[PATCH v2 2/3] drivers: base: test: Enable device model tests with KUNIT_ALL_TESTS

2024-12-11 Thread Brian Norris
Per commit bebe94b53eb7 ("drivers: base: default KUNIT_* fragments to KUNIT_ALL_TESTS"), it seems like we should default to KUNIT_ALL_TESTS. This enables these platform_device tests for common configurations, such as with: ./tools/testing/kunit/kunit.py run Signed-off-by: Brian Norris --- (no

[PATCH v2 1/3] drivers: base: Don't match devices with NULL of_node/fwnode/etc

2024-12-11 Thread Brian Norris
of_find_device_by_node(), bus_find_device_by_of_node(), bus_find_device_by_fwnode(), ..., all produce arbitrary results when provided with a NULL of_node, fwnode, ACPI handle, etc. This is counterintuitive, and the source of a few bugs, such as the one fixed by commit 5c8418cf4025 ("PCI/pwrctrl: Un

[PATCH v2 0/3] drivers: base: Don't match device with NULL of_node/fwnode/etc + tests

2024-12-11 Thread Brian Norris
This series: 1. makes the behavior of_find_device_by_node(), bus_find_device_by_of_node(), bus_find_device_by_fwnode(), etc., more consistent when provided with a NULL node/handle; 2. adds kunit tests to validate the new NULL-argument behavior; and 3. makes some related improvements and refac

Re: [PATCH v2 3/6] KVM: VMX: Handle vectoring error in check_emulate_instruction

2024-12-11 Thread Ivan Orlov
On 12/11/24 18:15, Sean Christopherson wrote: Hmm, this should probably be "pf_mmio", not just "mmio". E.g. if KVM is emulating large swaths of guest code because unrestricted guest is disabled, then can end up emulating an MMIO access for "normal" emulation. Hmm, actually, what if we go with

Re: [PATCH fixes] riscv: mm: Do not call pmd dtor on vmemmap page table teardown

2024-12-11 Thread patchwork-bot+linux-riscv
Hello: This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt : On Wed, 20 Nov 2024 14:12:02 +0100 you wrote: > From: Björn Töpel > > The vmemmap's, which is used for RV64 with SPARSEMEM_VMEMMAP, page > tables are populated using pmd (page middle directory) hugetables. > However, t

Re: [PATCH V2 0/4] A few fixes for RISC-V

2024-12-11 Thread patchwork-bot+linux-riscv
Hello: This series was applied to riscv/linux.git (fixes) by Andrew Morton : On Tue, 8 Oct 2024 17:41:37 +0800 you wrote: > These patches are all simple fixes with no strong dependency though, > I hope that making them a patchset will be more convenient for merge. > > The patchset are based on

Re: [PATCH 1/2] selftest/mm: Fix typo in virtual_address_range

2024-12-11 Thread patchwork-bot+linux-riscv
Hello: This series was applied to riscv/linux.git (fixes) by Andrew Morton : On Fri, 13 Sep 2024 10:26:34 +0800 you wrote: > The function name should be *hint* address, so correct it. > > Signed-off-by: Chunyan Zhang > --- > tools/testing/selftests/mm/virtual_address_range.c | 4 ++-- > 1 file

Re: [GIT PULL] Kselftest fixes for Linux 6.13-rc3

2024-12-11 Thread pr-tracker-bot
The pull request you sent on Wed, 11 Dec 2024 13:37:41 -0700: > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest > tags/linux_kselftest-fixes-6.13-rc3 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/becb337c237f9c8030fb976a1d643c0347408cf8 Thank you

Re: [PATCH v2 3/6] KVM: VMX: Handle vectoring error in check_emulate_instruction

2024-12-11 Thread Ivan Orlov
On 12/11/24 18:15, Sean Christopherson wrote: On Mon, Nov 11, 2024, Ivan Orlov wrote: Move unhandleable vmexit due to MMIO during vectoring error detection into check_emulate_instruction. Implement a function which checks if emul_type indicates MMIO so it can be used for both VMX and SVM. Fix t

Re: [PATCH v2 0/6] Enhance event delivery error handling

2024-12-11 Thread Ivan Orlov
On 12/11/24 18:20, Sean Christopherson wrote: On Mon, Nov 11, 2024, Ivan Orlov wrote: Currently, the situation when guest accesses MMIO during vectoring is handled differently on VMX and SVM: on VMX KVM returns internal error, when SVM goes into infinite loop trying to deliver an event again and

[PATCH net-next v15 22/22] testing/selftests: add test tool and scripts for ovpn module

2024-12-11 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, 4 scripts ar

[PATCH net-next v15 21/22] ovpn: add basic ethtool support

2024-12-11 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 net-next v15 20/22] ovpn: notify userspace when a peer is deleted

2024-12-11 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 net-next v15 19/22] ovpn: kill key and notify userspace in case of IV exhaustion

2024-12-11 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 net-next v15 15/22] ovpn: add support for updating local UDP endpoint

2024-12-11 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 net-next v15 16/22] ovpn: add support for peer floating

2024-12-11 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/bind.c | 9 +- drivers/net/ovpn/io.c | 4 + drivers/net/ovpn/peer.c | 243

[PATCH net-next v15 14/22] ovpn: implement keepalive mechanism

2024-12-11 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 | 77 + drivers/net/ovp

[PATCH net-next v15 18/22] ovpn: implement key add/get/del/swap via netlink

2024-12-11 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 net-next v15 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 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 | 640 - driver

[PATCH net-next v15 12/22] ovpn: implement multi-peer support

2024-12-11 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 | 67 - drivers/net/ovpn/ovpnstruct.

[PATCH net-next v15 13/22] ovpn: implement peer lookup logic

2024-12-11 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

[PATCH net-next v15 11/22] ovpn: implement TCP transport

2024-12-11 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 net-next v15 09/22] ovpn: implement packet processing

2024-12-11 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 net-next v15 10/22] ovpn: store tunnel and transport statistics

2024-12-11 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 net-next v15 08/22] ovpn: implement basic RX path (UDP)

2024-12-11 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 net-next v15 07/22] ovpn: implement basic TX path (UDP)

2024-12-11 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 net-next v15 05/22] ovpn: introduce the ovpn_peer object

2024-12-11 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 net-next v15 03/22] ovpn: add basic interface creation/destruction/management routines

2024-12-11 Thread Antonio Quartulli
Add basic infrastructure for handling ovpn interfaces. Signed-off-by: Antonio Quartulli --- drivers/net/ovpn/Makefile | 1 + drivers/net/ovpn/io.c | 22 + drivers/net/ovpn/io.h | 24 ++ drivers/net/ovpn/main.c | 102 ++

[PATCH net-next v15 04/22] ovpn: keep carrier always on for MP interfaces

2024-12-11 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 net-next v15 06/22] ovpn: introduce the ovpn_socket object

2024-12-11 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 net-next v15 02/22] ovpn: add basic netlink support

2024-12-11 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

[PATCH net-next v15 00/22] Introducing OpenVPN Data Channel Offload

2024-12-11 Thread Antonio Quartulli
Notable changes since v14: * added socket-netnsid netlink peer attribute containing the socket netns * avoided dereferencing ovpn_priv if NULL in ovpn_udp_encap_recv() err path (reported by smatch) * released ref to peer in ovpn_recv() err path * made sa_len signed in ovpn_peer_get_by_transp_ad

[PATCH net-next v15 01/22] net: introduce OpenVPN Data Channel Offload (ovpn)

2024-12-11 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

Re: [RFC PATCH v1 1/2] mm/memfd: Add support for F_SEAL_FUTURE_EXEC to memfd

2024-12-11 Thread Isaac Manjarres
On Fri, Dec 06, 2024 at 09:14:58PM +, Lorenzo Stoakes wrote: > On Fri, Dec 06, 2024 at 12:48:09PM -0800, Isaac Manjarres wrote: > > On Fri, Dec 06, 2024 at 06:19:49PM +, Lorenzo Stoakes wrote: > > > On Thu, Dec 05, 2024 at 05:09:22PM -0800, Isaac J. Manjarres wrote: > > > > diff --git a/mm/

[GIT PULL] Kselftest fixes for Linux 6.13-rc3

2024-12-11 Thread Shuah Khan
Hi Linus, Please pull the following fixes update for Linux 6.13-rc3. linux_kselftest-fixes-6.13-rc3 -- fixes the offset for kprobe syntax error test case when checking the BTF arguments on 64-bit powerpc. Note: This fix has been in linux-next since last week. I had to drop a patch and rebas

[PATCH 4/4] KVM: selftests: dirty_log_test: support multiple write retires

2024-12-11 Thread Maxim Levitsky
If dirty_log_test is run nested, it is possible for entries in the emulated PML log to appear before the actual memory write is committed to the RAM, due to the way KVM retries memory writes as a response to a MMU fault. In addition to that in some very rare cases retry can happen more than once,

[PATCH 2/4] KVM: selftests: dirty_log_test: Limit s390x workaround to s390x

2024-12-11 Thread Maxim Levitsky
s390 specific workaround causes the dirty-log mode of the test to dirty all the guest memory on the first iteration which is very slow when run nested. Limit this workaround to s390x. Signed-off-by: Maxim Levitsky --- tools/testing/selftests/kvm/dirty_log_test.c | 2 ++ 1 file changed, 2 insert

[PATCH 3/4] KVM: selftests: dirty_log_test: run the guest until some dirty ring entries were harvested

2024-12-11 Thread Maxim Levitsky
When the dirty_log_test is run nested, due to very slow nature of the environment, it is possible to reach a situation in which no entries were harvested from the dirty ring and that breaks the test logic. Detect this case and just let the guest run a bit more until test obtains some entries from

[PATCH 1/4] KVM: VMX: read the PML log in the same order as it was written

2024-12-11 Thread Maxim Levitsky
X86 spec specifies that the CPU writes to the PML log 'backwards' or in other words, it first writes entry 511, then entry 510 and so on, until it writes entry 0, after which the 'PML log full' VM exit happens. I also confirmed on the bare metal that the CPU indeed writes the entries in this order

[PATCH 0/4] KVM: selftests: dirty_log_test: fixes for running the test nested

2024-12-11 Thread Maxim Levitsky
As a part of the effort to start running kvm selftests nested, this patch series contains several fixes to the dirty_log_test, which allows this test to run nested very well. I also included a mostly nop change to KVM, to reverse the order in which the PML log is read to align more closely to the

[PATCH AUTOSEL 6.12 21/36] bpf: Zero index arg error string for dynptr and iter

2024-12-11 Thread Sasha Levin
From: Kumar Kartikeya Dwivedi [ Upstream commit bd74e238ae6944b462f57ce8752440a011ba4530 ] Andrii spotted that process_dynptr_func's rejection of incorrect argument register type will print an error string where argument numbers are not zero-indexed, unlike elsewhere in the verifier. Fix this b

Re: [PATCH v2 0/6] Enhance event delivery error handling

2024-12-11 Thread Sean Christopherson
On Mon, Nov 11, 2024, Ivan Orlov wrote: > Currently, the situation when guest accesses MMIO during vectoring is > handled differently on VMX and SVM: on VMX KVM returns internal error, > when SVM goes into infinite loop trying to deliver an event again and > again. > > This patch series eliminates

Re: [PATCH v2 6/6] selftests: KVM: Add test case for MMIO during vectoring

2024-12-11 Thread Sean Christopherson
On Mon, Nov 11, 2024, Ivan Orlov wrote: > Extend the 'set_memory_region_test' with a test case which covers the > MMIO during vectoring error handling. The test case > > 1) Sets an IDT descriptor base to point to an MMIO address > 2) Generates a #GP in the guest > 3) Verifies that we got a correct

Re: [PATCH v2 4/6] KVM: SVM: Handle MMIO during vectroing error

2024-12-11 Thread Sean Christopherson
On Mon, Nov 11, 2024, Ivan Orlov wrote: > Handle MMIO during vectoring error in check_emulate_instruction to > prevent infinite loop on SVM and eliminate the difference in how the > situation when the guest accesses MMIO during vectoring is handled on > SVM and VMX. > > Signed-off-by: Ivan Orlov

Re: [PATCH v2 3/6] KVM: VMX: Handle vectoring error in check_emulate_instruction

2024-12-11 Thread Sean Christopherson
On Mon, Nov 11, 2024, Ivan Orlov wrote: > Move unhandleable vmexit due to MMIO during vectoring error detection > into check_emulate_instruction. Implement a function which checks if > emul_type indicates MMIO so it can be used for both VMX and SVM. > > Fix the comment about EMULTYPE_PF as this fl

Re: [PATCH v2 1/6] KVM: x86: Add function for vectoring error generation

2024-12-11 Thread Sean Christopherson
On Mon, Nov 11, 2024, Ivan Orlov wrote: > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index f6900bec4874..f92740e7e107 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -6452,6 +6452,7 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, > fastpath_t ex

RE: [PATCH net] ipvs: Fix clamp() order in ip_vs_conn_init()

2024-12-11 Thread Julian Anastasov
Hello, On Wed, 11 Dec 2024, David Laight wrote: > From: Dan Carpenter > > Sent: 11 December 2024 13:17 > > > > We recently added some build time asserts to detect incorrect calls to > > clamp and it detected this bug which breaks the build. The variable > > in this clamp is "max_avail

Re: [RFC v1 0/5] Move kvfree_rcu() into SLAB

2024-12-11 Thread Paul E. McKenney
On Tue, Dec 10, 2024 at 05:40:30PM +0100, Uladzislau Rezki (Sony) wrote: > Hello! > > This series is based on v6.12 kernel. It is an attempt to move the > kvfree_rcu() > into MM from the kernel/rcu/ place. I split the series into a few patches so > it > is easier to follow a migration process. >

[PATCH v2 net] ipvs: Fix clamp() order in ip_vs_conn_init()

2024-12-11 Thread Dan Carpenter
We recently added some build time asserts to detect incorrect calls to clamp and it detected this bug which breaks the build. The variable in this clamp is "max_avail" and it should be the first argument. The code currently is the equivalent to max = min(max_avail, max). There probably aren't ve

Re: [PATCH net] ipvs: Fix clamp() order in ip_vs_conn_init()

2024-12-11 Thread Dan Carpenter
On Wed, Dec 11, 2024 at 02:27:06PM +, David Laight wrote: > From: Dan Carpenter > > Sent: 11 December 2024 13:17 > > > > We recently added some build time asserts to detect incorrect calls to > > clamp and it detected this bug which breaks the build. The variable > > in this clamp is "max_ava

Re: [PATCH] cgroup/cpuset: Prevent leakage of isolated CPUs into sched domains

2024-12-11 Thread Tejun Heo
On Thu, Dec 05, 2024 at 02:51:01PM -0500, Waiman Long wrote: > Isolated CPUs are not allowed to be used in a non-isolated partition. > The only exception is the top cpuset which is allowed to contain boot > time isolated CPUs. > > Commit ccac8e8de99c ("cgroup/cpuset: Fix remote root partition crea

[PATCH 19/19] rcu: Use kthread preferred affinity for RCU exp kworkers

2024-12-11 Thread Frederic Weisbecker
Now that kthreads have an infrastructure to handle preferred affinity against CPU hotplug and housekeeping cpumask, convert RCU exp workers to use it instead of handling all the constraints by itself. Acked-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker --- kernel/rcu/tree.c | 105

[PATCH 17/19] kthread: Unify kthread_create_on_cpu() and kthread_create_worker_on_cpu() automatic format

2024-12-11 Thread Frederic Weisbecker
kthread_create_on_cpu() uses the CPU argument as an implicit and unique printf argument to add to the format whereas kthread_create_worker_on_cpu() still relies on explicitly passing the printf arguments. This difference in behaviour is error prone and doesn't help standardizing per-CPU kthread nam

[PATCH 16/19] rcu: Use kthread preferred affinity for RCU boost

2024-12-11 Thread Frederic Weisbecker
Now that kthreads have an infrastructure to handle preferred affinity against CPU hotplug and housekeeping cpumask, convert RCU boost to use it instead of handling all the constraints by itself. Acked-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker --- kernel/rcu/tree.c| 27

[PATCH 18/19] treewide: Introduce kthread_run_worker[_on_cpu]()

2024-12-11 Thread Frederic Weisbecker
kthread_create() creates a kthread without running it yet. kthread_run() creates a kthread and runs it. On the other hand, kthread_create_worker() creates a kthread worker and runs it. This difference in behaviours is confusing. Also there is no way to create a kthread worker and affine it using

[PATCH 15/19] kthread: Implement preferred affinity

2024-12-11 Thread Frederic Weisbecker
Affining kthreads follow either of four existing different patterns: 1) Per-CPU kthreads must stay affine to a single CPU and never execute relevant code on any other CPU. This is currently handled by smpboot code which takes care of CPU-hotplug operations. 2) Kthreads that _have_ to be aff

[PATCH 11/19] kthread: Make sure kthread hasn't started while binding it

2024-12-11 Thread Frederic Weisbecker
Make sure the kthread is sleeping in the schedule_preempt_disabled() call before calling its handler when kthread_bind[_mask]() is called on it. This provides a sanity check verifying that the task is not randomly blocked later at some point within its function handler, in which case it could be ju

[PATCH 10/19] sched,arm64: Handle CPU isolation on last resort fallback rq selection

2024-12-11 Thread Frederic Weisbecker
When a kthread or any other task has an affinity mask that is fully offline or unallowed, the scheduler reaffines the task to all possible CPUs as a last resort. This default decision doesn't mix up very well with nohz_full CPUs that are part of the possible cpumask but don't want to be disturbed

[PATCH 12/19] kthread: Default affine kthread to its preferred NUMA node

2024-12-11 Thread Frederic Weisbecker
Kthreads attached to a preferred NUMA node for their task structure allocation can also be assumed to run preferrably within that same node. A more precise affinity is usually notified by calling kthread_create_on_cpu() or kthread_bind[_mask]() before the first wakeup. For the others, a default a

RE: [PATCH net] ipvs: Fix clamp() order in ip_vs_conn_init()

2024-12-11 Thread David Laight
From: Dan Carpenter > Sent: 11 December 2024 13:17 > > We recently added some build time asserts to detect incorrect calls to > clamp and it detected this bug which breaks the build. The variable > in this clamp is "max_avail" and it should be the first argument. The > code currently is the equi

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Xiao Liang
On Wed, Dec 11, 2024 at 10:07 PM Antonio Quartulli wrote: > > On 11/12/2024 14:53, Xiao Liang wrote: > > On Wed, Dec 11, 2024 at 8:51 PM Antonio Quartulli > > wrote: > >> > >> On 11/12/2024 13:35, Xiao Liang wrote: > >>> On Wed, Dec 11, 2024 at 7:30 PM Antonio Quartulli > >>> wrote: > > >

Re: [PATCH v2] kselftest/arm64: abi: fix SVCR detection

2024-12-11 Thread Mark Brown
On Wed, Dec 11, 2024 at 07:16:39PM +0800, Weizhao Ouyang wrote: > When using svcr_in to check ZA and Streaming Mode, we should make sure > that the value in x2 is correct, otherwise it may trigger an Illegal > instruction if FEAT_SVE and !FEAT_SME. Reviewed-by: Mark Brown Thanks for spotting thi

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Antonio Quartulli
On 11/12/2024 14:53, Xiao Liang wrote: On Wed, Dec 11, 2024 at 8:51 PM Antonio Quartulli wrote: On 11/12/2024 13:35, Xiao Liang wrote: On Wed, Dec 11, 2024 at 7:30 PM Antonio Quartulli wrote: Hi Xiao and thanks for chiming in, On 11/12/2024 04:08, Xiao Liang wrote: On Mon, Dec 9, 2024 at

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Xiao Liang
On Wed, Dec 11, 2024 at 8:51 PM Antonio Quartulli wrote: > > On 11/12/2024 13:35, Xiao Liang wrote: > > On Wed, Dec 11, 2024 at 7:30 PM Antonio Quartulli > > wrote: > >> > >> Hi Xiao and thanks for chiming in, > >> > >> On 11/12/2024 04:08, Xiao Liang wrote: > >>> On Mon, Dec 9, 2024 at 6:48 PM

Re: [PATCH net] ipvs: Fix clamp() order in ip_vs_conn_init()

2024-12-11 Thread Bartosz Golaszewski
On Wed, Dec 11, 2024 at 2:16 PM Dan Carpenter wrote: > > We recently added some build time asserts to detect incorrect calls to > clamp and it detected this bug which breaks the build. The variable > in this clamp is "max_avail" and it should be the first argument. The > code currently is the eq

[PATCH net] ipvs: Fix clamp() order in ip_vs_conn_init()

2024-12-11 Thread Dan Carpenter
We recently added some build time asserts to detect incorrect calls to clamp and it detected this bug which breaks the build. The variable in this clamp is "max_avail" and it should be the first argument. The code currently is the equivalent to max = max(max_avail, max). Reported-by: Linux Kerne

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Antonio Quartulli
On 11/12/2024 13:35, Xiao Liang wrote: On Wed, Dec 11, 2024 at 7:30 PM Antonio Quartulli wrote: Hi Xiao and thanks for chiming in, On 11/12/2024 04:08, Xiao Liang wrote: On Mon, Dec 9, 2024 at 6:48 PM Antonio Quartulli wrote: [...] +/** + * ovpn_nl_peer_modify - modify the peer attributes

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Xiao Liang
On Wed, Dec 11, 2024 at 7:30 PM Antonio Quartulli wrote: > > Hi Xiao and thanks for chiming in, > > On 11/12/2024 04:08, Xiao Liang wrote: > > On Mon, Dec 9, 2024 at 6:48 PM Antonio Quartulli > > wrote: > > [...] > >> +/** > >> + * ovpn_nl_peer_modify - modify the peer attributes according to th

Re: [PATCH net-next v14 17/22] ovpn: implement peer add/get/dump/delete via netlink

2024-12-11 Thread Antonio Quartulli
Hi Xiao and thanks for chiming in, On 11/12/2024 04:08, Xiao Liang wrote: On Mon, Dec 9, 2024 at 6:48 PM Antonio Quartulli wrote: [...] +/** + * ovpn_nl_peer_modify - modify the peer attributes according to the incoming msg + * @peer: the peer to modify + * @info: generic netlink info from th

[PATCH v2] kselftest/arm64: abi: fix SVCR detection

2024-12-11 Thread Weizhao Ouyang
When using svcr_in to check ZA and Streaming Mode, we should make sure that the value in x2 is correct, otherwise it may trigger an Illegal instruction if FEAT_SVE and !FEAT_SME. Fixes: 43e3f85523e4 ("kselftest/arm64: Add SME support to syscall ABI test") Signed-off-by: Weizhao Ouyang --- .../se

[PATCH v3] vdpa: solidrun: Replace deprecated PCI functions

2024-12-11 Thread Philipp Stanner
The PCI functions pcim_iomap_regions() pcim_iounmap_regions() pcim_iomap_table() have been deprecated by the PCI subsystem. Replace these functions with their successors pcim_iomap_region() and pcim_iounmap_region(). Signed-off-by: Philipp Stanner --- Changes in v3: -

Re: [PATCH RFC v3 02/10] sched_getattr: port to copy_struct_to_user

2024-12-11 Thread Christian Brauner
On Tue, Dec 10, 2024 at 07:14:07PM +0100, Florian Weimer wrote: > * Aleksa Sarai: > > > sched_getattr(2) doesn't care about trailing non-zero bytes in the > > (ksize > usize) case, so just use copy_struct_to_user() without checking > > ignored_trailing. > > I think this is what causes glibc's mis

Re: [PATCH net-next v14 22/22] testing/selftests: add test tool and scripts for ovpn module

2024-12-11 Thread Antonio Quartulli
On 10/12/2024 17:47, Simon Horman wrote: On Mon, Dec 09, 2024 at 09:53:31AM +0100, Antonio Quartulli wrote: 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 RT

Re: [PATCH net-next v14 08/22] ovpn: implement basic RX path (UDP)

2024-12-11 Thread Antonio Quartulli
On 10/12/2024 17:44, Simon Horman wrote: On Mon, Dec 09, 2024 at 09:53:17AM +0100, Antonio Quartulli wrote: 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 a

Re: [PATCH v3 2/4] misc: pci_endpoint_test: Fix the return value of IOCTL

2024-12-11 Thread Manivannan Sadhasivam
On Wed, Dec 11, 2024 at 05:37:27PM +0900, Damien Le Moal wrote: > On 12/11/24 5:01 PM, Manivannan Sadhasivam wrote: > > struct pci_test { > > @@ -52,63 +51,65 @@ static int run_test(struct pci_test *test) > > ret = ioctl(fd, PCITEST_BAR, test->barnum); > > fprintf(stdout, "

Re: [PATCH v3 2/4] misc: pci_endpoint_test: Fix the return value of IOCTL

2024-12-11 Thread Damien Le Moal
On 12/11/24 5:01 PM, Manivannan Sadhasivam wrote: > struct pci_test { > @@ -52,63 +51,65 @@ static int run_test(struct pci_test *test) > ret = ioctl(fd, PCITEST_BAR, test->barnum); > fprintf(stdout, "BAR%d:\t\t", test->barnum); > if (ret < 0) > -

[PATCH v3 4/4] selftests: pci_endpoint: Migrate to Kselftest framework

2024-12-11 Thread Manivannan Sadhasivam
Migrate the PCI endpoint test to Kselftest framework. All the tests that were part of the previous pcitest.sh file were migrated. Below is the exclusive list of tests: 1. BAR Tests (BAR0 to BAR5) 2. Legacy IRQ Tests 3. MSI Interrupt Tests (MSI1 to MSI32) 4. MSI-X Interrupt Tests (MSI-X1 to MSI-X2

[PATCH v3 2/4] misc: pci_endpoint_test: Fix the return value of IOCTL

2024-12-11 Thread Manivannan Sadhasivam
IOCTLs are supposed to return 0 for success and negative error codes for failure. Currently, this driver is returning 0 for failure and 1 for success, that's not correct. Hence, fix it! Reported-by: Greg Kroah-Hartman Closes: https://lore.kernel.org/all/yvzng5ronxeap...@kroah.com Fixes: 2c156ac71

[PATCH v3 3/4] selftests: Move PCI Endpoint tests from tools/pci to Kselftests

2024-12-11 Thread Manivannan Sadhasivam
This just moves the existing tests under tools/pci to tools/testing/selftests/pci_endpoint and adjusts the paths in Makefile accordingly. Migration to Kselftest framework will be done in subsequent commits. Signed-off-by: Manivannan Sadhasivam --- Documentation/PCI/endpoint/pci-test-howto.rst

[PATCH v3 1/4] PCI: qcom-ep: Mark BAR0/BAR2 as 64bit BARs and BAR1/BAR3 as RESERVED

2024-12-11 Thread Manivannan Sadhasivam
On all Qcom endpoint SoCs, BAR0/BAR2 are 64bit BARs by default and software cannot change the type. So mark the those BARs as 64bit BARs and also mark the successive BAR1/BAR3 as RESERVED BARs so that the EPF drivers cannot use them. Cc: stable+noauto...@kernel.org # depends on patch introducing o

[PATCH v3 0/4] Migrate PCI Endpoint Subsystem tests to Kselftest

2024-12-11 Thread Manivannan Sadhasivam
Hi, This series carries forward the effort to add Kselftest for PCI Endpoint Subsystem started by Aman Gupta [1] a while ago. I reworked the initial version based on another patch that fixes the return values of IOCTLs in pci_endpoint_test driver and did many cleanups. Since the resulting work mod