Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Nicolin Chen
On Wed, Apr 23, 2025 at 08:13:33PM -0300, Jason Gunthorpe wrote: > On Wed, Apr 23, 2025 at 11:31:29AM -0700, Nicolin Chen wrote: > > > > It also needs to act like a mdev and lock down the part of the IOAS > > > that provides that memory so the pin can't be released and UAF things. > > > > If I ca

Re: [PATCH v12 12/28] riscv: Implements arch agnostic shadow stack prctls

2025-04-23 Thread Deepak Gupta
On Thu, Apr 10, 2025 at 11:45:58AM +0200, Radim Krčmář wrote: 2025-03-14T14:39:31-07:00, Deepak Gupta : diff --git a/arch/riscv/include/asm/usercfi.h b/arch/riscv/include/asm/usercfi.h @@ -14,7 +15,8 @@ struct kernel_clone_args; struct cfi_status { unsigned long ubcfi_en : 1; /* Enable

[PATCH net-next v11 0/8] Device memory TCP TX

2025-04-23 Thread Mina Almasry
v11: https://lore.kernel.org/netdev/20250423031117.907681-1-almasrym...@google.com/ Addressed a couple of nits and collected Acked-by from Harshitha (thanks!) v10: https://lore.kernel.org/netdev/20250417231540.2780723-1-almasrym...@google.com/ Addressed comments following conversations with Pa

[PATCH net-next v11 5/8] net: add devmem TCP TX documentation

2025-04-23 Thread Mina Almasry
Add documentation outlining the usage and details of the devmem TCP TX API. Signed-off-by: Mina Almasry Acked-by: Stanislav Fomichev --- v5: - Address comments from Stan and Bagas v4: - Mention SO_BINDTODEVICE is recommended (me/Pavel). v2: - Update documentation for iov_base is the dmabuf o

[PATCH net-next v11 7/8] gve: add netmem TX support to GVE DQO-RDA mode

2025-04-23 Thread Mina Almasry
Use netmem_dma_*() helpers in gve_tx_dqo.c DQO-RDA paths to enable netmem TX support in that mode. Declare support for netmem TX in GVE DQO-RDA mode. Signed-off-by: Mina Almasry Acked-by: Harshitha Ramamurthy --- v11: - Fix whitespace (Harshitha) v10: - Move setting dev->netmem_tx to right a

[PATCH net-next v11 8/8] net: check for driver support in netmem TX

2025-04-23 Thread Mina Almasry
We should not enable netmem TX for drivers that don't declare support. Check for driver netmem TX support during devmem TX binding and fail if the driver does not have the functionality. Check for driver support in validate_xmit_skb as well. Signed-off-by: Mina Almasry Acked-by: Stanislav Fomic

[PATCH net-next v11 4/8] net: devmem: Implement TX path

2025-04-23 Thread Mina Almasry
Augment dmabuf binding to be able to handle TX. Additional to all the RX binding, we also create tx_vec needed for the TX path. Provide API for sendmsg to be able to send dmabufs bound to this device: - Provide a new dmabuf_tx_cmsg which includes the dmabuf to send from. - MSG_ZEROCOPY with SCM_D

[PATCH net-next v11 6/8] net: enable driver support for netmem TX

2025-04-23 Thread Mina Almasry
Drivers need to make sure not to pass netmem dma-addrs to the dma-mapping API in order to support netmem TX. Add helpers and netmem_dma_*() helpers that enables special handling of netmem dma-addrs that drivers can use. Document in netmem.rst what drivers need to do to support netmem TX. Signed-

[PATCH net-next v11 3/8] net: devmem: TCP tx netlink api

2025-04-23 Thread Mina Almasry
From: Stanislav Fomichev Add bind-tx netlink call to attach dmabuf for TX; queue is not required, only ifindex and dmabuf fd for attachment. Signed-off-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v3: - Fix ynl-regen.sh error (Simon). --- Documentation/netlink/specs/netdev.yaml |

[PATCH net-next v11 2/8] net: add get_netmem/put_netmem support

2025-04-23 Thread Mina Almasry
Currently net_iovs support only pp ref counts, and do not support a page ref equivalent. This is fine for the RX path as net_iovs are used exclusively with the pp and only pp refcounting is needed there. The TX path however does not use pp ref counts, thus, support for get_page/put_page equivalent

[PATCH net-next v11 1/8] netmem: add niov->type attribute to distinguish different net_iov types

2025-04-23 Thread Mina Almasry
Later patches in the series adds TX net_iovs where there is no pp associated, so we can't rely on niov->pp->mp_ops to tell what is the type of the net_iov. Add a type enum to the net_iov which tells us the net_iov type. Signed-off-by: Mina Almasry --- v8: - Since io_uring zcrx is now in net-ne

Re: [PATCH v12 10/28] riscv/mm: Implement map_shadow_stack() syscall

2025-04-23 Thread Deepak Gupta
On Thu, Apr 10, 2025 at 11:56:44AM +0200, Radim Krčmář wrote: 2025-03-14T14:39:29-07:00, Deepak Gupta : As discussed extensively in the changelog for the addition of this syscall on x86 ("x86/shstk: Introduce map_shadow_stack syscall") the existing mmap() and madvise() syscalls do not map entire

Re: [PATCH v12 06/28] riscv/mm : ensure PROT_WRITE leads to VM_READ | VM_WRITE

2025-04-23 Thread Deepak Gupta
On Thu, Apr 10, 2025 at 12:03:44PM +0200, Radim Krčmář wrote: 2025-03-14T14:39:25-07:00, Deepak Gupta : diff --git a/arch/riscv/include/asm/mman.h b/arch/riscv/include/asm/mman.h +static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot, +

Re: [PATCH v12 05/28] riscv: usercfi state for task and save/restore of CSR_SSP on trap entry/exit

2025-04-23 Thread Deepak Gupta
Sorry forgot to respond to rest of your comments on this thread. On Thu, Apr 10, 2025 at 01:04:39PM +0200, Radim Krčmář wrote: 2025-03-14T14:39:24-07:00, Deepak Gupta : diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h @@ -62,6 +62,9 @@ struct thread_inf

Re: [PATCH v12 05/28] riscv: usercfi state for task and save/restore of CSR_SSP on trap entry/exit

2025-04-23 Thread Deepak Gupta
On Thu, Apr 10, 2025 at 01:04:39PM +0200, Radim Krčmář wrote: 2025-03-14T14:39:24-07:00, Deepak Gupta : diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h @@ -62,6 +62,9 @@ struct thread_info { longuser_sp;/* User stack p

Re: [PATCH net-next v10 4/9] net: devmem: Implement TX path

2025-04-23 Thread Mina Almasry
On Wed, Apr 23, 2025 at 11:24 AM Michael S. Tsirkin wrote: > > some nits > > On Wed, Apr 23, 2025 at 03:11:11AM +, Mina Almasry wrote: > > @@ -189,43 +200,44 @@ net_devmem_bind_dmabuf(struct net_device *dev, > > unsigned int dmabuf_fd, > > } > > > > binding->dev = dev; > > - > > -

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Jason Gunthorpe
On Wed, Apr 23, 2025 at 11:31:29AM -0700, Nicolin Chen wrote: > > It also needs to act like a mdev and lock down the part of the IOAS > > that provides that memory so the pin can't be released and UAF things. > > If I capture this correctly, the GPA->PA mapping is already done > at the IOAS level

Re: [RFC PATCH 10/19] famfs_fuse: Basic fuse kernel ABI enablement for famfs

2025-04-23 Thread John Groves
On 25/04/22 06:36PM, Joanne Koong wrote: > On Sun, Apr 20, 2025 at 6:34 PM John Groves wrote: > > > > * FUSE_DAX_FMAP flag in INIT request/reply > > > > * fuse_conn->famfs_iomap (enable famfs-mapped files) to denote a > > famfs-enabled connection > > > > Signed-off-by: John Groves > > --- > >

Re: [RFC PATCH 11/19] famfs_fuse: Basic famfs mount opts

2025-04-23 Thread John Groves
On 25/04/22 06:51PM, Joanne Koong wrote: > On Sun, Apr 20, 2025 at 6:34 PM John Groves wrote: > > > > * -o shadow= > > * -o daxdev= > > > > Signed-off-by: John Groves > > --- > > fs/fuse/fuse_i.h | 8 +++- > > fs/fuse/inode.c | 25 - > > 2 files changed, 31 insertio

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Nicolin Chen
On Wed, Apr 23, 2025 at 08:55:51AM -0300, Jason Gunthorpe wrote: > On Wed, Apr 23, 2025 at 08:05:49AM +, Tian, Kevin wrote: > > > It's not a good idea having the kernel trust the VMM. > > It certainly shouldn't trust it, but it can validate the VMM's choice > and generate a failure if it isn

Re: [PATCH net-next v10 7/9] gve: add netmem TX support to GVE DQO-RDA mode

2025-04-23 Thread Harshitha Ramamurthy
On Tue, Apr 22, 2025 at 8:11 PM Mina Almasry wrote: > > Use netmem_dma_*() helpers in gve_tx_dqo.c DQO-RDA paths to > enable netmem TX support in that mode. > > Declare support for netmem TX in GVE DQO-RDA mode. > > Signed-off-by: Mina Almasry > > --- > > v10: > - Move setting dev->netmem_tx to r

Re: [PATCH net-next v10 4/9] net: devmem: Implement TX path

2025-04-23 Thread Michael S. Tsirkin
some nits On Wed, Apr 23, 2025 at 03:11:11AM +, Mina Almasry wrote: > @@ -189,43 +200,44 @@ net_devmem_bind_dmabuf(struct net_device *dev, unsigned > int dmabuf_fd, > } > > binding->dev = dev; > - > - err = xa_alloc_cyclic(&net_devmem_dmabuf_bindings, &binding->id, > -

Re: [PATCH net-next v10 3/9] net: devmem: TCP tx netlink api

2025-04-23 Thread Mina Almasry
On Wed, Apr 23, 2025 at 5:11 AM Donald Hunter wrote: > > Mina Almasry writes: > > > From: Stanislav Fomichev > > > > Add bind-tx netlink call to attach dmabuf for TX; queue is not > > required, only ifindex and dmabuf fd for attachment. > > > > Signed-off-by: Stanislav Fomichev > > Signed-off-b

Re: [PATCH v1 07/16] iommufd/viommu: Add driver-allocated vDEVICE support

2025-04-23 Thread Jason Gunthorpe
On Thu, Apr 10, 2025 at 11:37:46PM -0700, Nicolin Chen wrote: > To allow IOMMU drivers to allocate own vDEVICE structures, move the struct > iommufd_vdevice to the public header and provide a pair of viommu ops. > > The iommufd_vdevice_alloc_ioctl will prioritize the callback function from > the v

Re: [PATCH v1 04/16] iommufd: Add iommufd_struct_destroy to revert iommufd_viommu_alloc

2025-04-23 Thread Jason Gunthorpe
On Thu, Apr 10, 2025 at 11:37:43PM -0700, Nicolin Chen wrote: > An IOMMU driver that allocated a vIOMMU may want to revert the allocation, > if it encounters an internal error after the allocation. So, there needs a > destroy helper for drivers to use. > > Move iommufd_object_abort() to the driver

Re: [PATCH v1 03/16] iommu: Add iommu_copy_struct_to_user helper

2025-04-23 Thread Jason Gunthorpe
On Thu, Apr 10, 2025 at 11:37:42PM -0700, Nicolin Chen wrote: > Similar to the iommu_copy_struct_from_user helper receiving data from the > user space, add an iommu_copy_struct_to_user helper to report output data > back to the user space data pointer. > > Signed-off-by: Nicolin Chen > --- > inc

Re: [PATCH v1 02/16] iommufd/viommu: Allow driver-specific user data for a vIOMMU object

2025-04-23 Thread Jason Gunthorpe
On Thu, Apr 10, 2025 at 11:37:41PM -0700, Nicolin Chen wrote: > The new type of vIOMMU for tegra241-cmdqv driver needs a driver-specific > user data. So, add data_len/uptr to the iommu_viommu_alloc uAPI and pass > it in via the viommu_alloc iommu op. > > Signed-off-by: Nicolin Chen > --- > inclu

Re: [PATCH v1 01/16] iommu: Pass in a driver-level user data structure to viommu_alloc op

2025-04-23 Thread Jason Gunthorpe
On Thu, Apr 10, 2025 at 11:37:40PM -0700, Nicolin Chen wrote: > The new type of vIOMMU for tegra241-cmdqv needs to pass in a driver-level > data structure from user space via iommufd, so add a user_data to the op. > > Signed-off-by: Nicolin Chen > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.

Re: [PATCH net-next v10 3/9] net: devmem: TCP tx netlink api

2025-04-23 Thread Donald Hunter
Mina Almasry writes: > From: Stanislav Fomichev > > Add bind-tx netlink call to attach dmabuf for TX; queue is not > required, only ifindex and dmabuf fd for attachment. > > Signed-off-by: Stanislav Fomichev > Signed-off-by: Mina Almasry > > --- > > v3: > - Fix ynl-regen.sh error (Simon). > >

Re: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Jason Gunthorpe
On Wed, Apr 23, 2025 at 08:05:49AM +, Tian, Kevin wrote: > It's not a good idea having the kernel trust the VMM. It certainly shouldn't trust it, but it can validate the VMM's choice and generate a failure if it isn't good. > Also I'm not > sure the contiguity is guaranteed all the time wit

Re: [PATCH] rpmsg: core: Remove deadcode

2025-04-23 Thread Dr. David Alan Gilbert
* Arnaud POULIQUEN (arnaud.pouliq...@foss.st.com) wrote: > Hello, > > On 4/20/25 22:41, li...@treblig.org wrote: > > From: "Dr. David Alan Gilbert" > > > > rpmsg_send_offchannel() and rpmsg_trysend_offchannel() have been > > unused since they were added in 2011's > > commit bcabbccabffe ("rpmsg:

Re: [PATCH net-next v9 2/9] net: add get_netmem/put_netmem support

2025-04-23 Thread Pavel Begunkov
On 4/22/25 22:10, Mina Almasry wrote: ... Instead of adding net_iov / devmem handling in generic paths affecting everyone, you could change those functions where it's get_page() are called legitimately. The niov/devmem part of get/put_netmem doesn't even have the same semantics as the page counte

RE: [PATCH v1 15/16] iommu/tegra241-cmdqv: Add user-space use support

2025-04-23 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Tuesday, April 22, 2025 3:14 AM > On Mon, Apr 21, 2025 at 08:37:40AM +, Tian, Kevin wrote: > > > From: Nicolin Chen > > > Sent: Friday, April 11, 2025 2:38 PM > > > > > > + > > > + vcmdq = iommufd_vcmdq_alloc(viommu, struct tegra241_vcmdq, > > > core); > > > + if

Re: [PATCH v1 00/16] iommufd: Add vIOMMU infrastructure (Part-4 vCMDQ)

2025-04-23 Thread Nicolin Chen
On Wed, Apr 23, 2025 at 12:58:19PM +0530, Vasant Hegde wrote: > On 4/11/2025 12:07 PM, Nicolin Chen wrote: > > The vIOMMU object is designed to represent a slice of an IOMMU HW for its > > virtualization features shared with or passed to user space (a VM mostly) > > in a way of HW acceleration. Thi

Re: [PATCH] rpmsg: core: Remove deadcode

2025-04-23 Thread Arnaud POULIQUEN
Hello, On 4/20/25 22:41, li...@treblig.org wrote: > From: "Dr. David Alan Gilbert" > > rpmsg_send_offchannel() and rpmsg_trysend_offchannel() have been > unused since they were added in 2011's > commit bcabbccabffe ("rpmsg: add virtio-based remote processor messaging > bus") > > Remove them and

Re: [PATCH v1 00/16] iommufd: Add vIOMMU infrastructure (Part-4 vCMDQ)

2025-04-23 Thread Vasant Hegde
Hi Nicolin, On 4/11/2025 12:07 PM, Nicolin Chen wrote: > The vIOMMU object is designed to represent a slice of an IOMMU HW for its > virtualization features shared with or passed to user space (a VM mostly) > in a way of HW acceleration. This extended the HWPT-based design for more > advanced vir