Re: Kvm virtual machine uses virtio graphics card, the rotating screen is stuck

2021-11-22 Thread Jason Wang
On Tue, Nov 23, 2021 at 3:00 PM 苟浩 wrote: > > Hello, > > I use `xrandr -o left` to rotate the screen in the kvm virtual machine. > When configured as a Virtio graphics card, the screen will freeze after > rotating the screen, and the keyboard and mouse will not respond. > When configured as a

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-11-22 Thread Peter Xu
Hi, Eugenio, Sorry for the super late response. On Fri, Oct 29, 2021 at 08:35:22PM +0200, Eugenio Pérez wrote: [...] > +int iova_tree_alloc(IOVATree *tree, DMAMap *map, hwaddr iova_begin, > +hwaddr iova_last) > +{ > +struct IOVATreeAllocArgs args = { > +

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

2021-11-22 Thread Christoph Hellwig
On Mon, Nov 22, 2021 at 07:33:06PM -0800, Dan Williams wrote: > Is it time to add a "DAX" symbol namespace? What would be the benefit? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

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

2021-11-22 Thread Christoph Hellwig
On Mon, Nov 22, 2021 at 06:54:09PM -0800, Dan Williams wrote: > On Thu, Nov 18, 2021 at 10:55 PM Christoph Hellwig wrote: > > > > On Wed, Nov 17, 2021 at 09:23:44AM -0800, Dan Williams wrote: > > > Applied, fixed the spelling of 'dependent' in the subject and picked > > > up Mike's Ack from the

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

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:34 AM Christoph Hellwig wrote: > > Despite its name copy_user_page expected kernel addresses, which is what > we already have. Yup, Reviewed-by: Dan Williams ___ Virtualization mailing list

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

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > 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. > >

Re: [PATCH] vdpa_sim: avoid putting an uninitialized iova_domain

2021-11-22 Thread Jason Wang
On Tue, Nov 23, 2021 at 11:12 AM Parav Pandit wrote: > > > > > From: Longpeng(Mike) > > Sent: Monday, November 22, 2021 5:52 PM > > > > From: Longpeng > > > > The system will crash if we put an uninitialized iova_domain, this could > > happen when an error occurs before initializing the

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

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > 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. > >

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

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > 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. > >

Re: [PATCH 08/29] dax: remove dax_capable

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > Just open code the block size and dax_dev == NULL checks in the callers. > > Signed-off-by: Christoph Hellwig > Acked-by: Mike Snitzer You dropped Gao Xiang's reviewed-by:

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

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > 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

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

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > 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. > Reviewed-by: Dan Williams

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

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > Drivers that register a dax_dev should make sure it works, no need > to double check from the file system. Reviewed-by: Dan Williams ...with a self-reminder to migrate this validation to a unit test to backstop any future refactoring

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

2021-11-22 Thread Dan Williams
On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > 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

RE: [PATCH] vdpa_sim: avoid putting an uninitialized iova_domain

2021-11-22 Thread Parav Pandit via Virtualization
> From: Longpeng(Mike) > Sent: Monday, November 22, 2021 5:52 PM > > From: Longpeng > > The system will crash if we put an uninitialized iova_domain, this could > happen when an error occurs before initializing the iova_domain in > vdpasim_create(). > > BUG: kernel NULL pointer

Re: [PATCH 03/29] dax: remove CONFIG_DAX_DRIVER

2021-11-22 Thread Dan Williams
On Wed, Nov 17, 2021 at 9:43 AM Dan Williams wrote: > > On Tue, Nov 9, 2021 at 12:33 AM Christoph Hellwig wrote: > > > > CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. > > Applied. Unapplied, Reviewed-by: Dan Williams ___

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

2021-11-22 Thread Dan Williams
On Thu, Nov 18, 2021 at 10:55 PM Christoph Hellwig wrote: > > On Wed, Nov 17, 2021 at 09:23:44AM -0800, Dan Williams wrote: > > Applied, fixed the spelling of 'dependent' in the subject and picked > > up Mike's Ack from the previous send: > > > >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 9:50 PM Halil Pasic wrote: > > On Mon, 22 Nov 2021 14:25:26 +0800 > Jason Wang wrote: > > > On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: > > > > > > On Mon, 22 Nov 2021 06:35:18 +0100 > > > Halil Pasic wrote: > > > > > > > > I think it should be a common issue,

Re: [PATCH 1/2] vdpa: Add support for querying statistics

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 11:56 PM Parav Pandit wrote: > > > > > From: Eli Cohen > > Sent: Monday, November 22, 2021 8:37 PM > > > > On Mon, Nov 22, 2021 at 12:15:36PM +0200, Parav Pandit wrote: > > > > > > > > > > From: Jason Wang > > > > Sent: Monday, November 22, 2021 3:02 PM > > > > > > > > >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Jason Wang
On Tue, Nov 23, 2021 at 4:24 AM Halil Pasic wrote: > > On Mon, 22 Nov 2021 14:25:26 +0800 > Jason Wang wrote: > > > I think the fixes are: > > > > 1) fixing the vhost vsock > > 2) use suppress_used_validation=true to let vsock driver to validate > > the in buffer length > > 3) probably a new

