Re: [PATCH v2 03/47] mm: shrinker: add infrastructure for dynamically allocating shrinker

2023-07-26 Thread Dave Chinner via Virtualization
On Mon, Jul 24, 2023 at 05:43:10PM +0800, Qi Zheng wrote: > Currently, the shrinker instances can be divided into the following three > types: > > a) global shrinker instance statically defined in the kernel, such as >workingset_shadow_shrinker. > > b) global shrinker instance statically defi

Re: [PATCH net-next v3 4/4] vsock/test: MSG_PEEK test for SOCK_SEQPACKET

2023-07-26 Thread Stefano Garzarella
On Tue, Jul 25, 2023 at 08:29:12PM +0300, Arseniy Krasnov wrote: This adds MSG_PEEK test for SOCK_SEQPACKET. It works in the same way as SOCK_STREAM test, except it also tests MSG_TRUNC flag. Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/vsock_test.c | 58 +-

Re: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless

2023-07-26 Thread Dave Chinner via Virtualization
On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote: > The shrinker_rwsem is a global read-write lock in shrinkers subsystem, > which protects most operations such as slab shrink, registration and > unregistration of shrinkers, etc. This can easily cause problems in the > following cases. > >

Re: vdpa: use io_uring passthrough command for IOCTLs [was Re: [PATCH 1/2] Reduce vdpa initialization / startup overhead]

2023-07-26 Thread Jason Wang
On Tue, Jul 18, 2023 at 6:32 PM Stefano Garzarella wrote: > > On Thu, Apr 20, 2023 at 6:20 AM Jason Wang wrote: > > > > On Wed, Apr 19, 2023 at 11:33 PM Eugenio Perez Martin > > wrote: > > > > > > On Wed, Apr 19, 2023 at 12:56 AM wrote: > > > > > > > > From: Pei Li > > > > > > > > Currently, p

Re: [PATCH net-next v3 0/4] virtio/vsock: some updates for MSG_PEEK flag

2023-07-26 Thread Michael S. Tsirkin
On Tue, Jul 25, 2023 at 08:29:08PM +0300, Arseniy Krasnov wrote: > Hello, > > This patchset does several things around MSG_PEEK flag support. In > general words it reworks MSG_PEEK test and adds support for this flag > in SOCK_SEQPACKET logic. Here is per-patch description: > > 1) This is cosmeti

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-07-26 Thread Michael S. Tsirkin
On Wed, Jul 26, 2023 at 09:55:37AM +0800, Jason Wang wrote: > On Tue, Jul 25, 2023 at 3:36 PM Michael S. Tsirkin wrote: > > > > On Tue, Jul 25, 2023 at 11:07:40AM +0800, Jason Wang wrote: > > > On Mon, Jul 24, 2023 at 3:17 PM Michael S. Tsirkin > > > wrote: > > > > > > > > On Mon, Jul 24, 2023 a

Re: [PATCH v1] vdpa: Complement vdpa_nl_policy for nlattr length check

2023-07-26 Thread Michael S. Tsirkin
On Tue, Jul 25, 2023 at 08:26:32AM +, Dragos Tatulea wrote: > On Mon, 2023-07-24 at 16:08 -0400, Michael S. Tsirkin wrote: > > On Mon, Jul 24, 2023 at 11:42:42AM +, Dragos Tatulea wrote: > > > On Mon, 2023-07-24 at 05:16 -0400, Michael S. Tsirkin wrote: > > > > On Mon, Jul 24, 2023 at 08:38

[PATCH 0/2] vdpa: Enable strict validation for netlink ops

2023-07-26 Thread Dragos Tatulea via Virtualization
The original patch from Lin Ma enables the vdpa driver to use validation netlink ops. The second patch simply disables the validation skip which is no longer neccesary. Patchset started of from this discussion [0]. [0] https://lore.kernel.org/virtualization/20230726074710-mutt-send-email-...@ker

[PATCH 1/2] vdpa: Complement vdpa_nl_policy for nlattr length check

2023-07-26 Thread Dragos Tatulea via Virtualization
From: Lin Ma The vdpa_nl_policy structure is used to validate the nlattr when parsing the incoming nlmsg. It will ensure the attribute being described produces a valid nlattr pointer in info->attrs before entering into each handler in vdpa_nl_ops. That is to say, the missing part in vdpa_nl_poli

[PATCH 2/2] vdpa: Enable strict validation for netlinks ops

2023-07-26 Thread Dragos Tatulea via Virtualization
The previous patch added the missing nla policies that were required for validation to work. Now strict validation on netlink ops can be enabled. This patch does it. Signed-off-by: Dragos Tatulea --- drivers/vdpa/vdpa.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/vdpa/vdpa.

