Re: [PATCH] vdpa_sim: Fix DMA mask

2020-10-28 Thread Jason Wang
- dev->coherent_dma_mask = DMA_BIT_MASK(64); + dev->dma_mask = >coherent_dma_mask; + if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64))) + goto err_iommu; set_dma_ops(dev, _dma_ops); vdpasim->iommu = vhost_iotlb_alloc(2048, 0); Acked-by: Jason Wang

Re: [PATCH] vdpa/mlx5: Fix error return in map_direct_mr()

2020-10-26 Thread Jason Wang
- if (!ret) + err = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0); + if (!err) goto err_map; err = create_direct_mr(mvdev, mr); Acked-by: Jason Wang

[PATCH V4 3/3] vdpa_sim: implement get_iova_range()

2020-10-23 Thread Jason Wang
This implements a sample get_iova_range() for the simulator which advertise [0, ULLONG_MAX] as the valid range. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa

[PATCH V4 0/3] vDPA: API for reporting IOVA range

2020-10-23 Thread Jason Wang
own DMA translation logic and assume a [0, ULLONG_MAX] range - mandate IOVA range only for IOMMU that forcing aperture - forbid the map which is out of the IOVA range in vhost-vDPA Jason Wang (3): vdpa: introduce config op to get valid iova range vhost: vdpa: report iova range vdpa_sim

[PATCH V4 2/3] vhost: vdpa: report iova range

2020-10-23 Thread Jason Wang
DOMAIN_ATTR_GEOMETRY, otherwise [0, ULLONG_MAX] is assumed. For safety, this patch also rules out the map request which is not in the valid range. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 41 include/uapi/linux/vhost.h | 4 include/uapi/linux

[PATCH V4 1/3] vdpa: introduce config op to get valid iova range

2020-10-23 Thread Jason Wang
This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index eae0bfd87d91..30bc7a7223bb 100644

Re: [PATCH V3 2/3] vhost: vdpa: report iova range

2020-10-23 Thread Jason Wang
, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Jason-Wang/vDPA-API-for-reporting-IOVA-range/20201023-102708 base: https://git.kernel.org/pub/scm/linux

[PATCH V3 2/3] vhost: vdpa: report iova range

2020-10-22 Thread Jason Wang
DOMAIN_ATTR_GEOMETRY, otherwise [0, ULLONG_MAX] is assumed. For safety, this patch also rules out the map request which is not in the valid range. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 40 include/uapi/linux/vhost.h | 4 include/uapi/linux

[PATCH V3 3/3] vdpa_sim: implement get_iova_range()

2020-10-22 Thread Jason Wang
This implements a sample get_iova_range() for the simulator which advertise [0, ULLONG_MAX] as the valid range. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa

[PATCH V3 0/3] vDPA: API for reporting IOVA range

2020-10-22 Thread Jason Wang
, ULLONG_MAX] range - mandate IOVA range only for IOMMU that forcing aperture - forbid the map which is out of the IOVA range in vhost-vDPA Jason Wang (3): vdpa: introduce config op to get valid iova range vhost: vdpa: report iova range vdpa_sim: implement get_iova_range() drivers/vdpa/vdpa_sim

[PATCH V3 1/3] vdpa: introduce config op to get valid iova range

2020-10-22 Thread Jason Wang
This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index eae0bfd87d91..30bc7a7223bb 100644

Re: [PATCH 0/4] vDPA: API for reporting IOVA range

2020-10-21 Thread Jason Wang
On 2020/10/21 下午10:45, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:43AM +0800, Jason Wang wrote: Hi All: This series introduces API for reporing IOVA range. This is a must for userspace to work correclty: - for the process that uses vhost-vDPA directly to properly allocate

Re: [PATCH v4] Revert "virtio-net: ethtool configurable RXCSUM"

2020-10-21 Thread Jason Wang
t have a control vq, everything breaks. Revert the original commit for now. Cc: Tonghao Zhang Cc: Willem de Bruijn Fixes: 3618ad2a7c0e7 ("virtio-net: ethtool configurable RXCSUM") Reported-by: kernel test robot Signed-off-by: Michael S. Tsirkin --- Acked-by: Jason Wang Same patch

Re: [PATCH 2/2] KVM: not link irqfd with a fake IRQ bypass producer

2020-10-20 Thread Jason Wang
On 2020/10/19 下午5:06, Zhenzhong Duan wrote: In case failure to setup Post interrupt for an IRQ, it make no sense to assign irqfd->producer to the producer. This change makes code more robust. It's better to describe what issue we will get without this patch. Thanks Signed-off-by:

