Re: vhost-vdpa tests in tools/virtio

2022-06-22 Thread Jason Wang
On Thu, Jun 23, 2022 at 3:21 AM Eugenio Perez Martin wrote: > > On Wed, Jun 22, 2022 at 5:39 PM Stefano Garzarella > wrote: > > > > Hi, > > while developing/testing the vdpa-blk support in libblkio [1], I > > realized that we added several regressions with the "[PATCH v2 00/19] > > Control VQ su

Re: [PATCH] vhost-vdpa: call vhost_vdpa_cleanup during the release

2022-06-22 Thread Jason Wang
On Wed, Jun 22, 2022 at 11:14 PM Stefano Garzarella wrote: > > Before commit 3d5698793897 ("vhost-vdpa: introduce asid based IOTLB") > we call vhost_vdpa_iotlb_free() during the release to clean all regions > mapped in the iotlb. > > That commit removed vhost_vdpa_iotlb_free() and added vhost_vdpa

Re: [PATCH 3/3] vdpa_sim_blk: call vringh_complete_iotlb() also in the error path

2022-06-22 Thread Jason Wang
On Wed, Jun 22, 2022 at 12:13 AM Stefano Garzarella wrote: > > Call vringh_complete_iotlb() even when we encounter a serious error > that prevents us from writing the status in the "in" header > (e.g. the header length is incorrect, etc.). > > The guest is misbehaving, so maybe the ring is in a ba

Re: [PATCH 2/3] vdpa_sim_blk: limit the number of request handled per batch

2022-06-22 Thread Jason Wang
On Wed, Jun 22, 2022 at 12:09 AM Stefano Garzarella wrote: > > Limit the number of requests (4 per queue as for vdpa_sim_net) handled > in a batch to prevent the worker from using the CPU for too long. > > Suggested-by: Eugenio Pérez > Signed-off-by: Stefano Garzarella > --- > drivers/vdpa/vdpa

RE: [PATCH v2 3/5] vfio/iommu_type1: Remove the domain->ops comparison

2022-06-22 Thread Tian, Kevin
> From: Robin Murphy > Sent: Wednesday, June 22, 2022 3:55 PM > > On 2022-06-16 23:23, Nicolin Chen wrote: > > On Thu, Jun 16, 2022 at 06:40:14AM +, Tian, Kevin wrote: > > > >>> The domain->ops validation was added, as a precaution, for mixed- > driver > >>> systems. However, at this moment o

Re: [PATCH 1/3] vdpa_sim_blk: use dev_dbg() to print errors

2022-06-22 Thread Jason Wang
On Wed, Jun 22, 2022 at 12:09 AM Stefano Garzarella wrote: > > Use dev_dbg() instead of dev_err()/dev_warn() to avoid flooding the > host with prints, when the guest driver is misbehaving. > In this way, prints can be dynamically enabled when the vDPA block > simulator is used to validate a driver

Re: [PATCH v4] virtio_ring : keep used_wrap_counter in vq->last_used_idx

2022-06-22 Thread Jason Wang
On Wed, Jun 22, 2022 at 8:16 PM Michael S. Tsirkin wrote: > > On Wed, Jun 22, 2022 at 04:51:22PM +0800, Jason Wang wrote: > > On Fri, Jun 17, 2022 at 10:04 AM Albert Huang > > wrote: > > > > > > From: "huangjie.albert" > > > > > > the used_wrap_counter and the vq->last_used_idx may get > > > out

Re: [PATCH v2 19/19] vdpasim: control virtqueue support

2022-06-22 Thread Stefano Garzarella
On Wed, Jun 22, 2022 at 05:04:44PM +0200, Eugenio Perez Martin wrote: On Wed, Jun 22, 2022 at 12:21 PM Eugenio Perez Martin wrote: On Tue, Jun 21, 2022 at 5:20 PM Stefano Garzarella wrote: > > Hi Gautam, > > On Wed, Mar 30, 2022 at 8:21 PM Gautam Dawar wrote: > > > > This patch introduces th

vhost-vdpa tests in tools/virtio

2022-06-22 Thread Stefano Garzarella
Hi, while developing/testing the vdpa-blk support in libblkio [1], I realized that we added several regressions with the "[PATCH v2 00/19] Control VQ support in vDPA" series (patches/clarifications already sent). To minimize these problems in the future, I was thinking of adding tests for vh