Re: [PATCH 0/2] vdpa: Enable strict validation for netlink ops

2023-07-26 Thread Michael S. Tsirkin
On Wed, Jul 26, 2023 at 09:30:48PM +0300, Dragos Tatulea wrote: > The original patch from Lin Ma enables the vdpa driver to use validation > netlink ops. > > The second patch simply disables the validation skip which is no longer > neccesary. Patchset started of from this discussion [0]. > > [0]

Re: [PATCH RFC net-next v5 10/14] virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

2023-07-26 Thread Michael S. Tsirkin
On Wed, Jul 19, 2023 at 12:50:14AM +, Bobby Eshleman wrote: > This commit adds a feature bit for virtio vsock to support datagrams. > > Signed-off-by: Jiang Wang > Signed-off-by: Bobby Eshleman > --- > include/uapi/linux/virtio_vsock.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git

Re: [PATCH RFC net-next v5 11/14] vhost/vsock: implement datagram support

2023-07-26 Thread Michael S. Tsirkin
On Wed, Jul 19, 2023 at 12:50:15AM +, Bobby Eshleman wrote: > This commit implements datagram support for vhost/vsock by teaching > vhost to use the common virtio transport datagram functions. > > If the virtio RX buffer is too small, then the transmission is > abandoned, the packet dropped, a

[PATCH v2 0/2] vdpa: Enable strict validation for netlink ops

2023-07-26 Thread Dragos Tatulea via Virtualization
The original patch from Lin Ma enables the vdpa driver to use validation netlink ops. The second patch simply disables the validation skip which is no longer neccesary. Patchset started of from this discussion [0]. [0] https://lore.kernel.org/virtualization/20230726074710-mutt-send-email-...@ker

[PATCH 1/2] vdpa: Complement vdpa_nl_policy for nlattr length check

2023-07-26 Thread Dragos Tatulea via Virtualization
Author: Lin Ma The vdpa_nl_policy structure is used to validate the nlattr when parsing the incoming nlmsg. It will ensure the attribute being described produces a valid nlattr pointer in info->attrs before entering into each handler in vdpa_nl_ops. That is to say, the missing part in vdpa_nl_pol

[PATCH 2/2] vdpa: Enable strict validation for netlinks ops

2023-07-26 Thread Dragos Tatulea via Virtualization
The previous patch added the missing nla policies that were required for validation to work. Now strict validation on netlink ops can be enabled. This patch does it. Signed-off-by: Dragos Tatulea --- drivers/vdpa/vdpa.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/vdpa/vdpa.

Re: [PATCH 0/2] vdpa: Enable strict validation for netlink ops

2023-07-26 Thread Dragos Tatulea via Virtualization
On Wed, 2023-07-26 at 14:36 -0400, Michael S. Tsirkin wrote: > On Wed, Jul 26, 2023 at 09:30:48PM +0300, Dragos Tatulea wrote: > > The original patch from Lin Ma enables the vdpa driver to use validation > > netlink ops. > > > > The second patch simply disables the validation skip which is no long

[PATCH] vdpa/mlx5: Fix crash on shutdown for when no ndev exists

2023-07-26 Thread Dragos Tatulea via Virtualization
The ndev was accessed on shutdown without a check if it actually exists. This triggered the crash pasted below. This patch simply adds a check before using ndev. BUG: kernel NULL pointer dereference, address: 0300 #PF: supervisor read access in kernel mode #PF: error_code(0x) -

[PATCH] virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs()

2023-07-26 Thread Dragos Tatulea via Virtualization
From: Gal Pressman Free the cpumask allocated by create_affinity_masks() before returning from the function. Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading mechanism") Signed-off-by: Gal Pressman Reviewed-by: Dragos Tatulea --- drivers/virtio/virtio_vdpa.c | 2 ++ 1

Re: [PATCH 0/2] vdpa: Enable strict validation for netlink ops

2023-07-26 Thread Dragos Tatulea via Virtualization
On Wed, 2023-07-26 at 20:56 +0200, Dragos Tatulea wrote: > On Wed, 2023-07-26 at 14:36 -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 26, 2023 at 09:30:48PM +0300, Dragos Tatulea wrote: > > > The original patch from Lin Ma enables the vdpa driver to use validation > > > netlink ops. > > > > > >

Re: [PATCH] vdpa/mlx5: Fix crash on shutdown for when no ndev exists

2023-07-26 Thread Michael S. Tsirkin
On Wed, Jul 26, 2023 at 10:07:38PM +0300, Dragos Tatulea wrote: > The ndev was accessed on shutdown without a check if it actually exists. > This triggered the crash pasted below. This patch simply adds a check > before using ndev. > > BUG: kernel NULL pointer dereference, address: 03