Re: [PATCH] vdpa_sim: avoid putting an uninitialized iova_domain

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 8:22 PM Longpeng(Mike) wrote: > > From: Longpeng > > The system will crash if we put an uninitialized iova_domain, this > could happen when an error occurs before initializing the iova_domain > in vdpasim_create(). > > BUG: kernel NULL pointer dereference, address:

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Halil Pasic
On Mon, 22 Nov 2021 14:25:26 +0800 Jason Wang wrote: > I think the fixes are: > > 1) fixing the vhost vsock > 2) use suppress_used_validation=true to let vsock driver to validate > the in buffer length > 3) probably a new feature so the driver can only enable the validation > when the feature

Re: [PATCH V5 07/10] io_uring: switch to kernel_worker

2021-11-22 Thread michael . christie
On 11/22/21 8:20 AM, Jens Axboe wrote: > On 11/22/21 3:02 AM, Christian Brauner wrote: >> On Sun, Nov 21, 2021 at 11:17:11AM -0700, Jens Axboe wrote: >>> On 11/21/21 10:49 AM, Mike Christie wrote: Convert io_uring and io-wq to use kernel_worker. >>> >>> I don't like the kernel_worker name,

[PATCH 2/2] vhost/vsock: cleanup removing `len` variable

2021-11-22 Thread Stefano Garzarella
We can increment `total_len` directly and remove `len` since it is no longer used for vhost_add_used(). Signed-off-by: Stefano Garzarella --- drivers/vhost/vsock.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index

[PATCH 1/2] vhost/vsock: fix incorrect used length reported to the guest

2021-11-22 Thread Stefano Garzarella
The "used length" reported by calling vhost_add_used() must be the number of bytes written by the device (using "in" buffers). In vhost_vsock_handle_tx_kick() the device only reads the guest buffers (they are all "out" buffers), without writing anything, so we must pass 0 as "used length" to

[PATCH 0/2] vhost/vsock: fix used length and cleanup in vhost_vsock_handle_tx_kick()

2021-11-22 Thread Stefano Garzarella
This is a follow-up to Micheal's patch [1] and the discussion with Halil and Jason [2]. I made two patches, one to fix the problem and one for cleanup. This should simplify the backport of the fix because we've had the problem since vhost-vsock was introduced (v4.8) and that part has been touched

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Stefano Garzarella
On Mon, Nov 22, 2021 at 03:24:32PM +0100, Halil Pasic wrote: On Mon, 22 Nov 2021 12:08:22 +0100 Stefano Garzarella wrote: On Mon, Nov 22, 2021 at 08:55:24AM +0100, Stefano Garzarella wrote: >On Mon, Nov 22, 2021 at 02:25:26PM +0800, Jason Wang wrote: >>On Mon, Nov 22, 2021 at 1:49 PM Halil

RE: [PATCH 1/2] vdpa: Add support for querying statistics

2021-11-22 Thread Parav Pandit via Virtualization
> From: Eli Cohen > Sent: Monday, November 22, 2021 8:37 PM > > On Mon, Nov 22, 2021 at 12:15:36PM +0200, Parav Pandit wrote: > > > > > > > From: Jason Wang > > > Sent: Monday, November 22, 2021 3:02 PM > > > > > > > If we go with vendor stats, how can we communicate the information > > > >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Halil Pasic
On Mon, 22 Nov 2021 12:08:22 +0100 Stefano Garzarella wrote: > On Mon, Nov 22, 2021 at 08:55:24AM +0100, Stefano Garzarella wrote: > >On Mon, Nov 22, 2021 at 02:25:26PM +0800, Jason Wang wrote: > >>On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: > >>> > >>>On Mon, 22 Nov 2021 06:35:18

Re: [PATCH V5 07/10] io_uring: switch to kernel_worker