[PATCH] vhost-vdpa: call vhost_vdpa_cleanup during the release

2022-06-22 Thread Stefano Garzarella
Before commit 3d5698793897 ("vhost-vdpa: introduce asid based IOTLB") we call vhost_vdpa_iotlb_free() during the release to clean all regions mapped in the iotlb. That commit removed vhost_vdpa_iotlb_free() and added vhost_vdpa_cleanup() to do some cleanup, including deleting all mappings, but we

Re: [PATCH v4] virtio_ring : keep used_wrap_counter in vq->last_used_idx

2022-06-22 Thread Michael S. Tsirkin
On Wed, Jun 22, 2022 at 04:51:22PM +0800, Jason Wang wrote: > On Fri, Jun 17, 2022 at 10:04 AM Albert Huang > wrote: > > > > From: "huangjie.albert" > > > > the used_wrap_counter and the vq->last_used_idx may get > > out of sync if they are separate assignment,and interrupt > > might use an incor

Re: [PATCH] virtio_ring: remove unnecessary to_vvq call in virtqueue_disable_cb_packed

2022-06-22 Thread Michael S. Tsirkin
On Wed, Jun 22, 2022 at 03:50:52AM -0400, Deming Wang wrote: > It passes '_vq' to virtqueue_use_indirect(), which still calls > to_vvq to get 'vq', let's directly pass 'vq'. It can avoid > unnecessary call of to_vvq in hot path. > > Signed-off-by: Deming Wang I do not see the point of any of the

Re: [PATCH v4] virtio_ring : keep used_wrap_counter in vq->last_used_idx

2022-06-22 Thread Jason Wang
On Fri, Jun 17, 2022 at 10:04 AM Albert Huang wrote: > > From: "huangjie.albert" > > the used_wrap_counter and the vq->last_used_idx may get > out of sync if they are separate assignment,and interrupt > might use an incorrect value to check for the used index. > > for example:OOB access > ksoftir

Re: [PATCH V3] virtio: disable notification hardening by default

2022-06-22 Thread Cornelia Huck
On Wed, Jun 22 2022, Jason Wang wrote: > We try to harden virtio device notifications in 8b4ec69d7e09 ("virtio: > harden vring IRQ"). It works with the assumption that the driver or > core can properly call virtio_device_ready() at the right > place. Unfortunately, this seems to be not true and u

Re: [PATCH net] virtio_net: fix xdp_rxq_info bug after suspend/resume

2022-06-22 Thread Jason Wang
On Tue, Jun 21, 2022 at 7:50 PM Stephan Gerhold wrote: > > The following sequence currently causes a driver bug warning > when using virtio_net: > > # ip link set eth0 up > # echo mem > /sys/power/state (or e.g. # rtcwake -s 10 -m mem) > > # ip link set eth0 down > > Missing register, d

Re: [PATCH v2 3/5] vfio/iommu_type1: Remove the domain->ops comparison

2022-06-22 Thread Robin Murphy
On 2022-06-16 23:23, Nicolin Chen wrote: On Thu, Jun 16, 2022 at 06:40:14AM +, Tian, Kevin wrote: The domain->ops validation was added, as a precaution, for mixed-driver systems. However, at this moment only one iommu driver is possible. So remove it. It's true on a physical platform. But

Re: [PATCH V3] virtio: disable notification hardening by default

2022-06-22 Thread Jason Wang
On Wed, Jun 22, 2022 at 3:03 PM Michael S. Tsirkin wrote: > > On Wed, Jun 22, 2022 at 09:29:40AM +0800, Jason Wang wrote: > > We try to harden virtio device notifications in 8b4ec69d7e09 ("virtio: > > harden vring IRQ"). It works with the assumption that the driver or > > core can properly call vi

Re: [PATCH V3] virtio: disable notification hardening by default

2022-06-22 Thread Michael S. Tsirkin
On Wed, Jun 22, 2022 at 09:29:40AM +0800, Jason Wang wrote: > We try to harden virtio device notifications in 8b4ec69d7e09 ("virtio: > harden vring IRQ"). It works with the assumption that the driver or > core can properly call virtio_device_ready() at the right > place. Unfortunately, this seems t