Re: [PATCH 1/2] KVM: not register a IRQ bypass producer if unsupported or disabled

2020-10-20 Thread Jason Wang
On 2020/10/19 下午5:06, Zhenzhong Duan wrote: If Post interrupt is disabled due to hardware limit or forcely disabled by "intremap=nopost" parameter, return -EINVAL so that the legacy mode IRQ isn't registered as IRQ bypass producer. Is there any side effect if it was still registered?

Re: [PATCH net v2] Revert "virtio-net: ethtool configurable RXCSUM"

2020-10-20 Thread Jason Wang
On 2020/10/20 上午1:32, Michael S. Tsirkin wrote: This reverts commit 3618ad2a7c0e78e4258386394d5d5f92a3dbccf8. When the device does not have a control vq (e.g. when using a version of QEMU based on upstream v0.10 or older, or when specifying

Re: [PATCH v3] i2c: virtio: add a virtio i2c frontend driver

2020-10-15 Thread Jason Wang
On 2020/10/14 下午4:37, Jie Deng wrote: On 2020/10/13 16:00, Jason Wang wrote: + +    virtqueue_kick(vq); + +    time_left = wait_for_completion_timeout(>completion, adap->timeout); +    if (!time_left) { +    dev_err(>dev, "msg[%d]: addr=0x%x timeout.

Re: [PATCH v3 2/2] vhost-vdpa: fix page pinning leakage in error path

2020-10-15 Thread Jason Wang
On 2020/10/14 上午7:42, si-wei liu wrote: So what I suggest is to fix the pinning leakage first and do the possible optimization on top (which is still questionable to me). OK. Unfortunately, this was picked and got merged in upstream. So I will post a follow up patch set to 1) revert the

Re: [PATCH v3 2/2] vhost-vdpa: fix page pinning leakage in error path

2020-10-14 Thread Jason Wang
On 2020/10/14 下午2:52, Michael S. Tsirkin wrote: On Tue, Oct 13, 2020 at 04:42:59PM -0700, si-wei liu wrote: On 10/9/2020 7:27 PM, Jason Wang wrote: On 2020/10/3 下午1:02, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up

Re: [PATCH v3] i2c: virtio: add a virtio i2c frontend driver

2020-10-13 Thread Jason Wang
On 2020/10/13 下午3:16, Jie Deng wrote: On 2020/10/12 11:43, Jason Wang wrote: On 2020/10/12 上午10:45, Jie Deng wrote: On 2020/10/10 11:14, Jason Wang wrote: + +    virtqueue_kick(vq); + +    time_left = wait_for_completion_timeout(>completion, adap->t

Re: [RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group

2020-10-12 Thread Jason Wang
On 2020/10/12 下午4:17, Eli Cohen wrote: On Mon, Oct 12, 2020 at 03:45:10PM +0800, Jason Wang wrote: So in theory we can have several asid's (for different virtqueues), each one should be followed by a specific set_map call. If this is so, how do I know if I met all the conditions run my driver

Re: [RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group

2020-10-12 Thread Jason Wang
On 2020/10/12 下午2:59, Eli Cohen wrote: On Fri, Oct 09, 2020 at 11:56:45AM +0800, Jason Wang wrote: On 2020/10/1 下午9:29, Eli Cohen wrote: On Thu, Sep 24, 2020 at 11:21:11AM +0800, Jason Wang wrote: This patch introduces a new bus operation to allow the vDPA bus driver to associate an ASID

Re: [PATCH v3] i2c: virtio: add a virtio i2c frontend driver

2020-10-11 Thread Jason Wang
On 2020/10/12 上午10:45, Jie Deng wrote: On 2020/10/10 11:14, Jason Wang wrote: + +    virtqueue_kick(vq); + +    time_left = wait_for_completion_timeout(>completion, adap->timeout); +    if (!time_left) { +    dev_err(>dev, "msg[%d]: addr=0x%x timeout.\

Re: [PATCH] vdpa/mlx5: should keep avail_index despite device status

2020-10-10 Thread Jason Wang
device be able to get to vq's avail_index, regardless of vDPA device status. Save the index that was last seen when virtq was stopped, so that userspace doesn't complain. Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 20 ++-- 1

Re: [PATCH v3] i2c: virtio: add a virtio i2c frontend driver

2020-10-09 Thread Jason Wang
On 2020/9/22 上午10:58, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message

Re: [PATCH v3 3/3] vhost: Don't call log_access_ok() when using IOTLB

2020-10-09 Thread Jason Wang
that only checks accesses to the log for the used structure when there isn't an IOTLB device around. Signed-off-by: Greg Kurz Acked-by: Jason Wang In the future, we may consider to deprecate log_guest_addr since in any case regardless of IOTLB ennoblement we can get GPA from either IOTLB or

Re: [PATCH v3 2/3] vhost: Use vhost_get_used_size() in vhost_vring_set_addr()

2020-10-09 Thread Jason Wang
um * sizeof *vq->used->ring)) + vhost_get_used_size(vq, vq->num))) return -EINVAL; } Acked-by: Jason Wang

Re: [PATCH v3 2/2] vhost-vdpa: fix page pinning leakage in error path

2020-10-09 Thread Jason Wang
On 2020/10/3 下午1:02, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the error path. As the inflight pinned pages, specifically for memory region that strides across multiple chunks, would need

Re: [PATCH v3 1/2] vhost-vdpa: fix vhost_vdpa_map() on error condition

2020-10-09 Thread Jason Wang
flags(perm)); } + if (r) + vhost_iotlb_del_range(dev->iotlb, iova, iova + size - 1); + return r; } Acked-by: Jason Wang

