Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-21 Thread Christoph Hellwig
On Mon, Oct 21, 2024 at 03:13:05PM -0700, Paul E. McKenney wrote: > For almost 20 years, the int return value from srcu_read_lock() has > been always either zero or one. This commit therefore documents the > fact that it will be non-negative. If it is always zero or one, wouldn't bool the better

Re: [PATCH v4 1/2] virt: pvmemcontrol: control guest physical memory properties

2024-10-21 Thread Greg Kroah-Hartman
On Mon, Oct 21, 2024 at 01:48:48PM -0700, Yuanchu Xie wrote: > +static DEFINE_RWLOCK(pvmemcontrol_lock); What does this lock control? > +static struct pvmemcontrol *pvmemcontrol __read_mostly; Having a single static device should not be needed, please tie this properly to the pci device that the

Re: [PATCH v4 02/14] iommufd/viommu: Add IOMMU_VDEVICE_ALLOC ioctl

2024-10-21 Thread Nicolin Chen
On Tue, Oct 22, 2024 at 11:40:11AM +0800, Baolu Lu wrote: > On 2024/10/22 8:20, Nicolin Chen wrote: > > 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, > > nit: > > :s/iommufd_iommufd/iommufd

Re: [PATCH v4 02/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-21 Thread Nicolin Chen
On Tue, Oct 22, 2024 at 10:28:30AM +0800, Baolu Lu wrote: > On 2024/10/22 8:19, Nicolin Chen wrote: > > + * @viommu_alloc: Allocate an iommufd_viommu on a physical IOMMU instance > > behind > > + *the @dev, as the set of virtualization resources > > shared/passed > > + *

[PATCH] remoteproc: qcom: pas: Make remoteproc name human friendly

2024-10-21 Thread Bjorn Andersson
The remoteproc "name" property is supposed to present the "human readable" name of the remoteproc, while using the device name is readable, it's not "friendly". Instead, use the "sysmon_name" as the identifier for the remoteproc instance. It matches the typical names used when we speak about each

[PATCH 1/2] rpmsg: glink: Handle rejected intent request better

2024-10-21 Thread Bjorn Andersson
The initial implementation of request intent response handling dealt with two outcomes; granted allocations, and all other cases being considered -ECANCELLED (likely from "cancelling the operation as the remote is going down"). But on some channels intent allocation is not supported, instead the r

[PATCH 2/2] soc: qcom: pmic_glink: Handle GLINK intent allocation rejections

2024-10-21 Thread Bjorn Andersson
Some versions of the pmic_glink firmware does not allow dynamic GLINK intent allocations, attempting to send a message before the firmware has allocated its receive buffers and announced these intent allocations will fail. When this happens something like this showns up in the log: [9.

[PATCH 0/2] soc: qcom: pmic_glink: Resolve failures to bring up pmic_glink

2024-10-21 Thread Bjorn Andersson
With the transition of pd-mapper into the kernel, the timing was altered such that on some targets the initial rpmsg_send() requests from pmic_glink clients would be attempted before the firmware had announced intents, and the firmware reject intent requests. Fix this Signed-off-by: Bjorn Anderss

[PATCH v2] rcu/nocb: Fix the WARN_ON_ONCE() in rcu_nocb_rdp_deoffload()

2024-10-21 Thread Zqiang
Currently, running rcutorture test with torture_type=rcu fwd_progress=8 n_barrier_cbs=8 nocbs_nthreads=8 nocbs_toggle=100 onoff_interval=60 test_boost=2, will trigger the following warning: WARNING: CPU: 19 PID: 100 at kernel/rcu/tree_nocb.h:1061 rcu_nocb_rdp_deoffload+0x292/0x2a0 RIP: 0010:rcu_n

Re: [PATCH v4 02/14] iommufd/viommu: Add IOMMU_VDEVICE_ALLOC ioctl

2024-10-21 Thread Baolu Lu
On 2024/10/22 8:20, Nicolin Chen wrote: 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, nit: :s/iommufd_iommufd/iommufd_device/g or not? require both as the ioctl inputs and take refcounts

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-21 Thread Andrii Nakryiko
On Mon, Oct 21, 2024 at 8:30 PM Paul E. McKenney wrote: > > On Mon, Oct 21, 2024 at 07:01:02PM -0700, Andrii Nakryiko wrote: > > On Mon, Oct 21, 2024 at 5:21 PM Paul E. McKenney wrote: > > > > > > On Mon, Oct 21, 2024 at 04:50:44PM -0700, Andrii Nakryiko wrote: > > > > On Mon, Oct 21, 2024 at 3:1

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-21 Thread Paul E. McKenney
On Mon, Oct 21, 2024 at 07:01:02PM -0700, Andrii Nakryiko wrote: > On Mon, Oct 21, 2024 at 5:21 PM Paul E. McKenney wrote: > > > > On Mon, Oct 21, 2024 at 04:50:44PM -0700, Andrii Nakryiko wrote: > > > On Mon, Oct 21, 2024 at 3:13 PM Paul E. McKenney > > > wrote: > > > > > > > > For almost 20 ye

Re: [PATCH v4 02/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-21 Thread Baolu Lu
On 2024/10/22 8:19, Nicolin Chen wrote: + * @viommu_alloc: Allocate an iommufd_viommu on a physical IOMMU instance behind + *the @dev, as the set of virtualization resources shared/passed + *to user space IOMMU instance. And associate it with a nesting + *

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-21 Thread Andrii Nakryiko
On Mon, Oct 21, 2024 at 5:21 PM Paul E. McKenney wrote: > > On Mon, Oct 21, 2024 at 04:50:44PM -0700, Andrii Nakryiko wrote: > > On Mon, Oct 21, 2024 at 3:13 PM Paul E. McKenney wrote: > > > > > > For almost 20 years, the int return value from srcu_read_lock() has > > > been always either zero or

[PATCH v4 02/14] iommufd/viommu: Add IOMMU_VDEVICE_ALLOC ioctl

2024-10-21 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 v4 06/14] iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

2024-10-21 Thread Nicolin Chen
With a vIOMMU object, use space can flush any IOMMU related cache that can be directed via a vIOMMU object. It is similar to the 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_

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-21 Thread Paul E. McKenney
On Mon, Oct 21, 2024 at 04:50:44PM -0700, Andrii Nakryiko wrote: > On Mon, Oct 21, 2024 at 3:13 PM Paul E. McKenney wrote: > > > > For almost 20 years, the int return value from srcu_read_lock() has > > been always either zero or one. This commit therefore documents the > > fact that it will be n

[PATCH v4 11/14] iommufd/selftest: Add vIOMMU coverage for IOMMU_HWPT_INVALIDATE ioctl

2024-10-21 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 v4 14/14] iommu/arm-smmu-v3: Allow ATS for IOMMU_DOMAIN_NESTED

2024-10-21 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

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

2024-10-21 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 v4 10/14] iommufd/selftest: Add IOMMU_TEST_OP_DEV_CHECK_CACHE test command