Re: [PATCH 2/2] vdpa: Enable strict validation for netlinks ops

2023-07-26 Thread Greg KH
On Wed, Jul 26, 2023 at 09:49:44PM +0300, Dragos Tatulea wrote: > The previous patch added the missing nla policies that were required for > validation to work. > > Now strict validation on netlink ops can be enabled. This patch does it. > > Signed-off-by: Dragos Tatulea > --- > drivers/vdpa/vd

Re: [PATCH 0/2] vdpa: Enable strict validation for netlink ops

2023-07-26 Thread Michael S. Tsirkin
On Wed, Jul 26, 2023 at 07:23:50PM +, Dragos Tatulea wrote: > On Wed, 2023-07-26 at 20:56 +0200, Dragos Tatulea wrote: > > On Wed, 2023-07-26 at 14:36 -0400, Michael S. Tsirkin wrote: > > > On Wed, Jul 26, 2023 at 09:30:48PM +0300, Dragos Tatulea wrote: > > > > The original patch from Lin Ma en

Re: [PATCH 0/2] vdpa: Enable strict validation for netlink ops

2023-07-26 Thread Michael S. Tsirkin
On Wed, Jul 26, 2023 at 06:56:24PM +, Dragos Tatulea wrote: > On Wed, 2023-07-26 at 14:36 -0400, Michael S. Tsirkin wrote: > > On Wed, Jul 26, 2023 at 09:30:48PM +0300, Dragos Tatulea wrote: > > > The original patch from Lin Ma enables the vdpa driver to use validation > > > netlink ops. > > >

Re: [PATCH v2 44/47] mm: shrinker: make global slab shrink lockless

2023-07-26 Thread Dave Chinner via Virtualization
On Wed, Jul 26, 2023 at 05:14:09PM +0800, Qi Zheng wrote: > On 2023/7/26 16:08, Dave Chinner wrote: > > On Mon, Jul 24, 2023 at 05:43:51PM +0800, Qi Zheng wrote: > > > @@ -122,6 +126,13 @@ void shrinker_free_non_registered(struct shrinker > > > *shrinker); > > > void shrinker_register(struct shr

[PATCH] x86/paravirt: Fix tlb_remove_table function callback prototype warning

2023-07-26 Thread Kees Cook
Under W=1, this warning is visible in Clang 16 and newer: arch/x86/kernel/paravirt.c:337:4: warning: cast from 'void (*)(struct mmu_gather *, struct page *)' to 'void (*)(struct mmu_gather *, void *)' converts to incompatible function type [-Wcast-function-type-strict]

Re: [PATCH] x86/paravirt: Fix tlb_remove_table function callback prototype warning

2023-07-26 Thread Juergen Gross via Virtualization
On 27.07.23 01:11, Kees Cook wrote: Under W=1, this warning is visible in Clang 16 and newer: arch/x86/kernel/paravirt.c:337:4: warning: cast from 'void (*)(struct mmu_gather *, struct page *)' to 'void (*)(struct mmu_gather *, void *)' converts to incompatible function type [-Wcast-function-t

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-07-26 Thread Jason Wang
On Wed, Jul 26, 2023 at 7:38 PM Michael S. Tsirkin wrote: > > On Wed, Jul 26, 2023 at 09:55:37AM +0800, Jason Wang wrote: > > On Tue, Jul 25, 2023 at 3:36 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Jul 25, 2023 at 11:07:40AM +0800, Jason Wang wrote: > > > > On Mon, Jul 24, 2023 at 3:17 PM M

Re: [PATCH] virtio-vdpa: Fix cpumask memory leak in virtio_vdpa_find_vqs()

2023-07-26 Thread Jason Wang
On Thu, Jul 27, 2023 at 3:11 AM Dragos Tatulea wrote: > > From: Gal Pressman > > Free the cpumask allocated by create_affinity_masks() before returning > from the function. > > Fixes: 3dad56823b53 ("virtio-vdpa: Support interrupt affinity spreading > mechanism") > Signed-off-by: Gal Pressman >

Re: [PATCH net-next v4 2/2] virtio-net: add cond_resched() to the command waiting loop

2023-07-26 Thread Michael S. Tsirkin
On Thu, Jul 27, 2023 at 02:03:59PM +0800, Jason Wang wrote: > On Wed, Jul 26, 2023 at 7:38 PM Michael S. Tsirkin wrote: > > > > On Wed, Jul 26, 2023 at 09:55:37AM +0800, Jason Wang wrote: > > > On Tue, Jul 25, 2023 at 3:36 PM Michael S. Tsirkin > > > wrote: > > > > > > > > On Tue, Jul 25, 2023 a