[PATCH v1] vdpa: Consider device id larger than 31

2021-11-29 Thread Parav Pandit via Virtualization
virtio device id value can be more than 31. Hence, use BIT_ULL in assignment. Fixes: 33b347503f01 ("vdpa: Define vdpa mgmt device, ops and a netlink interface") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Parav Pandit Acked-by: Jason Wang --- changelog: v0->v1:

RE: [PATH v1 1/2] vdpa: Add support for querying vendor statistics

2021-11-29 Thread Parav Pandit via Virtualization
> From: Jason Wang > Sent: Thursday, November 25, 2021 10:21 AM > > On Thu, Nov 25, 2021 at 12:56 AM Eli Cohen wrote: > > > > Add support for querying virtqueue statistics. Supported statistics are: > > > > received_desc - number of descriptors received for the virtqueue > > completed_desc -

Re: [PATCH v2 net-next 01/26] rtnetlink: introduce generic XDP statistics

2021-11-29 Thread David Ahern
On 11/23/21 9:39 AM, Alexander Lobakin wrote: > +static bool rtnl_get_xdp_stats_xdpxsk(struct sk_buff *skb, u32 ch, > + const void *attr_data) > +{ > + const struct ifla_xdp_stats *xstats = attr_data; > + > + xstats += ch; > + > + if

RE: [PATCH v2] virtio/vsock: fix the transport to work with VMADDR_CID_ANY

2021-11-29 Thread Wang, Wei W
Hi Michael, Do you plan to merge this patch through your tree? If not, I'll resend to have it applied to the net tree. Thanks, Wei On Friday, November 26, 2021 4:54 PM, Stefano Garzarella wrote: > On Thu, Nov 25, 2021 at 08:18:23PM -0500, Wei Wang wrote: > >The VMADDR_CID_ANY flag used by a

Re: [PATCH] net/mlx5_vdpa: Increase the limit on the number of virtuques

2021-11-29 Thread Si-Wei Liu
On 11/25/2021 8:22 AM, Michael S. Tsirkin wrote: On Thu, Nov 25, 2021 at 09:29:53AM +0200, Eli Cohen wrote: On Thu, Nov 25, 2021 at 02:21:43AM -0500, Michael S. Tsirkin wrote: On Wed, Nov 24, 2021 at 07:19:53PM +0200, Eli Cohen wrote: Increase the limit on the maximum number of supported

[PATCH V6 10/10] vhost: use user_worker to check RLIMITs

2021-11-29 Thread Mike Christie
For vhost workers we use the kthread API which inherit's its values from and checks against the kthreadd thread. This results in the wrong RLIMITs being checked. This patch has us use the user_worker helpers which will inherit its values/checks from the thread that owns the device similar to if we

[PATCH V6 06/10] fork: add helpers to clone a process for kernel use

2021-11-29 Thread Mike Christie
The vhost layer is creating kthreads to execute IO and management operations. These threads need to share a mm with a userspace thread, inherit cgroups, and we would like to have the thread accounted for under the userspace thread's rlimit nproc value so a user can't overwhelm the system with

[PATCH V6 01/10] Use copy_process in vhost layer

2021-11-29 Thread Mike Christie
The following patches made over Linus's tree, allow the vhost layer to do a copy_process on the thread that does the VHOST_SET_OWNER ioctl like how io_uring does a copy_process against its userspace app. This allows the vhost layer's worker threads to inherit cgroups, namespaces, address space,

[PATCH V6 03/10] fork: add USER_WORKER flag to not dup/clone files

2021-11-29 Thread Mike Christie
Each vhost device gets a thread that is used to perform IO and management operations. Instead of a thread that is accessing a device, the thread is part of the device, so when it calls the user_worker() function added in the next patch we can't dup or clone the parent's files/FDS because it would

[PATCH V6 09/10] vhost: move worker thread fields to new struct

2021-11-29 Thread Mike Christie
This is just a prep patch. It moves the worker related fields to a new vhost_worker struct and moves the code around to create some helpers that will be used in the next patch. Signed-off-by: Mike Christie Reviewed-by: Stefan Hajnoczi Acked-by: Michael S. Tsirkin Reviewed-by: Christoph Hellwig

[PATCH V6 05/10] signal: Perfom autoreap for PF_USER_WORKER

2021-11-29 Thread Mike Christie
Userspace doesn't know about PF_USER_WORKER threads, so it can't do wait to clean them up. For cases like where qemu will do dynamic/hot add/remove of vhost devices, then we need to auto reap the thread like was done for the kthread case, because qemu does not know what API the kernel/vhost layer

[PATCH V6 08/10] fork: remove create_io_thread

2021-11-29 Thread Mike Christie
create_io_thread is not used anymore so remove it. Signed-off-by: Mike Christie --- include/linux/sched/task.h | 1 - kernel/fork.c | 22 -- 2 files changed, 23 deletions(-) diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index

[PATCH V6 07/10] io_uring: switch to user_worker

2021-11-29 Thread Mike Christie
The user_worker_create/start helpers allow callers to create threads that copy or inherit the caller's attributes like mm, cgroups, namespaces, etc, and are accounted for under the callers rlimits nproc value similar to if the caller did a clone() in userspace. However, instead of returning to

[PATCH V6 02/10] fork/vm: Move common PF_IO_WORKER behavior to new flag

2021-11-29 Thread Mike Christie
This adds a new flag, PF_USER_WORKER, that's used for behavior common to to both PF_IO_WORKER and users like vhost which will use the new user_worker helpers that will use the flag and are added later in this patchset. The common behavior PF_USER_WORKER covers is the initial frame and fpu setup

[PATCH V6 04/10] fork: Add USER_WORKER flag to ignore signals

2021-11-29 Thread Mike Christie
From: Christian Brauner Since this is mirroring kthread's sig ignore api introduced in commit 10ab825bdef8 ("change kernel threads to ignore signals instead of blocking them") this patch adds an option flag, USER_WORKER_SIG_IGN, handled in copy_process() after copy_sighand() and copy_signals()

[PATCH V6 01/10] fork: Make IO worker options flag based

2021-11-29 Thread Mike Christie
This patchset adds a couple new options to kernel_clone_args for IO thread like/related users. Instead of adding new fields to kernel_clone_args for each option, this moves us to a flags based approach by first converting io_thread. Signed-off-by: Mike Christie Suggested-by: Christian Brauner

Re: [PATCH v2 5/5] iommu/virtio: Support identity-mapped domains

2021-11-29 Thread Jean-Philippe Brucker
On Sat, Nov 27, 2021 at 06:09:56PM +0100, Eric Auger wrote: > > - vdomain->viommu = 0; > > + vdomain->viommu = NULL; > nit: that change could have been done in patch 2 Ah yes, I changed that in v2 but fixed up the wrong patch > > return

Re: [PATCH v2 4/5] iommu/virtio: Pass end address to viommu_add_mapping()

2021-11-29 Thread Jean-Philippe Brucker
On Sat, Nov 27, 2021 at 06:09:56PM -0500, Michael S. Tsirkin wrote: > > > -static int viommu_add_mapping(struct viommu_domain *vdomain, unsigned > > > long iova, > > > - phys_addr_t paddr, size_t size, u32 flags) > > > +static int viommu_add_mapping(struct viommu_domain

Re: [PATCH v2 2/5] iommu/virtio: Support bypass domains

2021-11-29 Thread Jean-Philippe Brucker
On Sat, Nov 27, 2021 at 05:18:28PM +0100, Eric Auger wrote: > Hi Jean, > > On 11/23/21 4:52 PM, Jean-Philippe Brucker wrote: > > The VIRTIO_IOMMU_F_BYPASS_CONFIG feature adds a new flag to the ATTACH > > request, that creates a bypass domain. Use it to enable identity > > domains. > > > > When

Re: [PATCH v2 1/5] iommu/virtio: Add definitions for VIRTIO_IOMMU_F_BYPASS_CONFIG

2021-11-29 Thread Jean-Philippe Brucker
Hi Eric, On Sat, Nov 27, 2021 at 08:59:25AM +0100, Eric Auger wrote: > > @@ -36,6 +37,8 @@ struct virtio_iommu_config { > > struct virtio_iommu_range_32domain_range; > > /* Probe buffer size */ > > __le32 probe_size; > > + __u8

Re: [PATCH v2] fuse: rename some files and clean up Makefile

2021-11-29 Thread Vivek Goyal
On Mon, Nov 29, 2021 at 09:27:17PM +0800, Tiezhu Yang wrote: > On 11/29/2021 06:19 PM, Stefan Hajnoczi wrote: > > On Sat, Nov 27, 2021 at 06:13:22PM +0800, Tiezhu Yang wrote: > > > No need to generate virtio_fs.o first and then link to virtiofs.o, just > > > rename virtio_fs.c to virtiofs.c and

Re: [PATCH v2 net-next 21/26] ice: add XDP and XSK generic per-channel statistics

2021-11-29 Thread Toke Høiland-Jørgensen
Daniel Borkmann writes: > On 11/26/21 7:06 PM, Jakub Kicinski wrote: >> On Fri, 26 Nov 2021 13:30:16 +0100 Toke Høiland-Jørgensen wrote: > TBH I wasn't following this thread too closely since I saw Daniel > nacked it already. I do prefer rtnl xstats, I'd just report them > in -s if

[PATCH 28/29] iomap: build the block based code conditionally

2021-11-29 Thread Christoph Hellwig
Only build the block based iomap code if CONFIG_BLOCK is set. Currently that is always the case, but it will change soon. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/Kconfig| 4 ++-- fs/iomap/Makefile | 4 ++-- 2 files changed, 4

[PATCH 29/29] fsdax: don't require CONFIG_BLOCK

2021-11-29 Thread Christoph Hellwig
The file system DAX code now does not require the block code. So allow building a kernel with fuse DAX but not block layer. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 25/29] dax: return the partition offset from fs_dax_get_by_bdev

2021-11-29 Thread Christoph Hellwig
Prepare for the removal of the block_device from the DAX I/O path by returning the partition offset from fs_dax_get_by_bdev so that the file systems have it at hand for use during I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 9 ++---

[PATCH 27/29] dax: fix up some of the block device related ifdefs

2021-11-29 Thread Christoph Hellwig
The DAX device <-> block device association is only enabled if CONFIG_BLOCK is enabled. Update dax.h to account for that and use the right conditions for the fs_put_dax stub as well. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong ---

[PATCH 26/29] fsdax: shift partition offset handling into the file systems

2021-11-29 Thread Christoph Hellwig
Remove the last user of ->bdev in dax.c by requiring the file system to pass in an address that already includes the DAX offset. As part of the only set ->bdev or ->daxdev when actually required in the ->iomap_begin methods. Signed-off-by: Christoph Hellwig Reviewed-by: Gao Xiang [erofs] ---

[PATCH 24/29] iomap: add a IOMAP_DAX flag

2021-11-29 Thread Christoph Hellwig
Add a flag so that the file system can easily detect DAX operations based just on the iomap operation requested instead of looking at inode state using IS_DAX. This will be needed to apply the to be added partition offset only for operations that actually use DAX, but not things like fiemap that

[PATCH 23/29] xfs: pass the mapping flags to xfs_bmbt_to_iomap

2021-11-29 Thread Christoph Hellwig
To prepare for looking at the IOMAP_DAX flag in xfs_bmbt_to_iomap pass in the input mapping flags to xfs_bmbt_to_iomap. Signed-off-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_bmap.c | 4 ++-- fs/xfs/xfs_aops.c| 2 +- fs/xfs/xfs_iomap.c | 35 ---

[PATCH 20/29] ext4: cleanup the dax handling in ext4_fill_super

2021-11-29 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/ext4/super.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH 22/29] xfs: use xfs_direct_write_iomap_ops for DAX zeroing

2021-11-29 Thread Christoph Hellwig
While the buffered write iomap ops do work due to the fact that zeroing never allocates blocks, the DAX zeroing should use the direct ops just like actual DAX I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_iomap.c | 4 ++-- 1 file

[PATCH 21/29] xfs: move dax device handling into xfs_{alloc, free}_buftarg

2021-11-29 Thread Christoph Hellwig
Hide the DAX device lookup from the xfs_super.c code. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Dan Williams --- fs/xfs/xfs_buf.c | 8 fs/xfs/xfs_buf.h | 4 ++-- fs/xfs/xfs_super.c | 26 +- 3 files changed, 11

[PATCH 16/29] fsdax: simplify the offset check in dax_iomap_zero

2021-11-29 Thread Christoph Hellwig
The file relative offset must have the same alignment as the storage offset, so use that and get rid of the call to iomap_sector. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[PATCH 19/29] ext2: cleanup the dax handling in ext2_fill_super

2021-11-29 Thread Christoph Hellwig
Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/ext2/super.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff

[PATCH 13/29] fsdax: use a saner calling convention for copy_cow_page_dax

2021-11-29 Thread Christoph Hellwig
Just pass the vm_fault and iomap_iter structures, and figure out the rest locally. Note that this requires moving dax_iomap_sector up in the file. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 29 + 1 file

[PATCH 18/29] fsdax: decouple zeroing from the iomap buffered I/O code

2021-11-29 Thread Christoph Hellwig
Unshare the DAX and iomap buffered I/O page zeroing code. This code previously did a IS_DAX check deep inside the iomap code, which in fact was the only DAX check in the code. Instead move these checks into the callers. Most callers already have DAX special casing anyway and XFS will need it

[PATCH 17/29] fsdax: factor out a dax_memzero helper

2021-11-29 Thread Christoph Hellwig
Factor out a helper for the "manual" zeroing of a DAX range to clean up dax_iomap_zero a lot. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff

[PATCH 14/29] fsdax: simplify the pgoff calculation

2021-11-29 Thread Christoph Hellwig
Replace the two steps of dax_iomap_sector and bdev_dax_pgoff with a single dax_iomap_pgoff helper that avoids lots of cumbersome sector conversions. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- drivers/dax/super.c | 14 -- fs/dax.c

[PATCH 10/29] dm-log-writes: add a log_writes_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan

[PATCH 15/29] xfs: add xfs_zero_range and xfs_truncate_page helpers

2021-11-29 Thread Christoph Hellwig
From: Shiyang Ruan Add helpers to prepare for using different DAX operations. Signed-off-by: Shiyang Ruan [hch: split from a larger patch + slight cleanups] Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_bmap_util.c | 7 +++

[PATCH 11/29] dm-stripe: add a stripe_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan

[PATCH 12/29] fsdax: remove a pointless __force cast in copy_cow_page_dax

2021-11-29 Thread Christoph Hellwig
Despite its name copy_user_page expected kernel addresses, which is what we already have. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index

[PATCH 07/29] xfs: factor out a xfs_setup_dax_always helper

2021-11-29 Thread Christoph Hellwig
Factor out another DAX setup helper to simplify future changes. Also move the experimental warning after the checks to not clutter the log too much if the setup failed. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_super.c | 47

[PATCH 03/29] dax: remove CONFIG_DAX_DRIVER

2021-11-29 Thread Christoph Hellwig
CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/Kconfig| 4 drivers/nvdimm/Kconfig | 2 +- drivers/s390/block/Kconfig | 2 +- fs/fuse/Kconfig| 2 +- 4 files changed, 3

[PATCH 04/29] dax: simplify the dax_device <-> gendisk association

2021-11-29 Thread Christoph Hellwig
Replace the dax_host_hash with an xarray indexed by the pointer value of the gendisk, and require explicitly calls from the block drivers that want to associate their gendisk with a dax_device. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer --- drivers/dax/bus.c| 6 +-

[PATCH 08/29] dax: remove dax_capable

2021-11-29 Thread Christoph Hellwig
Just open code the block size and dax_dev == NULL checks in the callers. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Gao Xiang [erofs] Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong --- drivers/dax/super.c | 36

[PATCH 02/29] dm: make the DAX support depend on CONFIG_FS_DAX

2021-11-29 Thread Christoph Hellwig
The device mapper DAX support is all hanging off a block device and thus can't be used with device dax. Make it depend on CONFIG_FS_DAX instead of CONFIG_DAX_DRIVER. This also means that bdev_dax_pgoff only needs to be built under CONFIG_FS_DAX now. Signed-off-by: Christoph Hellwig Acked-by:

[PATCH 06/29] dax: move the partition alignment check into fs_dax_get_by_bdev

2021-11-29 Thread Christoph Hellwig
fs_dax_get_by_bdev is the primary interface to find a dax device for a block device, so move the partition alignment check there instead of wiring it up through ->dax_supported. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 23 ++- 1

[PATCH 01/29] dm: fix alloc_dax error handling in alloc_dev

2021-11-29 Thread Christoph Hellwig
Make sure ->dax_dev is NULL on error so that the cleanup path doesn't trip over an ERR_PTR. Reported-by: Dan Williams Signed-off-by: Christoph Hellwig --- drivers/md/dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index

[PATCH 09/29] dm-linear: add a linear_dax_pgoff helper

2021-11-29 Thread Christoph Hellwig
Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan

[PATCH 05/29] dax: remove the pgmap sanity checks in generic_fsdax_supported

2021-11-29 Thread Christoph Hellwig
Drivers that register a dax_dev should make sure it works, no need to double check from the file system. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams --- drivers/dax/super.c | 49 + 1 file changed, 1 insertion(+), 48 deletions(-) diff

decouple DAX from block devices v2

2021-11-29 Thread Christoph Hellwig
Hi Dan, this series decouples the DAX from the block layer so that the block_device is not needed at all for the DAX I/O path. Changes since v1: - rebase on latest v5.16-rc - ensure the new dax zeroing helpers are always declared - fix a dax_dev leak in pmem_attach_disk - remove '\n' from an

Re: [PATCH v2] fuse: rename some files and clean up Makefile

2021-11-29 Thread Stefan Hajnoczi
On Sat, Nov 27, 2021 at 06:13:22PM +0800, Tiezhu Yang wrote: > No need to generate virtio_fs.o first and then link to virtiofs.o, just > rename virtio_fs.c to virtiofs.c and remove "virtiofs-y := virtio_fs.o" > in Makefile, also update MAINTAINERS. Additionally, rename the private > header file