2024-10-21 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 v4 12/14] Documentation: userspace-api: iommufd: Update vDEVICE

2024-10-21 Thread Nicolin Chen
With the introduction of the new object and its infrastructure, update the doc and the vIOMMU graph to reflect that. Reviewed-by: Jason Gunthorpe Signed-off-by: Nicolin Chen --- Documentation/userspace-api/iommufd.rst | 41 +++-- 1 file changed, 32 insertions(+), 9 deletions

[PATCH v4 09/14] iommufd/selftest: Add mock_viommu_cache_invalidate

2024-10-21 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 | 76 ++

[PATCH v4 08/14] iommufd/viommu: Add vdev_to_dev helper

2024-10-21 Thread Nicolin Chen
This avoids a bigger trouble of moving the struct iommufd_device to the public header. Reviewed-by: Jason Gunthorpe Signed-off-by: Nicolin Chen --- include/linux/iommufd.h| 6 ++ drivers/iommu/iommufd/driver.c | 7 +++ 2 files changed, 13 insertions(+) diff --git a/include/linu

[PATCH v4 07/14] iommu: Add iommu_copy_struct_from_full_user_array helper

2024-10-21 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 v4 05/14] iommufd/hw_pagetable: Enforce cache invalidation op on vIOMMU-based hwpt_nested

2024-10-21 Thread Nicolin Chen
A vIOMMU-based hwpt_nested requires a cache invalidation op too, either using the one in iommu_domain_ops or the one in viommu_ops. Enforce that upon the allocated hwpt_nested. Signed-off-by: Nicolin Chen --- drivers/iommu/iommufd/hw_pagetable.c | 4 +++- 1 file changed, 3 insertions(+), 1 delet

[PATCH v4 04/14] iommu/viommu: Add cache_invalidate to iommufd_viommu_ops

2024-10-21 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 v4 03/14] iommufd/selftest: Add IOMMU_VDEVICE_ALLOC test coverage

2024-10-21 Thread Nicolin Chen
Add a vdevice_alloc op to the viommu mock_viommu_ops for the coverage of IOMMU_VIOMMU_TYPE_SELFTEST allocations. Then, add a vdevice_alloc TEST_F to cover the IOMMU_VDEVICE_ALLOC ioctl. Signed-off-by: Nicolin Chen --- tools/testing/selftests/iommu/iommufd_utils.h | 27 +++ driver