2021-11-22 Thread Jens Axboe
On 11/22/21 3:02 AM, Christian Brauner wrote: > On Sun, Nov 21, 2021 at 11:17:11AM -0700, Jens Axboe wrote: >> On 11/21/21 10:49 AM, Mike Christie wrote: >>> Convert io_uring and io-wq to use kernel_worker. >> >> I don't like the kernel_worker name, that implies it's always giving you >> a kernel

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Halil Pasic
On Mon, 22 Nov 2021 14:25:26 +0800 Jason Wang wrote: > On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: > > > > On Mon, 22 Nov 2021 06:35:18 +0100 > > Halil Pasic wrote: > > > > > > I think it should be a common issue, looking at > > > > vhost_vsock_handle_tx_kick(), it did: > > > > > > >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Stefano Garzarella
On Mon, Nov 22, 2021 at 08:55:24AM +0100, Stefano Garzarella wrote: On Mon, Nov 22, 2021 at 02:25:26PM +0800, Jason Wang wrote: On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: On Mon, 22 Nov 2021 06:35:18 +0100 Halil Pasic wrote: > I think it should be a common issue, looking at >

Re: [PATCH] vsock/virtio: suppress used length validation

2021-11-22 Thread Stefano Garzarella
On Mon, Nov 22, 2021 at 04:32:01AM -0500, Michael S. Tsirkin wrote: It turns out that vhost vsock violates the virtio spec by supplying the out buffer length in the used length (should just be the in length). As a result, attempts to validate the used length fail with: vmw_vsock_virtio_transport

RE: [PATCH 1/2] vdpa: Add support for querying statistics

2021-11-22 Thread Parav Pandit via Virtualization
> From: Jason Wang > Sent: Monday, November 22, 2021 3:02 PM > > > If we go with vendor stats, how can we communicate the information to > > userspace? Currenlty we use netlink attributes defined to pass this > > information. > > It can be done exactly as what have been done in the patch, we

RE: [PATCH 1/2] vdpa: Add support for querying statistics

2021-11-22 Thread Parav Pandit via Virtualization
> From: Jason Wang > Sent: Monday, November 22, 2021 8:00 AM > > On Fri, Nov 19, 2021 at 11:09 AM Parav Pandit wrote: > > > > > > > > > From: Jason Wang > > > Sent: Friday, November 19, 2021 8:12 AM > > > > > > On Thu, Nov 18, 2021 at 1:58 PM Eli Cohen wrote: > > > > > > > > Add support

Re: [PATCH 6/6] vhost_net: use RCU callbacks instead of synchronize_rcu()

2021-11-22 Thread Michael S. Tsirkin
On Fri, Nov 19, 2021 at 02:32:05PM +0300, Andrey Ryabinin wrote: > > > On 11/16/21 8:00 AM, Jason Wang wrote: > > On Mon, Nov 15, 2021 at 11:32 PM Andrey Ryabinin > > wrote: > >> > >> Currently vhost_net_release() uses synchronize_rcu() to synchronize > >> freeing with

[PATCH] vsock/virtio: suppress used length validation

2021-11-22 Thread Michael S. Tsirkin
It turns out that vhost vsock violates the virtio spec by supplying the out buffer length in the used length (should just be the in length). As a result, attempts to validate the used length fail with: vmw_vsock_virtio_transport virtio1: tx: used len 44 is larger than in buflen 0 Since vsock

Re: [PATCH 1/2] vdpa: Add support for querying statistics

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 5:08 PM Eli Cohen wrote: > > On Mon, Nov 22, 2021 at 04:07:24PM +0800, Jason Wang wrote: > > On Mon, Nov 22, 2021 at 3:56 PM Eli Cohen wrote: > > > > > > On Mon, Nov 22, 2021 at 10:30:12AM +0800, Jason Wang wrote: > > > > On Fri, Nov 19, 2021 at 11:09 AM Parav Pandit

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

2021-11-22 Thread Geert Uytterhoeven
On Sun, Nov 21, 2021 at 6:49 PM Mike Christie wrote: > 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 > kernel_worker helpers that will use the flag and are added later in this > patchset. > > The common

Re: [PATCH 1/2] vdpa: Add support for querying statistics

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 3:56 PM Eli Cohen wrote: > > On Mon, Nov 22, 2021 at 10:30:12AM +0800, Jason Wang wrote: > > On Fri, Nov 19, 2021 at 11:09 AM Parav Pandit wrote: > > > > > > > > > > > > > From: Jason Wang > > > > Sent: Friday, November 19, 2021 8:12 AM > > > > > > > > On Thu, Nov 18,