Re: [PATCH v2] vringh: fix __vringh_iov() when riov and wiov are different

2020-10-08 Thread Jason Wang
On 2020/10/9 上午4:42, Stefano Garzarella wrote: If riov and wiov are both defined and they point to different objects, only riov is initialized. If the wiov is not initialized by the caller, the function fails returning -EINVAL and printing "Readable desc 0x... after writable" error message.

Re: [RFC PATCH 18/24] vhost-vdpa: support ASID based IOTLB API

2020-10-08 Thread Jason Wang
On 2020/9/28 下午11:44, Eugenio Perez Martin wrote: -u64 iova, u64 size) +static int vhost_vdpa_unmap(struct vhost_vdpa *v, + struct vhost_iotlb *iotlb, + u64 iova, u64 size) { struct vdpa_device *vdpa =

Re: [RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group

2020-10-08 Thread Jason Wang
On 2020/10/1 下午9:29, Eli Cohen wrote: On Thu, Sep 24, 2020 at 11:21:11AM +0800, Jason Wang wrote: This patch introduces a new bus operation to allow the vDPA bus driver to associate an ASID to a virtqueue group. So in case of virtio_net, I would expect that all the data virtqueues

Re: [RFC PATCH 09/24] vdpa: multiple address spaces support

2020-10-08 Thread Jason Wang
On 2020/10/1 下午9:23, Eli Cohen wrote: + /* Only support 1 address space */ + if (vdpa->ngroups != 1) + return -ENOTSUPP; Checkpatch warning: prefer EOPNOTSUPP Will fix. Thanks

Re: [RFC PATCH 09/24] vdpa: multiple address spaces support

2020-10-08 Thread Jason Wang
On 2020/10/1 下午9:21, Eli Cohen wrote: On Thu, Sep 24, 2020 at 11:21:10AM +0800, Jason Wang wrote: This patches introduces the multiple address spaces support for vDPA device. This idea is to identify a specific address space via an dedicated identifier - ASID. During vDPA device allocation

Re: [RFC PATCH 08/24] vdpa: introduce virtqueue groups

2020-10-08 Thread Jason Wang
On 2020/9/28 下午11:44, Eugenio Perez Martin wrote: On Thu, Sep 24, 2020 at 5:23 AM Jason Wang wrote: This patch introduces virtqueue groups to vDPA device. The virtqueue group is the minimal set of virtqueues that must share an address space. And the adddress space identifier could only

Re: [RFC PATCH 06/24] vhost-vdpa: switch to use vhost-vdpa specific IOTLB

2020-10-08 Thread Jason Wang
On 2020/9/30 下午8:02, Eli Cohen wrote: On Thu, Sep 24, 2020 at 11:21:07AM +0800, Jason Wang wrote: To ease the implementation of per group ASID support for vDPA device. This patch switches to use a vhost-vdpa specific IOTLB to avoid the unnecessary refactoring of the vhost core. Signed-off

Re: [RFC PATCH 05/24] vhost-vdpa: passing iotlb to IOMMU mapping helpers

2020-10-08 Thread Jason Wang
On 2020/9/30 下午7:26, Eli Cohen wrote: On Thu, Sep 24, 2020 at 11:21:06AM +0800, Jason Wang wrote: To prepare for the ASID support for vhost-vdpa, try to pass IOTLB object to dma helpers. Maybe it's worth mentioning here that this patch does not change any functionality and is presented

Re: [PATCH] vhost-vdpa: fix page pinning leakage in error path

2020-10-02 Thread Jason Wang
On 2020/10/2 上午4:23, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the error path. As the inflight pinned pages, specifically for memory region that strides across multiple chunks, would need

Re: [RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()

2020-09-25 Thread Jason Wang
On 2020/9/24 下午3:48, Eli Cohen wrote: On Thu, Sep 24, 2020 at 11:21:03AM +0800, Jason Wang wrote: We need to free vqs during the err path after it has been allocated since vhost won't do that for us. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 11 --- 1 file changed, 8

Re: [RFC PATCH 00/24] Control VQ support in vDPA

2020-09-25 Thread Jason Wang
On 2020/9/24 下午6:17, Stefan Hajnoczi wrote: On Thu, Sep 24, 2020 at 11:21:01AM +0800, Jason Wang wrote: This series tries to add the support for control virtqueue in vDPA. Please include documentation for both driver authors and vhost-vdpa ioctl users. vhost-vdpa ioctls are only documented

Re: [PATCH v3 -next] vdpa: mlx5: change Kconfig depends to fix build errors

2020-09-25 Thread Jason Wang
On 2020/9/25 下午6:19, Michael S. Tsirkin wrote: On Fri, Sep 25, 2020 at 10:20:05AM +0300, Leon Romanovsky wrote: On Thu, Sep 24, 2020 at 12:02:43PM -0400, Michael S. Tsirkin wrote: On Thu, Sep 24, 2020 at 08:47:05AM -0700, Randy Dunlap wrote: On 9/24/20 3:24 AM, Eli Cohen wrote: On Thu, Sep

Re: [RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()

2020-09-25 Thread Jason Wang
On 2020/9/24 下午5:31, Michael S. Tsirkin wrote: On Thu, Sep 24, 2020 at 11:21:03AM +0800, Jason Wang wrote: We need to free vqs during the err path after it has been allocated since vhost won't do that for us. Signed-off-by: Jason Wang This is a bugfix too right? I don't see it posted

Re: [RFC PATCH 01/24] vhost-vdpa: fix backend feature ioctls

2020-09-24 Thread Jason Wang
On 2020/9/24 下午3:50, Michael S. Tsirkin wrote: On Thu, Sep 24, 2020 at 11:21:02AM +0800, Jason Wang wrote: Commit 653055b9acd4 ("vhost-vdpa: support get/set backend features") introduces two malfunction backend features ioctls: 1) the ioctls was blindly added to vring ioctl inste

Re: [RFC PATCH 01/24] vhost-vdpa: fix backend feature ioctls

2020-09-24 Thread Jason Wang
On 2020/9/24 下午3:16, Eli Cohen wrote: On Thu, Sep 24, 2020 at 11:21:02AM +0800, Jason Wang wrote: Commit 653055b9acd4 ("vhost-vdpa: support get/set backend features") introduces two malfunction backend features ioctls: 1) the ioctls was blindly added to vring ioctl instead of v

[RFC PATCH 23/24] vdpa_sim: filter destination mac address

2020-09-23 Thread Jason Wang
Add a simple unicast filter to filter out the dest MAC doesn't match to the one stored in the config. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 49 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/drivers/vdpa/vdpa_sim

[RFC PATCH 24/24] vdpasim: control virtqueue support

2020-09-23 Thread Jason Wang
is associated to all virtqueue groups by default. All virtqueues share the same mapping by default. To demonstrate the function, VIRITO_NET_F_CTRL_MACADDR is implemented in the simulator for the driver to set mac address. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 189

[RFC PATCH 22/24] vdpa_sim: factor out buffer completion logic

2020-09-23 Thread Jason Wang
This patch factors out the buffer completion logic in order to support future features. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 33 +--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b

[RFC PATCH 21/24] vdpa_sim: advertise VIRTIO_NET_F_MAC

2020-09-23 Thread Jason Wang
We advertise mac address via config space, so let's advertise VIRTIO_NET_F_MAC. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index

[RFC PATCH 20/24] vdpa_sim: advertise VIRTIO_NET_F_MTU

2020-09-23 Thread Jason Wang
We've already reported maximum mtu via config space, so let's advertise the feature. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index

[RFC PATCH 16/24] vhost-vdpa: uAPI to get virtqueue group id

2020-09-23 Thread Jason Wang
Follows the support for virtqueue group in vDPA. This patches introduces uAPI to get the virtqueue group ID for a specific virtqueue in vhost-vdpa. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 8 include/uapi/linux/vhost.h | 4 2 files changed, 12 insertions(+) diff

[RFC PATCH 19/24] vdpa_sim: use separated iov for reading and writing

2020-09-23 Thread Jason Wang
In order to support control virtqueue whose commands have both in and out descriptors, we need to use separated iov for reading and writing in vdpa_sim. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git

[RFC PATCH 18/24] vhost-vdpa: support ASID based IOTLB API

2020-09-23 Thread Jason Wang
device with more than one address spaces that depends on platform IOMMU. This work will be done by moving the IOMMU logic from vhost-vDPA to vDPA device driver. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 106 --- 1 file changed, 79 insertions

[RFC PATCH 17/24] vhost-vdpa: introduce uAPI to set group ASID

2020-09-23 Thread Jason Wang
Follows the vDPA support for associating ASID to a specific virtqueue group. This patch adds a uAPI to support setting them from userspace. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 8 include/uapi/linux/vhost.h | 4 2 files changed, 12 insertions(+) diff --git

[RFC PATCH 15/24] vhost-vdpa: introduce uAPI to get the number of address spaces

2020-09-23 Thread Jason Wang
A new uAPI is introduced for the userspace to know the address spaces that is supported by a specific device. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 3 +++ include/uapi/linux/vhost.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost

[RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group

2020-09-23 Thread Jason Wang
This patch introduces a new bus operation to allow the vDPA bus driver to associate an ASID to a virtqueue group. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 1e1163daa352

[RFC PATCH 14/24] vhost-vdpa: introduce uAPI to get the number of virtqueue groups

2020-09-23 Thread Jason Wang
Follows the vDPA support for multiple address spaces, this patch introduce uAPI for the userspace to know the number of virtqueue groups supported by the vDPA device. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 4 include/uapi/linux/vhost.h | 4 2 files changed, 8

[RFC PATCH 13/24] vhost-vdpa: introduce ASID based IOTLB

2020-09-23 Thread Jason Wang
there's no mapping associated with an ASID. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 94 +--- 1 file changed, 72 insertions(+), 22 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 6552987544d7..1ba7e95619b5 100644

[RFC PATCH 11/24] vhost_iotlb: split out IOTLB initialization

2020-09-23 Thread Jason Wang
This patch split out IOTLB initialization logic into a new helper. This allows vhost to implement device specific IOTLB allocation logic. Signed-off-by: Jason Wang --- drivers/vhost/iotlb.c | 23 ++- include/linux/vhost_iotlb.h | 2 ++ 2 files changed, 20 insertions

[RFC PATCH 12/24] vhost: support ASID in IOTLB API

2020-09-23 Thread Jason Wang
This patches allows userspace to send ASID based IOTLB message to vhost. This idea is to use the reserved u32 field in the existing V2 IOTLB message. Vhost device should advertise this capability via VHOST_BACKEND_F_IOTLB_ASID backend feature. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c

[RFC PATCH 09/24] vdpa: multiple address spaces support

2020-09-23 Thread Jason Wang
how the actual composition/emulation were done in the device driver). Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- drivers/vdpa/mlx5/net/mlx5_vnet.c | 5 +++-- drivers/vdpa/vdpa.c | 4 +++- drivers/vdpa/vdpa_sim/vdpa_sim.c | 10 ++ drivers/vhost

[RFC PATCH 07/24] vdpa: add the missing comment for nvqs in struct vdpa_device

2020-09-23 Thread Jason Wang
Signed-off-by: Jason Wang --- include/linux/vdpa.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index eae0bfd87d91..df169c2f5c0f 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -42,6 +42,7 @@ struct vdpa_vq_state { * @config

[RFC PATCH 06/24] vhost-vdpa: switch to use vhost-vdpa specific IOTLB

2020-09-23 Thread Jason Wang
To ease the implementation of per group ASID support for vDPA device. This patch switches to use a vhost-vdpa specific IOTLB to avoid the unnecessary refactoring of the vhost core. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 14 -- 1 file changed, 8 insertions(+), 6

[RFC PATCH 08/24] vdpa: introduce virtqueue groups

2020-09-23 Thread Jason Wang
group ID for a specific virtqueue. All the vDPA device drivers were converted to simply support a single virtqueue group. Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 9 - drivers/vdpa/mlx5/net/mlx5_vnet.c | 8 +++- drivers/vdpa/vdpa.c | 4

[RFC PATCH 00/24] Control VQ support in vDPA

2020-09-23 Thread Jason Wang
setting MAC address via a emulated control virtqueue. Please refer patch 24 for more implementation details. Please review. Note that patch 1 and a equivalent of patch 2 have been posted in the list. Those two are requirement for this series to work, so I add them here. Thank Jason Wang (24

[RFC PATCH 04/24] virtio-vdpa: don't set callback if virtio doesn't need it

2020-09-23 Thread Jason Wang
There's no need for setting callbacks for the driver that doesn't care about that. Signed-off-by: Jason Wang --- drivers/virtio/virtio_vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c index 4a9ddb44b2a7

[RFC PATCH 02/24] vhost-vdpa: fix vqs leak in vhost_vdpa_open()

2020-09-23 Thread Jason Wang
We need to free vqs during the err path after it has been allocated since vhost won't do that for us. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 796fe979f997

[RFC PATCH 01/24] vhost-vdpa: fix backend feature ioctls

2020-09-23 Thread Jason Wang
held which will lead a deadlock This patch fixes the above issues. Cc: Eli Cohen Reported-by: Zhu Lingshan Fixes: 653055b9acd4 ("vhost-vdpa: support get/set backend features") Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 30 -- 1 file changed, 16 inserti

[RFC PATCH 05/24] vhost-vdpa: passing iotlb to IOMMU mapping helpers

2020-09-23 Thread Jason Wang
To prepare for the ASID support for vhost-vdpa, try to pass IOTLB object to dma helpers. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 40 ++-- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c

[RFC PATCH 03/24] vhost: move the backend feature bits to vhost_types.h

2020-09-23 Thread Jason Wang
We should store feature bits in vhost_types.h as what has been done for e.g VHOST_F_LOG_ALL. Signed-off-by: Jason Wang --- include/uapi/linux/vhost.h | 5 - include/uapi/linux/vhost_types.h | 5 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-17 Thread Jason Wang
On 2020/9/16 下午7:47, Kishon Vijay Abraham I wrote: Hi Jason, On 16/09/20 8:40 am, Jason Wang wrote: On 2020/9/15 下午11:47, Kishon Vijay Abraham I wrote: Hi Jason, On 15/09/20 1:48 pm, Jason Wang wrote: Hi Kishon: On 2020/9/14 下午3:23, Kishon Vijay Abraham I wrote: Then you need something

Re: [PATCH v2 -next] vdpa: mlx5: change Kconfig depends to fix build errors

2020-09-17 Thread Jason Wang
Dunlap Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: virtualizat...@lists.linux-foundation.org Cc: Saeed Mahameed Cc: Leon Romanovsky Cc: net...@vger.kernel.org --- v2: change from select to depends (Saeed) drivers/vdpa/Kconfig |2 +- 1 file changed, 1 insertion(+),

Re: [vhost next 0/2] mlx5 vdpa fix netdev status

2020-09-17 Thread Jason Wang
requirements. 2. Fix the failure to set the bit Eli Cohen (2): vdpa/mlx5: Make use of a specific 16 bit endianness API vdpa/mlx5: Fix failure to bring link up drivers/vdpa/mlx5/net/mlx5_vnet.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) Acked-by: Jason Wang

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-15 Thread Jason Wang
On 2020/9/15 下午11:47, Kishon Vijay Abraham I wrote: Hi Jason, On 15/09/20 1:48 pm, Jason Wang wrote: Hi Kishon: On 2020/9/14 下午3:23, Kishon Vijay Abraham I wrote: Then you need something that is functional equivalent to virtio PCI which is actually the concept of vDPA (e.g vDPA provides

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-15 Thread Jason Wang
Hi Kishon: On 2020/9/14 下午3:23, Kishon Vijay Abraham I wrote: Then you need something that is functional equivalent to virtio PCI which is actually the concept of vDPA (e.g vDPA provides alternatives if the queue_sel is hard in the EP implementation). Okay, I just tried to compare the 'struct

Re: [PATCH] vhost: reduce stack usage in log_used

2020-09-15 Thread Jason Wang
* Set to true when starting a modern virtio device. */ Acked-by: Jason Wang

Re: [PATCH v2] i2c: virtio: add a virtio i2c frontend driver

2020-09-13 Thread Jason Wang
On 2020/9/11 上午11:48, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message

Re: [PATCH] vhost: reduce stack usage in log_used

2020-09-13 Thread Jason Wang
- Original Message - > Fix the warning: [-Werror=-Wframe-larger-than=] > > drivers/vhost/vhost.c: In function log_used: > drivers/vhost/vhost.c:1906:1: > warning: the frame size of 1040 bytes is larger than 1024 bytes > > Signed-off-by: Li Wang > --- > drivers/vhost/vhost.c | 14

Re: [PATCH] intel-iommu: don't disable ATS for device without page aligned request

2020-09-13 Thread Jason Wang
On 2020/9/10 下午11:53, Raj, Ashok wrote: On Wed, Sep 09, 2020 at 10:17:35PM -0400, Jason Wang wrote: - Original Message - Hi Jason On Wed, Sep 09, 2020 at 04:34:32PM +0800, Jason Wang wrote: Commit 61363c1474b1 ("iommu/vt-d: Enable ATS only if the device uses page aligned ad

Re: [PATCH] vhost-vdpa: fix memory leak in error path

2020-09-09 Thread Jason Wang
, >mm->pinned_vm); } mmap_read_unlock(dev->mm); + +free_page: free_page((unsigned long)page_list); return ret; } Cc: sta...@vger.kernel.org Acked-by: Jason Wang

Re: [PATCH] intel-iommu: don't disable ATS for device without page aligned request

2020-09-09 Thread Jason Wang
- Original Message - > Hi Jason > > On Wed, Sep 09, 2020 at 04:34:32PM +0800, Jason Wang wrote: > > Commit 61363c1474b1 ("iommu/vt-d: Enable ATS only if the device uses > > page aligned address.") disables ATS for device that can do unaligned > > p

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-09 Thread Jason Wang
On 2020/9/3 下午1:34, Jie Deng wrote: --- a/drivers/i2c/busses/Makefile +++ b/drivers/i2c/busses/Makefile @@ -6,6 +6,9 @@ # ACPI drivers obj-$(CONFIG_I2C_SCMI)+= i2c-scmi.o +# VIRTIO I2C host controller driver +obj-$(CONFIG_I2C_VIRTIO) += i2c-virtio.o + # PC SMBus

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-09 Thread Jason Wang
On 2020/9/8 上午9:40, Jie Deng wrote: On 2020/9/7 13:40, Jason Wang wrote: +struct virtio_i2c_msg { +    struct virtio_i2c_hdr hdr; +    char *buf; +    u8 status; Any reason for separating status out of virtio_i2c_hdr? The status is not from i2c_msg. You meant ic2_hdr? You

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-09 Thread Jason Wang
On 2020/9/9 上午12:37, Cornelia Huck wrote: Then you need something that is functional equivalent to virtio PCI which is actually the concept of vDPA (e.g vDPA provides alternatives if the queue_sel is hard in the EP implementation). It seems I really need to read up on vDPA more... do you have

[PATCH] intel-iommu: don't disable ATS for device without page aligned request

2020-09-09 Thread Jason Wang
A victim is Qemu's virtio-pci which doesn't advertise the page aligned address. Fixing by disable PRI instead of ATS if device doesn't have page aligned request. Cc: sta...@vger.kernel.org Cc: Ashok Raj Cc: Jacob Pan Cc: Keith Busch Cc: Kuppuswamy Sathyanarayanan Signed-off-by: Jason Wang --

[PATCH] vhost-vdpa: fix backend feature ioctls

2020-09-07 Thread Jason Wang
held which will lead a deadlock This patch fixes the above issues. Cc: Eli Cohen Reported-by: Zhu Lingshan Fixes: 653055b9acd4 ("vhost-vdpa: support get/set backend features") Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 30 -- 1 file changed, 16 inserti

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-06 Thread Jason Wang
On 2020/9/4 下午9:21, Jie Deng wrote: On 2020/9/4 12:06, Jason Wang wrote: diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index 293e7a0..70c8e30 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -21,6 +21,17 @@ config I2C_ALI1535

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-03 Thread Jason Wang
On 2020/9/3 下午1:34, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-03 Thread Jason Wang
On 2020/9/3 下午3:19, Jie Deng wrote: On 2020/9/3 14:12, Jason Wang wrote: On 2020/9/3 下午1:34, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol

Re: [PATCH] i2c: virtio: add a virtio i2c frontend driver

2020-09-03 Thread Jason Wang
On 2020/9/3 下午1:34, Jie Deng wrote: Add an I2C bus driver for virtio para-virtualization. The controller can be emulated by the backend driver in any device model software by following the virtio protocol. This driver communicates with the backend driver through a virtio I2C message

Re: [RFC PATCH 00/22] Enhance VHOST to enable SoC-to-SoC communication

2020-09-01 Thread Jason Wang
On 2020/9/1 下午1:24, Kishon Vijay Abraham I wrote: Hi, On 28/08/20 4:04 pm, Cornelia Huck wrote: On Thu, 9 Jul 2020 14:26:53 +0800 Jason Wang wrote: [Let me note right at the beginning that I first noted this while listening to Kishon's talk at LPC on Wednesday. I might be very confused

Re: [PATCH net-next] vhost: fix typo in error message

2020-08-31 Thread Jason Wang
{ r = vhost_update_used_flags(vq); if (r) - vq_err(vq, "Failed to enable notification at %p: %d\n", + vq_err(vq, "Failed to disable notification at %p: %d\n", >used->flags, r); } } Acked-by: Jason Wang

Re: 答复: 答复: [PATCH V2] vfio dma_map/unmap: optimized for hugetlbfs pages

2020-08-31 Thread Jason Wang
On 2020/8/28 下午10:24, Peter Xu wrote: On Fri, Aug 28, 2020 at 09:23:08AM +, Maoming (maoming, Cloud Infrastructure Service Product Dept.) wrote: In hugetlb_put_pfn(), I delete unpin_user_pages_dirty_lock() and use some simple code to put hugetlb pages. Is this right? I think we should

Re: [PATCH V2 2/3] vhost: vdpa: report iova range

2020-08-31 Thread Jason Wang
On 2020/8/23 下午2:40, Eli Cohen wrote: +static void vhost_vdpa_set_iova_range(struct vhost_vdpa *v) +{ + struct vdpa_iova_range *range = >range; + struct iommu_domain_geometry geo; + struct vdpa_device *vdpa = v->vdpa; + const struct vdpa_config_ops *ops = vdpa->config;

[PATCH V2 3/3] vdpa_sim: implement get_iova_range()

2020-08-21 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index 62d640327145..89854e17c3c2 100644 --- a/drivers/vdpa/vdpa_sim/vdpa_sim.c +++ b/drivers/vdpa

[PATCH V2 1/3] vdpa: introduce config op to get valid iova range

2020-08-21 Thread Jason Wang
This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index eae0bfd87d91..30bc7a7223bb 100644

[PATCH V2 2/3] vhost: vdpa: report iova range

2020-08-21 Thread Jason Wang
DOMAIN_ATTR_GEOMETRY, otherwise [0, ULLONG_MAX] is assumed. For safety, this patch also rules out the map request which is not in the valid range. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 41 include/uapi/linux/vhost.h | 4 include/uapi/linux

[PATCH V2 0/3] vDPA: API for reporting IOVA range

2020-08-21 Thread Jason Wang
range in vhost-vDPA Thanks Jason Wang (3): vdpa: introduce config op to get valid iova range vhost: vdpa: report iova range vdpa_sim: implement get_iova_range() drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 ++ drivers/vhost/vdpa.c | 41 include

Re: [PATCH -next] vdpa: Remove duplicate include

2020-08-18 Thread Jason Wang
/drivers/vhost/vdpa.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "vhost.h" Acked-by: Jason Wang

Re: [PATCH -next] vdpa/mlx5: Remove duplicate include

2020-08-18 Thread Jason Wang
100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -8,7 +8,6 @@ #include #include #include -#include #include "mlx5_vnet.h" #include "mlx5_vdpa_ifc.h" #include "mlx5_vdpa.h" Acked-by: Jason Wang

Re: [PATCH RFC v2 00/18] Add VFIO mediated device support and DEV-MSI support for the idxd driver

2020-08-13 Thread Jason Wang
On 2020/8/13 下午1:26, Tian, Kevin wrote: From: Jason Wang Sent: Thursday, August 13, 2020 12:34 PM On 2020/8/12 下午12:05, Tian, Kevin wrote: The problem is that if we tie all controls via VFIO uAPI, the other subsystem like vDPA is likely to duplicate them. I wonder if there is a way

<    1   2   3   4   5   6   7   8   9   10   >