[PATCH v4 00/14] iommufd: Add vIOMMU infrastructure (Part-2: vDEVICE)

2024-10-21 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 v4 01/14] iommufd/viommu: Introduce IOMMUFD_OBJ_VDEVICE and its related struct

2024-10-21 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 v4 11/11] iommu/arm-smmu-v3: Add IOMMU_VIOMMU_TYPE_ARM_SMMUV3 support

2024-10-21 Thread Nicolin Chen
Add a new driver-type for ARM SMMUv3 to enum iommu_viommu_type. Implement an arm_vsmmu_alloc() with its viommu op arm_vsmmu_domain_alloc_nested(), to replace arm_smmu_domain_alloc_nesting(). As an initial step, copy the VMID from s2_parent. A later cleanup series is required to move the VMID alloca

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

2024-10-21 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. Postpone the exit routine using a completion, if refcount is unbala

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

2024-10-21 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 | 78 +++

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

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

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

2024-10-21 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 | 41 ++

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

2024-10-21 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, add an iommufd_hwpt_nested_alloc_for_viommu helper to allocate a nested HWPT for a vIOMMU obje

[PATCH v4 05/11] iommufd: Add domain_alloc_nested op to iommufd_viommu_ops

2024-10-21 Thread Nicolin Chen
Allow IOMMU driver to use a vIOMMU object that holds a nesting parent hwpt/domain to allocate a nested domain. Suggested-by: Jason Gunthorpe Signed-off-by: Nicolin Chen --- include/linux/iommufd.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/iommufd.h b/include/lin

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

2024-10-21 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. If an IOMMU driver supports a driver-managed vIOMMU object, it must define its own IOMMU_VIOMMU_TYPE_ in the uAPI header and implement a viommu_alloc op in its iommu_ops. Rev

[PATCH v4 02/11] iommufd: Introduce IOMMUFD_OBJ_VIOMMU and its related struct

2024-10-21 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 v4 03/11] iommufd: Add iommufd_verify_unfinalized_object

2024-10-21 Thread Nicolin Chen
To support driver-allocated vIOMMU objects, it's suggested to call the allocator helper in IOMMU dirvers. However, there is no guarantee that drivers will all use it and allocate objects properly. Add a helper for iommufd core to verify if an unfinalized object is at least reserved in the ictx. S

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

2024-10-21 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 v4 00/11] iommufd: Add vIOMMU infrastructure (Part-1)

2024-10-21 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

