Re: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-09 Thread Gur Stavi
>> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, struct >> fanout_args *args) >> err = -EINVAL; >> >> spin_lock(&po->bind_lock); >> -if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && >> -match->type == type && >> +if (match->type == type && >> mat

Re: 6.12-rc1: Lockdep regression bissected (virtio-net/console/scheduler)

2024-10-09 Thread Breno Leitao
On Wed, Oct 09, 2024 at 04:44:24PM +0100, Pavel Begunkov wrote: > On 10/8/24 16:18, John Ogness wrote: > > On 2024-10-04, Petr Mladek wrote: > > > On Fri 2024-10-04 02:08:52, Breno Leitao wrote: > > > > = > > > > WARNING: HARDIR

Re: [PATCH bpf-next v2 0/6] selftests/bpf: Various sockmap-related fixes

2024-10-09 Thread Michal Luczaj
t to run cleanly. Anyway, so those are the fixes mentioned, targeting bpf: https://lore.kernel.org/bpf/20241009-vsock-fixes-for-redir-v1-0-e455416f6...@rbox.co/ > Not sure if anything from bpf-next gets backported if it has a Fixes > tag. We can ask the stable kernel maintainers, if needed.

Re: [PATCH v2 07/10] rcu/tasks: Check RCU watching state for holdout idle injection tasks

2024-10-09 Thread Frederic Weisbecker
Le Wed, Oct 09, 2024 at 06:21:24PM +0530, neeraj.upadh...@kernel.org a écrit : > From: Neeraj Upadhyay > > Use RCU watching state of a CPU to check whether RCU-tasks GP > need to wait for idle injection task on that CPU. Idle injection > tasks which are in deep-idle states where RCU is not watchi

[PATCH v3 02/11] iommufd: Rename _iommufd_object_alloc to iommufd_object_alloc_elm

2024-10-09 Thread Nicolin Chen
Currently, the object allocation function calls: level-0: iommufd_object_alloc() level-1: __iommufd_object_alloc() level-2: _iommufd_object_alloc() So the level-1 and level-2 look inverted. The level-1 allocator is a container_of converter with a pointer sanity, backing the level-0 al

[PATCH v3 09/11] iommufd/selftest: Add IOMMU_VIOMMU_ALLOC test coverage

2024-10-09 Thread Nicolin Chen
Add a new iommufd_viommu FIXTURE and setup it up with a vIOMMU object. Any new vIOMMU feature will be added as a TEST_F under that. Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd_utils.h | 28 +++ tools/testing/selftests/iommu/iommufd.c | 84 +++

[PATCH v3 11/11] iommu/arm-smmu-v3: Add IOMMU_VIOMMU_TYPE_ARM_SMMUV3 support

2024-10-09 Thread Nicolin Chen
Add a new driver-type for ARM SMMUv3 to enum iommu_viommu_type. Implement the viommu_alloc op with an arm_vsmmu_alloc function. As an initial step, copy the VMID from s2_parent. A later cleanup series is required to move the VMID allocation out of the stage-2 domain allocation routine to this. Sig

[PATCH v3 04/11] iommufd/viommu: Add IOMMU_VIOMMU_ALLOC ioctl

2024-10-09 Thread Nicolin Chen
Add a new ioctl for user space to do a vIOMMU allocation. It must be based on a nesting parent HWPT, so take its refcount. As an initial version, define an IOMMU_VIOMMU_TYPE_DEFAULT type. Using it, the object will be allocated by the iommufd core. If an IOMMU driver supports a driver-managed vIOM

[PATCH v3 00/16] cover-letter: iommufd: Add vIOMMU infrastructure (Part-2: vDEVICE)

2024-10-09 Thread Nicolin Chen
Following the previous vIOMMU series, this adds another vDEVICE structure, representing the association from an iommufd_device to an iommufd_viommu. This gives the whole architecture a new "v" layer: ___ | i

[PATCH v3 01/11] iommufd: Move struct iommufd_object to public iommufd header

2024-10-09 Thread Nicolin Chen
Prepare for an embedded structure design for driver-level iommufd_viommu objects: // include/linux/iommufd.h struct iommufd_viommu { struct iommufd_object obj; }; // Some IOMMU driver struct iommu_driver_viommu { struct iommufd_viommu core;

[PATCH v3 03/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-09 Thread Nicolin Chen
Add a new IOMMUFD_OBJ_VIOMMU with an iommufd_viommu structure to represent a slice of physical IOMMU device passed to or shared with a user space VM. This slice, now a vIOMMU object, is a group of virtualization resources of a physical IOMMU's, such as: - Security namespace for guest owned ID, e.g

[PATCH v3 10/11] Documentation: userspace-api: iommufd: Update vIOMMU

2024-10-09 Thread Nicolin Chen
With the introduction of the new object and its infrastructure, update the doc to reflect that and add a new graph. Signed-off-by: Nicolin Chen --- Documentation/userspace-api/iommufd.rst | 66 - 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/Documentation/

[PATCH v3 07/11] iommufd/selftest: Add refcount to mock_iommu_device

2024-10-09 Thread Nicolin Chen
For an iommu_dev that can unplug (so far only this selftest does so), the viommu->iommu_dev pointer has no guarantee of its life cycle after it is copied from the idev->dev->iommu->iommu_dev. Track the user count of the iommu_dev. Delay the exit routine if refcount is unbalanced. The refcount inc/

[PATCH v3 00/11] cover-letter: iommufd: Add vIOMMU infrastructure (Part-1)

2024-10-09 Thread Nicolin Chen
This series introduces a new vIOMMU infrastructure and related ioctls. IOMMUFD has been using the HWPT infrastructure for all cases, including a nested IO page table support. Yet, there're limitations for an HWPT-based structure to support some advanced HW-accelerated features, such as CMDQV on NV

[PATCH v3 08/11] iommufd/selftest: Add IOMMU_VIOMMU_TYPE_SELFTEST

2024-10-09 Thread Nicolin Chen
Implement the viommu alloc/free functions to increase/reduce refcount of its dependent mock iommu device. User space can verify this loop via the IOMMU_VIOMMU_TYPE_SELFTEST. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/iommufd_test.h | 2 ++ drivers/iommu/iommufd/selftest.c | 45 ++

[PATCH v3 05/11] iommu: Pass in a viommu pointer to domain_alloc_user op

2024-10-09 Thread Nicolin Chen
With a viommu object wrapping a potentially shareable S2 domain, a nested domain should be allocated by associating to a viommu instead. For drivers without a viommu support, keep the parent domain input, which should be just viommu->hwpt->common.domain otherwise. Signed-off-by: Nicolin Chen ---

[PATCH v3 06/11] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-10-09 Thread Nicolin Chen
Now a vIOMMU holds a shareable nesting parent HWPT. So, it can act like that nesting parent HWPT to allocate a nested HWPT. Support that in the IOMMU_HWPT_ALLOC ioctl handler, and update its kdoc. Also, associate a vIOMMU to an allocating nested HWPT. Reviewed-by: Jason Gunthorpe Signed-off-by:

[PATCH v3 02/16] iommufd/viommu: Add a default_viommu_ops for IOMMU_VIOMMU_TYPE_DEFAULT

2024-10-09 Thread Nicolin Chen
An IOMMU_VIOMMU_TYPE_DEFAULT doesn't need a free() op since the core can free everything in the destroy(). Now with the new vDEVICE structure, it might want to allocate its own vDEVICEs. Add a default_viommu_ops for driver to hook ops for default vIOMMUs. Signed-off-by: Nicolin Chen --- include

[PATCH v3 01/16] iommufd/viommu: Introduce IOMMUFD_OBJ_VDEVICE and its related struct

2024-10-09 Thread Nicolin Chen
Introduce a new IOMMUFD_OBJ_VDEVICE to represent a physical device, i.e. iommufd_device (idev) object, against an iommufd_viommu (vIOMMU) object in the VM. This vDEVICE object (and its structure) holds all the information and attributes in a VM, regarding the device related to the vIOMMU. As an in

[PATCH v3 05/16] iommu/viommu: Add cache_invalidate for IOMMU_VIOMMU_TYPE_DEFAULT

2024-10-09 Thread Nicolin Chen
This per-vIOMMU cache_invalidate op is like the cache_invalidate_user op in struct iommu_domain_ops, but wider, supporting device cache (e.g. PCI ATC invaldiations). Reviewed-by: Jason Gunthorpe Signed-off-by: Nicolin Chen --- include/linux/iommufd.h | 10 ++ 1 file changed, 10 insertio

[PATCH v3 03/16] iommufd/viommu: Add IOMMU_VDEVICE_ALLOC ioctl

2024-10-09 Thread Nicolin Chen
Introduce a new ioctl to allocate a vDEVICE object. Since a vDEVICE object is a connection of an iommufd_iommufd object and an iommufd_viommu object, require both as the ioctl inputs and take refcounts in the ioctl handler. Add to the vIOMMU object a "vdevs" xarray, indexed by a per-vIOMMU virtual

[PATCH v3 04/16] iommufd/selftest: Add IOMMU_VDEVICE_ALLOC test coverage

2024-10-09 Thread Nicolin Chen
Add a vdevice_alloc TEST_F to cover the new IOMMU_VDEVICE_ALLOC ioctls. Also add a vdevice_alloc op to the viommu mock_viommu_ops for a coverage of IOMMU_VIOMMU_TYPE_SELFTEST. The DEFAULT coverage is done via a core- allocated vDEVICE object. Signed-off-by: Nicolin Chen --- tools/testing/selfte

[PATCH v3 08/16] iommu: Add iommu_copy_struct_from_full_user_array helper

2024-10-09 Thread Nicolin Chen
From: Jason Gunthorpe The iommu_copy_struct_from_user_array helper can be used to copy a single entry from a user array which might not be efficient if the array is big. Add a new iommu_copy_struct_from_full_user_array to copy the entire user array at once. Update the existing iommu_copy_struct_

[PATCH v3 13/16] Documentation: userspace-api: iommufd: Update vDEVICE

2024-10-09 Thread Nicolin Chen
With the introduction of the new object and its infrastructure, update the doc and the vIOMMU graph to reflect that. Signed-off-by: Nicolin Chen --- Documentation/userspace-api/iommufd.rst | 58 ++--- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/Documentati

[PATCH v3 07/16] iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

2024-10-09 Thread Nicolin Chen
With a vIOMMU object, use space can flush any IOMMU related cache that can be directed using the vIOMMU object. It is similar to IOMMU_HWPT_INVALIDATE uAPI, but can cover a wider range than IOTLB, e.g. device/desciprtor cache. Allow hwpt_id of the iommu_hwpt_invalidate structure to carry a viommu_

[PATCH v3 09/16] iommufd/viommu: Add vdev_to_dev helper

2024-10-09 Thread Nicolin Chen
This avoids a bigger trouble of moving the struct iommufd_device to the public header. Signed-off-by: Nicolin Chen --- include/linux/iommufd.h| 7 +++ drivers/iommu/iommufd/viommu_api.c | 7 +++ 2 files changed, 14 insertions(+) diff --git a/include/linux/iommufd.h b/include

[PATCH v3 06/16] iommufd/hw_pagetable: Allow viommu->ops->cache_invalidate for hwpt_nested

2024-10-09 Thread Nicolin Chen
Now cache entries for hwpt_nested can be invalidated via the vIOMMU's cache_invalidate op alternatively. Allow iommufd_hwpt_nested_alloc to support such a case. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/hw_pagetable.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-

[PATCH v3 10/16] iommufd/selftest: Add mock_viommu_cache_invalidate

2024-10-09 Thread Nicolin Chen
Similar to the coverage of cache_invalidate_user for iotlb invalidation, add a device cache and a viommu_cache_invalidate function to test it out. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/iommufd_test.h | 25 + drivers/iommu/iommufd/selftest.c | 79 ++

[PATCH v3 11/16] iommufd/selftest: Add IOMMU_TEST_OP_DEV_CHECK_CACHE test command

2024-10-09 Thread Nicolin Chen
Similar to IOMMU_TEST_OP_MD_CHECK_IOTLB verifying a mock_domain's iotlb, IOMMU_TEST_OP_DEV_CHECK_CACHE will be used to verify a mock_dev's cache. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/iommufd_test.h | 5 tools/testing/selftests/iommu/iommufd_utils.h | 24 ++

[PATCH v3 12/16] iommufd/selftest: Add vIOMMU coverage for IOMMU_HWPT_INVALIDATE ioctl

2024-10-09 Thread Nicolin Chen
Add a viommu_cache test function to cover vIOMMU invalidations using the updated IOMMU_HWPT_INVALIDATE ioctl, which now allows passing in a vIOMMU via its hwpt_id field. Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd_utils.h | 32 tools/testing/selftests/iommu/iommuf

[PATCH v3 14/16] iommu/arm-smmu-v3: Add arm_vsmmu_cache_invalidate

2024-10-09 Thread Nicolin Chen
Implement the vIOMMU's cache_invalidate op for user space to invalidate the IOTLB entries, Device ATS and CD entries that are still cached by hardware. Add struct iommu_viommu_arm_smmuv3_invalidate defining invalidation entries that are simply in the native format of a 128-bit TLBI command. Scan t

[PATCH v3 16/16] iommu/arm-smmu-v3: Update comments about ATS and bypass

2024-10-09 Thread Nicolin Chen
From: Jason Gunthorpe The SMMUv3 spec has a note that BYPASS and ATS don't work together under the STE EATS field definition. However there is another section "13.6.4 Full ATS skipping stage 1" that explains under certain conditions BYPASS and ATS do work together if the STE is using S1DSS to sel

[PATCH v3 15/16] iommu/arm-smmu-v3: Allow ATS for IOMMU_DOMAIN_NESTED

2024-10-09 Thread Nicolin Chen
From: Jason Gunthorpe Now, ATC invalidation can be done with the vIOMMU invalidation op. A guest owned IOMMU_DOMAIN_NESTED can do an ATS too. Allow it to pass in the EATS field via the vSTE words. Signed-off-by: Jason Gunthorpe Signed-off-by: Nicolin Chen --- drivers/iommu/arm/arm-smmu-v3/arm

Re: [PATCH v3] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-09 Thread Tejun Heo
On Tue, Oct 08, 2024 at 05:35:18PM +0200, Björn Töpel wrote: > From: Björn Töpel > > The sched_ext selftests is missing proper cross-compilation support, a > proper target entry, and out-of-tree build support. > > When building the kselftest suite, e.g.: > > make ARCH=riscv CROSS_COMPILE=risc

Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-10-09 Thread Stephen Boyd
Quoting Guenter Roeck (2024-10-08 16:27:37) > On 10/8/24 16:12, Stephen Boyd wrote: > > > > The best I can come up with then is to test for a NULL of_root when > > CONFIG_ARM64 and CONFIG_ACPI are enabled, because the tests > > intentionally don't work when both those configs are enabled and the >

Re: (subset) [RFC PATCH 1/2] mfd: 88pm886: add the RTC cell and relevant definitions

2024-10-09 Thread Karel Balej
Lee Jones, 2024-10-09T11:06:43+01:00: > On Fri, 20 Sep 2024 18:12:34 +0200, Karel Balej wrote: > > RTC lives on the base register page of the chip. Add definitions of the > > registers needed for a basic set/read time functionality. > > > > > > Applied, thanks! Thank you, however I'm a little pe

Re: 6.12-rc1: Lockdep regression bissected (virtio-net/console/scheduler)

2024-10-09 Thread Pavel Begunkov
On 10/8/24 16:18, John Ogness wrote: On 2024-10-04, Petr Mladek wrote: On Fri 2024-10-04 02:08:52, Breno Leitao wrote: = WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected 6.12.0-rc1-kbuilder-virtme-00033-g

[PATCH RFC v3 10/10] selftests: mount_setattr: add CHECK_FIELDS selftest

2024-10-09 Thread Aleksa Sarai
While we're at it -- to make testing for error codes with ASSERT_* easier, make the sys_* wrappers return -errno in case of an error. For some reason, the include doesn't correct import , leading to compilation errors -- so just import manually. Signed-off-by: Aleksa Sarai --- tools/include/u

[PATCH RFC v3 07/10] clone3: add CHECK_FIELDS flag to usize argument

2024-10-09 Thread Aleksa Sarai
As with openat2(2), this allows userspace to easily figure out what flags and fields are supported by clone3(2). For fields which are not flag-based, we simply set every bit in the field so that a naive bitwise-and would show that any value of the field is valid. For args->exit_signal, since we ha

[PATCH RFC v3 06/10] selftests: openat2: add CHECK_FIELDS selftests

2024-10-09 Thread Aleksa Sarai
Signed-off-by: Aleksa Sarai --- tools/testing/selftests/openat2/Makefile | 2 + tools/testing/selftests/openat2/openat2_test.c | 161 - 2 files changed, 161 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/openat2/Makefile b/tools/testing/selfte

[PATCH RFC v3 05/10] selftests: openat2: add 0xFF poisoned data after misaligned struct

2024-10-09 Thread Aleksa Sarai
We should also verify that poisoned data after a misaligned struct is also handled correctly by is_zeroed_user(). This test passes with no kernel changes needed, so is_zeroed_user() was correct already. Fixes: b28a10aedcd4 ("selftests: add openat2(2) selftests") Signed-off-by: Aleksa Sarai --- t

[PATCH RFC v3 08/10] selftests: clone3: add CHECK_FIELDS selftests

2024-10-09 Thread Aleksa Sarai
Signed-off-by: Aleksa Sarai --- tools/testing/selftests/clone3/.gitignore | 1 + tools/testing/selftests/clone3/Makefile| 4 +- .../testing/selftests/clone3/clone3_check_fields.c | 264 + 3 files changed, 267 insertions(+), 2 deletions(-) diff --git a

[PATCH RFC v3 09/10] mount_setattr: add CHECK_FIELDS flag to usize argument

2024-10-09 Thread Aleksa Sarai
As with openat2(2), this allows userspace to easily figure out what flags and fields are supported by mount_setattr(2). As with clone3(2), for fields which are not flag-based, we simply set every bit in the field so that a naive bitwise-and would show that any value of the field is valid. The inte

Re: [PATCH 2/3] rcu/nocb: Fix rcuog wake-up from offline softirq

2024-10-09 Thread Frederic Weisbecker
Le Wed, Oct 09, 2024 at 02:23:15PM -0400, Joel Fernandes a écrit : > Hi Frederic, > > On Wed, Oct 2, 2024 at 10:57 AM Frederic Weisbecker > wrote: > > > > After a CPU has set itself offline and before it eventually calls > > rcutree_report_cpu_dead(), there are still opportunities for callbacks

[PATCH rcu 0/7] Miscellaneous changes for v6.13

2024-10-09 Thread Paul E. McKenney
Hello! This series contains miscelleous updates for v6.13: 1. Add rcuog kthreads to RCU_NOCB_CPU help text. 2. Add rcuog kthreads to kernel-per-CPU-kthreads.rst. 3. Allow short-circuiting of synchronize_rcu_tasks_rude(). 4. Permit start_poll_synchronize_rcu*() with interrup

[PATCH rcu 5/7] rcutorture: Test start-poll primitives with interrupts disabled

2024-10-09 Thread Paul E. McKenney
This commit tests the ->start_poll() and ->start_poll_full() functions with interrupts disabled, but only for RCU variants setting the ->start_poll_irqsoff flag. Signed-off-by: Paul E. McKenney --- kernel/rcu/rcutorture.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/kernel/rcu

[PATCH rcu 3/7] rcu: Allow short-circuiting of synchronize_rcu_tasks_rude()

2024-10-09 Thread Paul E. McKenney
There are now architectures for which all deep-idle and entry-exit functions are properly inlined or marked noinstr. Such architectures do not need synchronize_rcu_tasks_rude(), or will not once RCU Tasks has been modified to pay attention to idle tasks. This commit therefore allows a CONFIG_ARCH

[PATCH rcu 5/5] rcutorture: Avoid printing cpu=-1 for no-fault RCU boost failure

2024-10-09 Thread Paul E. McKenney
If a CPU runs throughout the stalled grace period without passing through a quiescent state, RCU priority boosting cannot help. The rcu_torture_boost_failed() function therefore prints a message flagging the first such CPU. However, if the stall was instead due to (for example) RCU's grace-period

[PATCH rcu 3/5] refscale: Correct affinity check

2024-10-09 Thread Paul E. McKenney
The current affinity check works fine until there are more reader processes than CPUs, at which point the affinity check is looking for non-existent CPUs. This commit therefore applies the same modulus to the check as is present in the set_cpus_allowed_ptr() call. Signed-off-by: Paul E. McKenney

[PATCH rcu 2/5] torture: Add --no-affinity parameter to kvm.sh

2024-10-09 Thread Paul E. McKenney
In performance tests, it can be counter-productive to spread torture-test guest OSes across sockets. Plus the experimenter might have ideas about what CPUs individual guest OSes are to run on. This commit therefore adds a --no-affinity parameter to kvm.sh to prevent it from running taskset on its

[PATCH rcu 4/5] rcuscale: Add guest_os_delay module parameter

2024-10-09 Thread Paul E. McKenney
This commit adds a guest_os_delay module parameter that extends warm-up and cool-down the specified number of seconds before and after the series of test runs. This allows the data-collection intervals from any given rcuscale guest OSes to line up with active periods in the other rcuscale guest OS

[PATCH rcu 1/5] refscale: Add test for sched_clock()

2024-10-09 Thread Paul E. McKenney
This commit adds a "sched-clock" test for the sched_clock() function. Signed-off-by: Paul E. McKenney --- kernel/rcu/refscale.c | 38 -- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c index 0db9db73

[PATCH rcu 0/5] Torture-test changes for v6.13

2024-10-09 Thread Paul E. McKenney
Hello! This series contains torture-test changes for v6.13: 1. Add test for sched_clock(). 2. Add --no-affinity parameter to kvm.sh. 3. Correct affinity check. 4. Add guest_os_delay module parameter. 5. Avoid printing cpu=-1 for no-fault RCU boost failure.

[PATCH rcu 4/7] rcu: Permit start_poll_synchronize_rcu*() with interrupts disabled

2024-10-09 Thread Paul E. McKenney
The header comment for both start_poll_synchronize_rcu() and start_poll_synchronize_rcu_full() state that interrupts must be enabled when calling these two functions, and there is a lockdep assertion in start_poll_synchronize_rcu_common() enforcing this restriction. However, there is no need for t

[PATCH rcu 6/7] doc: Remove kernel-parameters.txt entry for rcutorture.read_exit

2024-10-09 Thread Paul E. McKenney
There is only ever the one read-exit task, and there is no module parameter named rcutorture.read_exit, so remove the bogus documentation. Instead, use rcutorture.read_exit_burst to enable/disable read-exit race testing. Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko

[PATCH rcu 1/7] rcu: Add rcuog kthreads to RCU_NOCB_CPU help text

2024-10-09 Thread Paul E. McKenney
The RCU_NOCB_CPU help text currently fails to mention rcuog kthreads, so this commit adds this information. Reported-by: Olivier Langlois Signed-off-by: Paul E. McKenney --- kernel/rcu/Kconfig | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/ker

[PATCH rcu 7/7] rcu-tasks: Remove open-coded one-byte cmpxchg() emulation

2024-10-09 Thread Paul E. McKenney
This commit removes the open-coded one-byte cmpxchg() emulation from rcu_trc_cmpxchg_need_qs(), replacing it with just cmpxchg() given the latter's new-found ability to handle single-byte arguments across all architectures. Signed-off-by: Paul E. McKenney --- kernel/rcu/tasks.h | 17 +---

[PATCH rcu 2/7] doc: Add rcuog kthreads to kernel-per-CPU-kthreads.rst

2024-10-09 Thread Paul E. McKenney
This commit adds the rcuog kthreads to the list of callback-offloading kthreads that can be affinitied away from worker CPUs. Signed-off-by: Paul E. McKenney --- Documentation/admin-guide/kernel-per-CPU-kthreads.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentatio

RE: [PATCH net-next v02 1/2] af_packet: allow fanout_add when socket is not RUNNING

2024-10-09 Thread Gur Stavi
> Gur Stavi wrote: > > >> @@ -1846,21 +1846,21 @@ static int fanout_add(struct sock *sk, > struct fanout_args *args) > > >> err = -EINVAL; > > >> > > >> spin_lock(&po->bind_lock); > > >> -if (packet_sock_flag(po, PACKET_SOCK_RUNNING) && > > >> -match->type == t

[PATCH rcu 3/3] rcu: Finer-grained grace-period-end checks in rcu_dump_cpu_stacks()

2024-10-09 Thread Paul E. McKenney
This commit pushes the grace-period-end checks further down into rcu_dump_cpu_stacks(), and also uses lockless checks coupled with finer-grained locking. The result is that the current leaf rcu_node structure's ->lock is acquired only if a stack backtrace might be needed from the current CPU, and

[PATCH rcu 1/3] rcu: Delete unused rcu_gp_might_be_stalled() function

2024-10-09 Thread Paul E. McKenney
The rcu_gp_might_be_stalled() function is no longer used, so this commit removes it. Signed-off-by: Paul E. McKenney --- include/linux/rcutiny.h | 1 - include/linux/rcutree.h | 1 - kernel/rcu/tree_stall.h | 30 -- 3 files changed, 32 deletions(-) diff --git a/inc

[PATCH rcu 2/3] rcu: Stop stall warning from dumping stacks if grace period ends

2024-10-09 Thread Paul E. McKenney
Currently, once an RCU CPU stall warning decides to dump the stalling CPUs' stacks, the rcu_dump_cpu_stacks() function persists until it has gone through the full list. Unfortunately, if the stalled grace periods ends midway through, this function will be dumping stacks of innocent-bystander CPUs

[PATCH rcu 0/3] RCU CPU stall-warning changes for v6.13

2024-10-09 Thread Paul E. McKenney
Hello! This series contains RCU CPU stall-warning changes for v6.13: 1. Delete unused rcu_gp_might_be_stalled() function. 2. Stop stall warning from dumping stacks if grace period ends. 3. Finer-grained grace-period-end checks in rcu_dump_cpu_stacks().

[PATCH rcu 04/12] srcu: Bit manipulation changes for additional reader flavor

2024-10-09 Thread Paul E. McKenney
Currently, there are only two flavors of readers, normal and NMI-safe. Very straightforward state updates suffice to check for erroneous mixing of reader flavors on a given srcu_struct structure. This commit upgrades the checking in preparation for the addition of light-weight (as in memory-barrie

[PATCH rcu 05/12] srcu: Standardize srcu_data pointers to "sdp" and similar

2024-10-09 Thread Paul E. McKenney
This commit changes a few "cpuc" variables to "sdp" to align wiht usage elsewhere. Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Kent Overstreet Cc: --- include/linux/srcu.h | 35 ++ include/linux/srcutr

[PATCH rcu 09/12] rcutorture: Add reader_flavor parameter for SRCU readers

2024-10-09 Thread Paul E. McKenney
This commit adds an rcutorture.reader_flavor parameter whose bits correspond to reader flavors. For example, SRCU's readers are 0x1 for normal and 0x2 for NMI-safe. Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Kent Overstreet Cc: --- ...

[PATCH rcu 11/12] rcutorture: Add light-weight SRCU scenario

2024-10-09 Thread Paul E. McKenney
This commit adds an rcutorture scenario that tests light-weight SRCU readers. While in the area, it adjusts the size of the TREE10 scenario. Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Kent Overstreet Cc: --- tools/testing/selftests/rcu

[PATCH rcu 12/12] refscale: Add srcu_read_lock_lite() support using "srcu-lite"

2024-10-09 Thread Paul E. McKenney
This commit creates a new srcu-lite option for the refscale.scale_type module parameter that selects srcu_read_lock_lite() and srcu_read_unlock_lite(). Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Kent Overstreet Cc: --- kernel/rcu/refsca

[PATCH rcu 07/12] srcu: Allow inlining of __srcu_read_{,un}lock_lite()

2024-10-09 Thread Paul E. McKenney
This commit moves __srcu_read_lock_lite() and __srcu_read_unlock_lite() into include/linux/srcu.h and marks them "static inline" so that they can be inlined into srcu_read_lock_lite() and srcu_read_unlock_lite(), respectively. They are not hand-inlined due to Tree SRCU and Tiny SRCU having differe

[PATCH rcu 08/12] rcutorture: Expand RCUTORTURE_RDR_MASK_[12] to eight bits

2024-10-09 Thread Paul E. McKenney
This commit prepares for testing of multiple SRCU reader flavors by expanding RCUTORTURE_RDR_MASK_1 and RCUTORTURE_RDR_MASK_2 from a single bit to eight bits, allowing them to accommodate the return values from multiple calls to srcu_read_lock*(). This will in turn permit better testing coverage f

[PATCH rcu 10/12] rcutorture: Add srcu_read_lock_lite() support to rcutorture.reader_flavor

2024-10-09 Thread Paul E. McKenney
This commit causes bit 0x4 of rcutorture.reader_flavor to select the new srcu_read_lock_lite() and srcu_read_unlock_lite() functions. Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Kent Overstreet Cc: --- Documentation/admin-guide/kernel-pa

[PATCH rcu 06/12] srcu: Add srcu_read_lock_lite() and srcu_read_unlock_lite()

2024-10-09 Thread Paul E. McKenney
This patch adds srcu_read_lock_lite() and srcu_read_unlock_lite(), which dispense with the read-side smp_mb() but also are restricted to code regions that RCU is watching. If a given srcu_struct structure uses srcu_read_lock_lite() and srcu_read_unlock_lite(), it is not permitted to use any other

[PATCH rcu 01/12] srcu: Rename srcu_might_be_idle() to srcu_should_expedite()

2024-10-09 Thread Paul E. McKenney
SRCU auto-expedites grace periods that follow a sufficiently long idle period, and the srcu_might_be_idle() function is used to make this decision. However, the upcoming light-weight SRCU readers will not do auto-expediting because doing so would cause the grace-period machinery to invoke synchron

[PATCH rcu 02/12] srcu: Introduce srcu_gp_is_expedited() helper function

2024-10-09 Thread Paul E. McKenney
Even though the open-coded expressions usually fit on one line, this commit replaces them with a call to a new srcu_gp_is_expedited() helper function in order to improve readability. Signed-off-by: Paul E. McKenney Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Peter Zijlstra Cc: Kent Overstre

[PATCH rcu 03/12] srcu: Renaming in preparation for additional reader flavor

2024-10-09 Thread Paul E. McKenney
Currently, there are only two flavors of readers, normal and NMI-safe. A number of fields, functions, and types reflect this restriction. This renaming-only commit prepares for the addition of light-weight (as in memory-barrier-free) readers. OK, OK, there is also a drive-by white-space fixeup! S

[PATCH rcu 0/12] SRCU-lite changes for v6.13

2024-10-09 Thread Paul E. McKenney
Hello! This series adds support and testing for srcu_read_lock_lite() and srcu_read_unlock_lite(), which avoid smp_mb(), but add a couple of synchronize_rcu() calls to the grace-period processing and may only be used where RCU is watching. 1. Rename srcu_might_be_idle() to srcu_should_expedi

Re: [PATCH] KVM: selftests: memslot_perf_test: increase guest sync timeout

2024-10-09 Thread Sean Christopherson
On Fri, 04 Oct 2024 18:01:53 -0400, Maxim Levitsky wrote: > When memslot_perf_test is run nested, first iteration of test_memslot_rw_loop > testcase, sometimes takes more than 2 seconds due to build of shadow page > tables. > > Following iterations are fast. > > To be on the safe side, bump the

Re: [PATCH] mailbox, remoteproc: k3-m4+: fix compile testing

2024-10-09 Thread Mathieu Poirier
Hi Arnd, On Mon, Oct 07, 2024 at 01:23:57PM +, Arnd Bergmann wrote: > From: Arnd Bergmann > > The k3-m4 remoteproc driver was merged with incorrect dependencies. > Despite multiple people trying to fix this, the version 6.12-rc2 > remains broken and causes a build failure with CONFIG_TI_SCI_

Re: [PATCH] rcu/srcutiny: don't return before reenabling preemption

2024-10-09 Thread Paul E. McKenney
On Mon, Oct 07, 2024 at 12:14:15PM +0200, Michal Schmidt wrote: > Code after the return statement is dead. Enable preemption before > returning from srcu_drive_gp(). > > This will be important when/if PREEMPT_AUTO (lazy resched) gets merged. > > Fixes: 65b4a59557f6 ("srcu: Make Tiny SRCU explicit

Re: [PATCH 1/1] selftests/rseq: Fix mm_cid test failure

2024-10-09 Thread Shuah Khan
On 10/8/24 19:28, Mathieu Desnoyers wrote: Adapt the rseq.c/rseq.h code to follow GNU C library changes introduced by: glibc commit 2e456ccf0c34 ("Linux: Make __rseq_size useful for feature detection (bug 31965)") Without this fix, rseq selftests for mm_cid fail: ./run_param_test.sh Default p

Re: [PATCH 3/3] rcu: Report callbacks enqueued on offline CPU blind spot

2024-10-09 Thread Paul E. McKenney
On Tue, Oct 08, 2024 at 07:03:50PM -0700, Paul E. McKenney wrote: > On Wed, Oct 02, 2024 at 05:00:03PM +0200, Frederic Weisbecker wrote: > > Le Wed, Oct 02, 2024 at 04:57:38PM +0200, Frederic Weisbecker a écrit : > > > Callbacks enqueued after rcutree_report_cpu_dead() fall into RCU barrier > > > b

Re: [PATCH 2/3] rcu/nocb: Fix rcuog wake-up from offline softirq

2024-10-09 Thread Joel Fernandes
Hi Frederic, On Wed, Oct 2, 2024 at 10:57 AM Frederic Weisbecker wrote: > > After a CPU has set itself offline and before it eventually calls > rcutree_report_cpu_dead(), there are still opportunities for callbacks > to be enqueued, for example from an IRQ. When that happens on NOCB, the > rcuog

[PATCH RFC v3 01/10] uaccess: add copy_struct_to_user helper

2024-10-09 Thread Aleksa Sarai
This is based on copy_struct_from_user(), but there is one additional case to consider when creating a syscall that returns an extensible-struct to userspace -- how should data in the struct that cannot fit into the userspace struct be handled (ksize > usize)? There are three possibilies: 1. The

[PATCH RFC v3 00/10] extensible syscalls: CHECK_FIELDS to allow for easier feature detection

2024-10-09 Thread Aleksa Sarai
This is something that I've been thinking about for a while. We had a discussion at LPC 2020 about this[1] but the proposals suggested there never materialised. In short, it is quite difficult for userspace to detect the feature capability of syscalls at runtime. This is something a lot of program

[PATCH RFC v3 03/10] openat2: explicitly return -E2BIG for (usize > PAGE_SIZE)

2024-10-09 Thread Aleksa Sarai
While we do currently return -EFAULT in this case, it seems prudent to follow the behaviour of other syscalls like clone3. It seems quite unlikely that anyone depends on this error code being EFAULT, but we can always revert this if it turns out to be an issue. Cc: # v5.6+ Fixes: fddb5d430ad9 ("o

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

2024-10-09 Thread 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. Signed-off-by: Aleksa Sarai --- kernel/sched/syscalls.c | 42 ++ 1 file changed, 2 insertions(+),

[PATCH RFC v3 04/10] openat2: add CHECK_FIELDS flag to usize argument

2024-10-09 Thread Aleksa Sarai
In order for userspace to be able to know what flags and fields the kernel supports, it is currently necessary for them to do a bunch of fairly subtle self-checks where you need to get a syscall to return a non-EINVAL error or no-op for each flag you wish to use. If you get -EINVAL you know the fla

Re: [PATCH v3] selftests: sched_ext: Add sched_ext as proper selftest target

2024-10-09 Thread Mark Brown
On Tue, Oct 08, 2024 at 05:35:18PM +0200, Björn Töpel wrote: > The sched_ext selftests is missing proper cross-compilation support, a > proper target entry, and out-of-tree build support. Tested-by: Mark Brown Reviewed-by: Mark Brown There's still the thing with picking up the host kernel if t

[PATCH v3] virtio: Make vring_new_virtqueue support for packed vring

2024-10-09 Thread huangwenyu1998
From: Wenyu Huang It used for testing in tools/virtio/vringh_test.c. If vring_new_virtqueue supports packed vring, we can add support for packed vring to vringh and test it. Signed-off-by: Wenyu Huang --- Changes in v2: Make the commit title and description more clearer. Changes in v3: Remove t

Re: (subset) [RFC PATCH 1/2] mfd: 88pm886: add the RTC cell and relevant definitions

2024-10-09 Thread Lee Jones
On Fri, 20 Sep 2024 18:12:34 +0200, Karel Balej wrote: > RTC lives on the base register page of the chip. Add definitions of the > registers needed for a basic set/read time functionality. > > Applied, thanks! [1/2] mfd: 88pm886: add the RTC cell and relevant definitions commit: 0a936c2c4

[PATCH bpf-next v3 0/3] selftests/bpf: add coverage for xdp_features in test_progs

2024-10-09 Thread eBPF Foundation
Hello, this small series aims to increase coverage of xdp features in test_progs. The initial versions proposed to rework test_xdp_features.sh to make it fit in test_progs, but some discussions in v1 and v2 showed that the script is still needed as a standalone tool. So this new revision lets test_

[PATCH bpf-next v3 2/3] selftests/bpf: make xdp_cpumap_attach keep redirect prog attached

2024-10-09 Thread eBPF Foundation
Current test only checks attach/detach on cpu map type program, and so does not check that it can be properly executed, neither that it redirects correctly. Update the existing test to extend its coverage: - keep the redirected program loaded - try to execute it through bpf_prog_test_run_opts with

[PATCH bpf-next v3 3/3] selftests/bpf: check program redirect in xdp_cpumap_attach

2024-10-09 Thread eBPF Foundation
xdp_cpumap_attach, in its current form, only checks that an xdp cpumap program can be executed, but not that it performs correctly the cpu redirect as configured by userspace (bpf_prog_test_run_opts will return success even if the redirect program returns an error) Add a check to ensure that the p

[PATCH bpf-next v3 1/3] selftests/bpf: fix bpf_map_redirect call for cpu map test

2024-10-09 Thread eBPF Foundation
xdp_redir_prog currently redirects packets based on the entry at index 1 in cpu_map, but the corresponding test only manipulates the entry at index 0. This does not really affect the test in its current form since the program is detached before having the opportunity to execute, but it needs to be

Re: [PATCH 1/6] dt-bindings: remoteproc: qcom,pas-common: Introduce iommus and qcom,devmem property

2024-10-09 Thread Shiraz Hashim
On Mon, Oct 07, 2024 at 06:25:01PM +0200, Dmitry Baryshkov wrote: > On Mon, 7 Oct 2024 at 17:35, Mukesh Ojha wrote: > > > > On Sun, Oct 06, 2024 at 10:38:01PM +0300, Dmitry Baryshkov wrote: > > > On Sat, Oct 05, 2024 at 02:53:54AM GMT, Mukesh Ojha wrote: > > > > From: Shiraz Hashim > > > > > > >

Re: [PATCH v2 1/7] vhost: Add a new modparam to allow userspace select vhost_task

2024-10-09 Thread Jason Wang
On Wed, Oct 9, 2024 at 4:10 PM Stefano Garzarella wrote: > > On Wed, Oct 09, 2024 at 03:28:19PM GMT, Jason Wang wrote: > >On Mon, Oct 7, 2024 at 9:31 PM Stefano Garzarella > >wrote: > >> > >> On Fri, Oct 04, 2024 at 09:58:15AM GMT, Cindy Lu wrote: > >> >The vhost is now using vhost_task and work

Re: [PATCH v2 00/19] iommufd: Add VIOMMU infrastructure (Part-1)

2024-10-09 Thread Yi Liu
On 2024/10/1 05:59, Nicolin Chen wrote: On Sun, Sep 29, 2024 at 03:16:55PM +0800, Yi Liu wrote: I feel these two might act somehow similarly to the two DIDs during nested translations? not quite the same. Is it possible that the ASID is the same for stage-1? Intel VT-d side can have the pasid

Re: [PATCH v2 1/7] vhost: Add a new modparam to allow userspace select vhost_task

2024-10-09 Thread Stefano Garzarella
On Wed, Oct 09, 2024 at 03:28:19PM GMT, Jason Wang wrote: On Mon, Oct 7, 2024 at 9:31 PM Stefano Garzarella wrote: On Fri, Oct 04, 2024 at 09:58:15AM GMT, Cindy Lu wrote: >The vhost is now using vhost_task and working as a child of the owner thread. >While this makes sense from containerizatio

[PATCH v8 8/8] selftests/pcie_bwctrl: Create selftests

2024-10-09 Thread Ilpo Järvinen
Create selftests for PCIe BW control through the PCIe cooling device sysfs interface. First, the BW control selftest finds the PCIe Port to test with. By default, the PCIe Port with the highest Link Speed is selected but another PCIe Port can be provided with -d parameter. The actual test steps t

[PATCH v2 00/10] Make RCU Tasks scan idle tasks

2024-10-09 Thread neeraj . upadhyay
From: Neeraj Upadhyay Architectures for which all deep-idle and entry-exit functions are marked noinstr, synchronize_rcu_tasks_rude() is not required. However, disabling synchronize_rcu_tasks_rude() for such architectures require RCU-tasks to pay attention to idle tasks until they enter the conte

  1   2   >