Re: [PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-21 Thread Andrii Nakryiko
On Mon, Oct 21, 2024 at 3:13 PM Paul E. McKenney wrote: > > For almost 20 years, the int return value from srcu_read_lock() has > been always either zero or one. This commit therefore documents the > fact that it will be non-negative. > > Signed-off-by: Paul E. McKenney > Cc: Peter Zijlstra > C

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

2024-10-21 Thread Nicolin Chen
On Mon, Oct 21, 2024 at 07:11:47PM +1100, Alexey Kardashevskiy wrote: > > + /* > > + * A real physical IOMMU instance would unlikely get unplugged, so the > > + * life cycle of this iommu_dev is guaranteed to stay alive, mostly. A > > + * pluggable IOMMU instance (if exists) is r

Re: [PATCH 1/1] softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.

2024-10-21 Thread Paul E. McKenney
On Fri, Oct 04, 2024 at 12:17:04PM +0200, Sebastian Andrzej Siewior wrote: > A timer/ hrtimer softirq is raised in-IRQ context. With threaded > interrupts enabled or on PREEMPT_RT this leads to waking the ksoftirqd > for the processing of the softirq. > Once the ksoftirqd is marked as pending (or i

Re: [PATCH] KVM: selftests: Fix build on on non-x86 architectures

2024-10-21 Thread Linus Torvalds
On Mon, 21 Oct 2024 at 15:16, Mark Brown wrote: > > Fix this by making the addition of this x86 specific command line flag > conditional on building for x86. Applied directly, just to have this silly thing done with. Thanks, Linus

[PATCH] KVM: selftests: Fix build on on non-x86 architectures

2024-10-21 Thread Mark Brown
Commit 9a400068a158 ("KVM: selftests: x86: Avoid using SSE/AVX instructions") unconditionally added -march=x86-64-v2 to the CFLAGS used to build the KVM selftests which does not work on non-x86 architectures: cc1: error: unknown value ‘x86-64-v2’ for ‘-march’ Fix this by making the addition of

[PATCH rcu] srcu: Guarantee non-negative return value from srcu_read_lock()

2024-10-21 Thread Paul E. McKenney
For almost 20 years, the int return value from srcu_read_lock() has been always either zero or one. This commit therefore documents the fact that it will be non-negative. Signed-off-by: Paul E. McKenney Cc: Peter Zijlstra Cc: Andrii Nakryiko

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

2024-10-21 Thread Aleksa Sarai
On 2024-10-21, Christian Brauner wrote: > On Thu, 10 Oct 2024 07:40:33 +1100, Aleksa Sarai wrote: > > 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 qu

Re: [PATCH v2] selftests/intel_pstate: fix operand expected

2024-10-21 Thread Alessandro Zanni
> On 10/21/24 09:04, Alessandro Zanni wrote: > >> On 24/10/14 06:05, Shuah Khan wrote: > >>> On 10/14/24 11:21, Alessandro Zanni wrote: > This fix solves theses errors, when calling kselftest with > targets "intel_pstate": > > ./run.sh: line 90: / 1000: syntax error: operand exp

Re: [PATCH v2] selftests/intel_pstate: fix operand expected

2024-10-21 Thread Shuah Khan
On 10/21/24 09:04, Alessandro Zanni wrote: On 24/10/14 06:05, Shuah Khan wrote: On 10/14/24 11:21, Alessandro Zanni wrote: This fix solves theses errors, when calling kselftest with targets "intel_pstate": ./run.sh: line 90: / 1000: syntax error: operand expected (error token is "/ 1000") ./

[PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs

2024-10-21 Thread Andrew Davis
While it should be safe to use normal memset() on these memories as they are mapped as Normal Non-Cached, using the memset_io() provides stronger guarantees on access alignment and fixes a sparse check warning. Switch to memset_io() here. Signed-off-by: Andrew Davis --- drivers/remoteproc/ti_k3_

[PATCH 3/3] remoteproc: k3-dsp: Force cast from iomem address space

2024-10-21 Thread Andrew Davis
These memory regions are mapped as Normal Non-Cached which on does not have the normal IO address space limitations and so this cast is safe. Add '__force' to explicitly specify that the cast is intentional to remove a sparse check warning. Signed-off-by: Andrew Davis --- drivers/remoteproc/ti_k

[PATCH v4 2/2] virt: pvmemcontrol: add Yuanchu and Pasha as maintainers

2024-10-21 Thread Yuanchu Xie
The pvmemcontrol driver lives under drivers/virt/pvmemcontrol. We specify maintainers for the driver. Signed-off-by: Yuanchu Xie --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7ad507f49324..c0afabab8b71 100644 --- a/MAINTAINERS +++ b/MA

[PATCH v4 1/2] virt: pvmemcontrol: control guest physical memory properties

2024-10-21 Thread Yuanchu Xie
Pvmemcontrol provides a way for the guest to control its physical memory properties and enables optimizations and security features. For example, the guest can provide information to the host where parts of a hugepage may be unbacked, or sensitive data may not be swapped out, etc. Pvmemcontrol all

[PATCH 2/3] remoteproc: k3-r5: Force cast from iomem address space

2024-10-21 Thread Andrew Davis
These memory regions are mapped as Normal Non-Cached which on does not have the normal IO address space limitations and so this cast is safe. Add '__force' to explicitly specify that the cast is intentional to remove a sparse check warning. Signed-off-by: Andrew Davis --- drivers/remoteproc/ti_k

Re: [PATCH] module: check symbol name offsets

2024-10-21 Thread Luis Chamberlain
On Mon, Oct 21, 2024 at 10:20:38PM +0200, Tobias Stoeckmann wrote: > Hi Luis, > > On Mon, Oct 21, 2024 at 12:55:34PM -0700, Luis Chamberlain wrote: > > And then you can make a series with 3 patches for this and your prior one, > > and you can just refer to the PoC in the fix. > > Thanks for the h

Re: [PATCH v3 7/9] KVM: selftests: Add interface to manually flag protected/encrypted ranges

2024-10-21 Thread Pratik R. Sampat
Hi Sean, On 10/14/2024 5:58 PM, Sean Christopherson wrote: > On Thu, Sep 05, 2024, Pratik R. Sampat wrote: >> From: Michael Roth >> >> For SEV and SNP, currently __vm_phy_pages_alloc() handles setting the >> region->protected_phy_pages bitmap to mark that the region needs to be >> encrypted/measu

Re: [PATCH bpf-next v2 0/6] selftests/bpf: integrate test_tcp_check_syncookie.sh into test_progs

2024-10-21 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf-next.git (net) by Martin KaFai Lau : On Sun, 20 Oct 2024 21:22:52 +0200 you wrote: > Hello, > this series aims to bring test_tcp_check_syncookie.sh scope into > test_progs to make sure that the corresponding tests are also run > automatically in CI. This

Re: [PATCH v3 0/9] SEV Kernel Selftests

2024-10-21 Thread Pratik R. Sampat
Hi Sean, On 10/14/2024 5:23 PM, Sean Christopherson wrote: > On Thu, Sep 05, 2024, Pratik R. Sampat wrote: >> This series primarily introduces SEV-SNP test for the kernel selftest >> framework. It tests boot, ioctl, pre fault, and fallocate in various >> combinations to exercise both positive and

Re: [PATCH v3 2/9] KVM: selftests: Add a basic SNP smoke test

2024-10-21 Thread Pratik R. Sampat
Hi Sean, Thank you for your comments. ... >> .../selftests/kvm/include/x86_64/processor.h | 1 + >> .../selftests/kvm/include/x86_64/sev.h| 54 +++- >> tools/testing/selftests/kvm/lib/kvm_util.c| 8 +- >> .../selftests/kvm/lib/x86_64/processor.c | 6 +- >> tools/test

Re: [PATCH v3 1/9] KVM: selftests: Decouple SEV ioctls from asserts

2024-10-21 Thread Pratik R. Sampat
Hi Sean, On 10/14/2024 5:18 PM, Sean Christopherson wrote: > On Thu, Sep 05, 2024, Pratik R. Sampat wrote: >> +static inline int __sev_launch_update_data(struct kvm_vm *vm, vm_paddr_t >> gpa, >> + uint64_t hva, uint64_t size) >> { >> struct kvm_sev_laun

Re: [Bug Report] Wrong value of __NR_userfaultfd in asm-generic/unistd.h

2024-10-21 Thread John Hubbard
On 10/21/24 2:33 AM, David Hildenbrand wrote: Am 21.10.24 um 08:48 schrieb Muhammad Usama Anjum: ... But now comes the tricky part: an architecture defines whether it wants to (a) Use the asm-generic unistd.h (b) Use a custom one E.g., $ cat include/uapi/linux/unistd.h /* SPDX-License-Identi

Re: [PATCH] module: check symbol name offsets

2024-10-21 Thread Tobias Stoeckmann
Hi Luis, On Mon, Oct 21, 2024 at 12:55:34PM -0700, Luis Chamberlain wrote: > And then you can make a series with 3 patches for this and your prior one, > and you can just refer to the PoC in the fix. Thanks for the hint to rebase on modules-next. There is no need for my patches, because the check

Re: [PATCH] selftests: tc-testing: Fixed typo error

2024-10-21 Thread Shuah Khan
On 10/19/24 05:52, Karan Sanghavi wrote: Corrected the multiple and different typo errors in json files It should say "Correct or Fix" - Same comment in short log "Fix" instead of "Fixed" Do refer to commit for the subsystems and file to get an idea on the convention. - "diffferent" is corr

Re: [PATCH v5 0/3] selftests: livepatch: test livepatching a kprobed function

2024-10-21 Thread Marcos Paulo de Souza
On Thu, 2024-10-17 at 22:01 +0200, Michael Vetter wrote: > Thanks for all the reviews. > > V5: > Replace /sys/kernel/livepatch also in other/already existing tests. > Improve commit message of 3rd patch. > > V4: > Use variable for /sys/kernel/debug. > Be consistent with "" around variables. > Fix

Re: [PATCH v2 0/3] modules: few of alignment fixes

2024-10-21 Thread Helge Deller
On 10/21/24 21:22, Luis Chamberlain wrote: On Fri, Feb 02, 2024 at 10:23:21AM -0800, Luis Chamberlain wrote: On Sat, Feb 03, 2024 at 12:20:38AM +0900, Masahiro Yamada wrote: On Fri, Feb 2, 2024 at 3:05 AM Luis Chamberlain wrote: On Wed, Jan 31, 2024 at 02:11:44PM -0800, Luis Chamberlain wrot

Re: [PATCH] module: check symbol name offsets

2024-10-21 Thread Luis Chamberlain
On Sat, Oct 19, 2024 at 04:15:32PM +0200, Tobias Stoeckmann wrote: > It must be verified that the symbol name offsets point into the > string table, not outside of it. > > Signed-off-by: Tobias Stoeckmann > --- > Proof of Concept: > > 1. Create "poc.sh" > > ``` > cat > poc.sh << EOF > #!/bin/sh

Re: [PATCH] module: .strtab must be null terminated

2024-10-21 Thread Luis Chamberlain
On Sat, Oct 19, 2024 at 04:14:40PM +0200, Tobias Stoeckmann wrote: > The string table must be NUL-terminated, just like the section name table. > > Signed-off-by: Tobias Stoeckmann > --- > In order to create a proof of concept, which I can't get into a simple > script right now, it's easiest to m

Re: [PATCH v2 0/3] modules: few of alignment fixes

2024-10-21 Thread Luis Chamberlain
On Fri, Feb 02, 2024 at 10:23:21AM -0800, Luis Chamberlain wrote: > On Sat, Feb 03, 2024 at 12:20:38AM +0900, Masahiro Yamada wrote: > > On Fri, Feb 2, 2024 at 3:05 AM Luis Chamberlain wrote: > > > > > > On Wed, Jan 31, 2024 at 02:11:44PM -0800, Luis Chamberlain wrote: > > > > On Mon, Jan 29, 2024

Re: [PATCH v5 14/16] modules: Support extended MODVERSIONS info

2024-10-21 Thread Luis Chamberlain
On Sat, Oct 19, 2024 at 01:45:35PM -0700, Luis Chamberlain wrote: > On Thu, Oct 17, 2024 at 02:08:19PM +0200, Helge Deller wrote: > > Hi Luis, > > > > On 10/17/24 01:21, Luis Chamberlain wrote: > > > That sounds great. Yeah, the above would be great to test. A while ago > > > I wrote a new modules

[PATCH v3] selftests: add new kallsyms selftests

2024-10-21 Thread Luis Chamberlain
We lack find_symbol() selftests, so add one. This let's us stress test improvements easily on find_symbol() or optimizations. It also inherently allows us to test the limits of kallsyms on Linux today. We test a pathalogical use case for kallsyms by introducing modules which are automatically writ

Re: [PATCH v5 0/3] selftests: livepatch: test livepatching a kprobed function

2024-10-21 Thread Joe Lawrence
On 10/17/24 16:01, Michael Vetter wrote: > Thanks for all the reviews. > > V5: > Replace /sys/kernel/livepatch also in other/already existing tests. > Improve commit message of 3rd patch. > > V4: > Use variable for /sys/kernel/debug. > Be consistent with "" around variables. > Fix path in commit

Re: [PATCH v5 1/3] selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR

2024-10-21 Thread Joe Lawrence
On 10/17/24 16:01, Michael Vetter wrote: > @@ -246,12 +246,12 @@ function unload_lp() { > function disable_lp() { > local mod="$1" > > - log "% echo 0 > /sys/kernel/livepatch/$mod/enabled" > - echo 0 > /sys/kernel/livepatch/"$mod"/enabled > + log "% echo 0 > $SYSFS_KLP_DIR/$mod

Re: [PATCH v6 2/5] modules: Support extended MODVERSIONS info

2024-10-21 Thread Luis Chamberlain
On Tue, Oct 15, 2024 at 11:18:57PM +, Matthew Maurer wrote: > Adds a new format for MODVERSIONS which stores each field in a separate > ELF section. This initially adds support for variable length names, but > could later be used to add additional fields to MODVERSIONS in a > backwards compatib

Re: [PATCH v6 4/5] modpost: Produce extended MODVERSIONS information

2024-10-21 Thread Luis Chamberlain
On Tue, Oct 15, 2024 at 11:18:59PM +, Matthew Maurer wrote: > Generate both the existing modversions format and the new extended one > when running modpost. Presence of this metadata in the final .ko is > guarded by CONFIG_EXTENDED_MODVERSIONS. > > We no longer generate an error on long symbol

Re: [PATCH v6 4/5] modpost: Produce extended MODVERSIONS information

2024-10-21 Thread Luis Chamberlain
On Tue, Oct 15, 2024 at 11:18:59PM +, Matthew Maurer wrote: > Generate both the existing modversions format and the new extended one > when running modpost. Presence of this metadata in the final .ko is > guarded by CONFIG_EXTENDED_MODVERSIONS. > > We no longer generate an error on long symbol

Re: [PATCH v6 1/5] export_report: Rehabilitate script

2024-10-21 Thread Luis Chamberlain
On Wed, Oct 16, 2024 at 05:29:21PM -0700, Sami Tolvanen wrote: > Hi, > > On Tue, Oct 15, 2024 at 4:19 PM Matthew Maurer wrote: > > > > The `export_report.pl` script was broken [1] a while back due to a code > > cleanup causing the regex to no longer match. Additionally, it assumes a > > `modules.

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

2024-10-21 Thread Nicolin Chen
On Mon, Oct 21, 2024 at 07:30:57PM +1100, Alexey Kardashevskiy wrote: > On 10/10/24 03:38, Nicolin Chen wrote: > > 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 > > -

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

2024-10-21 Thread Nicolin Chen
On Mon, Oct 21, 2024 at 12:26:54PM +1100, Alexey Kardashevskiy wrote: > On 18/10/24 02:37, Jason Gunthorpe wrote: > > On Thu, Oct 17, 2024 at 11:14:16AM -0300, Jason Gunthorpe wrote: > > > On Wed, Oct 09, 2024 at 09:38:02AM -0700, Nicolin Chen wrote: > > > > > > > @@ -217,12 +217,12 @@ iommufd_obj

[PATCH net-next v3] selftest/tcp-ao: Add filter tests

2024-10-21 Thread Leo Stone
Add tests that check if getsockopt(TCP_AO_GET_KEYS) returns the right keys when using different filters. Sample output: > # ok 114 filter keys: by sndid, rcvid, address > # ok 115 filter keys: by is_current > # ok 116 filter keys: by is_rnext > # ok 117 filter keys: by sndid, rcvid > # ok 118 fil

Re: [PATCH 2/2] remoteproc: k3-r5: Add compile testing support

2024-10-21 Thread Andrew Davis
On 10/16/24 11:41 AM, Andrew Davis wrote: This driver can be compile tested on non-K3 architectures as long as TI_SCI_PROTOCOL is not compiled as a module. Enable this here to improve this driver's build coverage. Signed-off-by: Andrew Davis --- drivers/remoteproc/Kconfig | 3 ++- 1 file cha

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

2024-10-21 Thread Nicolin Chen
On Mon, Oct 21, 2024 at 09:21:48AM -0300, Jason Gunthorpe wrote: > On Sat, Oct 19, 2024 at 06:35:45PM -0700, Nicolin Chen wrote: > > On Thu, Oct 17, 2024 at 03:45:56PM -0300, Jason Gunthorpe wrote: > > > > +struct iommufd_vdevice * > > > > +__iommufd_vdevice_alloc(struct iommufd_ctx *ictx, size_t s

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

2024-10-21 Thread Nicolin Chen
On Mon, Oct 21, 2024 at 09:22:48AM -0300, Jason Gunthorpe wrote: > On Sat, Oct 19, 2024 at 06:42:30PM -0700, Nicolin Chen wrote: > > > But be mindful of this abort, it doesn't want to be inside the lock if > > > it also gets the lock.. fail_nth should be updated to cover these new > > > ioctls to l

Re: [syzbot] [bpf?] KCSAN: data-race in __mod_timer / kvfree_call_rcu

2024-10-21 Thread Uladzislau Rezki
> On Mon, Oct 14, 2024 at 7:00 PM Paul E. McKenney wrote: > > > > On Mon, Oct 14, 2024 at 10:27:05AM +0200, Dmitry Vyukov wrote: > > > On Mon, 14 Oct 2024 at 08:07, syzbot > > > wrote: > > > > > > > > Hello, > > > > > > > > syzbot found the following issue on: > > > > > > > > HEAD commit:5b7c

Re: [PATCH v11 4/7] remoteproc: Introduce release_fw optional operation

2024-10-21 Thread Mathieu Poirier
On Wed, Oct 09, 2024 at 10:01:05AM +0200, Arnaud Pouliquen wrote: > This patch updates the rproc_ops struct to include an optional > release_fw function. > > The release_fw ops is responsible for releasing the remote processor > firmware image. The ops is called in the following cases: > > - An

Re: [PATCH v11 2/7] remoteproc: Add TEE support

2024-10-21 Thread Mathieu Poirier
On Wed, Oct 09, 2024 at 10:01:03AM +0200, Arnaud Pouliquen wrote: > Add a remoteproc TEE (Trusted Execution Environment) driver > that will be probed by the TEE bus. If the associated Trusted > application is supported on secure part this driver offers a client > interface to load a firmware by the

Re: [PATCH v3] remoteproc: Add a new remoteproc state RPROC_DEFUNCT

2024-10-21 Thread Mathieu Poirier
Hi Mukesh, On Wed, Oct 16, 2024 at 10:25:46AM +0530, Mukesh Ojha wrote: > Multiple call to glink_subdev_stop() for the same remoteproc can happen > if rproc_stop() fails from Process-A that leaves the rproc state to > RPROC_CRASHED state later a call to recovery_store from user space in > Process

Re: [PATCH v2] selftests/intel_pstate: fix operand expected

2024-10-21 Thread Alessandro Zanni
> On 24/10/14 06:05, Shuah Khan wrote: > > On 10/14/24 11:21, Alessandro Zanni wrote: > > > This fix solves theses errors, when calling kselftest with > > > targets "intel_pstate": > > > > > > ./run.sh: line 90: / 1000: syntax error: operand expected (error token is > > > "/ 1000") > > > > > > ./r

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

2024-10-21 Thread Christian Brauner
On Thu, 10 Oct 2024 07:40:33 +1100, Aleksa Sarai wrote: > 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 > c

[PATCH vhost 0/2] vdpa/mlx5: Iova mapping related fixes

2024-10-21 Thread Dragos Tatulea
Here are 2 fixes from Si-Wei: - The first one is an important fix that has to be applied as far back as possible (hence CC'ing linux-stable). - The second is more of an improvement. That's why it doesn't have the Fixes tag. I'd like to thank Si-Wei for the effort of finding and fixing these is

[PATCH vhost 2/2] vdpa/mlx5: Fix suboptimal range on iotlb iteration

2024-10-21 Thread Dragos Tatulea
From: Si-Wei Liu The starting iova address to iterate iotlb map entry within a range was set to an irrelevant value when passing to the itree_next() iterator, although luckily it doesn't affect the outcome of finding out the granule of the smallest iotlb map size. Fix the code to make it consiste

[PATCH vhost 1/2] vdpa/mlx5: Fix PA offset with unaligned starting iotlb map

2024-10-21 Thread Dragos Tatulea
From: Si-Wei Liu When calculating the physical address range based on the iotlb and mr [start,end) ranges, the offset of mr->start relative to map->start is not taken into account. This leads to some incorrect and duplicate mappings. For the case when mr->start < map->start the code is already c

Re: [PATCH] rcu/nocb: Fix the WARN_ON_ONCE() in rcu_nocb_rdp_deoffload()

2024-10-21 Thread Z qiang
> > Le Mon, Oct 21, 2024 at 07:01:02PM +0800, Z qiang a écrit : > > > For the non-nocb cpus set during boot, the corresponding > > > rcuop kthread, we should park directly, otherwise > > > WARN_ON_ONCE(!rcu_rdp_is_offloaded(rdp)) will be triggered. > > Ah but this case is different. kthread_park()

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

2024-10-21 Thread Jason Gunthorpe
On Sat, Oct 19, 2024 at 06:42:30PM -0700, Nicolin Chen wrote: > > But be mindful of this abort, it doesn't want to be inside the lock if > > it also gets the lock.. fail_nth should be updated to cover these new > > ioctls to look for tricky things like that > > I added an abort() beside destroy():

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

2024-10-21 Thread Jason Gunthorpe
On Sat, Oct 19, 2024 at 06:35:45PM -0700, Nicolin Chen wrote: > On Thu, Oct 17, 2024 at 03:45:56PM -0300, Jason Gunthorpe wrote: > > > +struct iommufd_vdevice * > > > +__iommufd_vdevice_alloc(struct iommufd_ctx *ictx, size_t size) > > > +{ > > > + struct iommufd_object *obj; > > > + > > > + if (WAR

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

2024-10-21 Thread Jason Gunthorpe
On Mon, Oct 21, 2024 at 07:11:47PM +1100, Alexey Kardashevskiy wrote: > > + hwpt_paging = iommufd_get_hwpt_paging(ucmd, cmd->hwpt_id); > > + if (IS_ERR(hwpt_paging)) { > > + rc = PTR_ERR(hwpt_paging); > > > iommufd_get_hwpt_paging() is container_of() which does not test for the > va

Re: [PATCH] rcu/nocb: Fix the WARN_ON_ONCE() in rcu_nocb_rdp_deoffload()

2024-10-21 Thread Frederic Weisbecker
Le Mon, Oct 21, 2024 at 07:01:02PM +0800, Z qiang a écrit : > > For the non-nocb cpus set during boot, the corresponding > > rcuop kthread, we should park directly, otherwise > > WARN_ON_ONCE(!rcu_rdp_is_offloaded(rdp)) will be triggered. Ah but this case is different. kthread_park() is called on

Re: [PATCH] selftests: kvm: Adds a judgment on the return value

2024-10-21 Thread David Hildenbrand
Am 21.10.24 um 12:06 schrieb Liu Jing: The global variable errno is not recommended to be assigned, Just curious: from where is that information? Reading the man page: "errno is defined by the ISO C standard to be a modifiable lvalue of type int, and must not be explicitly declared; errno

Re: [PATCH] virtio_net: fix integer overflow in stats

2024-10-21 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Paolo Abeni : On Wed, 16 Oct 2024 13:27:07 -0400 you wrote: > Static analysis on linux-next has detected the following issue > in function virtnet_stats_ctx_init, in drivers/net/virtio_net.c : > > if (vi->device_stats_cap & VIRTIO

  1   2   >