[PATCH 1/2] MAINTAINERS: add a dedicated entry for vDPA

2020-08-10 Thread Jason Wang
vDPA is an independent subsystem, so use a dedicated entry for that. Signed-off-by: Jason Wang --- MAINTAINERS | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 4e2698cc7e23..314398f0e276 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH 2/2] vDPA: add Eli Cohen as mellanox vDPA driver supporter

2020-08-10 Thread Jason Wang
Cc: Eli Cohen Signed-off-by: Jason Wang --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 314398f0e276..ed1851413fcc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -18186,6 +18186,12 @@ S: Maintained F: drivers/vdpa/ F

Re: [PATCH] vdpa_sim: init iommu lock

2020-08-10 Thread Jason Wang
ccess to iommu iotlb") Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index df3224b138ee..604d9d25ca47 100644 --- a/dr

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-10 Thread Jason Wang
. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:44AM +0800, Jason Wang wrote: This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/vdpa.h b

Re: [PATCH] vdpa/mlx5: Fix erroneous null pointer checks

2020-08-06 Thread Jason Wang
On 2020/8/7 上午11:37, Jason Wang wrote: On 2020/8/7 上午3:18, Alex Dewar wrote: In alloc_inout() in net/mlx5_vnet.c, there are a few places where memory is allocated to *in and *out, but only the values of in and out are null-checked (i.e. there is a missing dereference). Fix this. Addresses

Re: [PATCH][next] vdpa/mlx5: fix memory allocation failure checks

2020-08-06 Thread Jason Wang
;Null pointer dereference") Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Colin Ian King Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git

Re: [PATCH] vdpa/mlx5: Fix uninitialised variable in core/mr.c

2020-08-06 Thread Jason Wang
t;Uninitialized variables") Signed-off-by: Alex Dewar Acked-by: Jason Wang --- drivers/vdpa/mlx5/core/mr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c index f5dec0274133..ef1c550f8266 100644 --- a/drivers

Re: [PATCH 1/2] vdpa: ifcvf: return err when fail to request config irq

2020-08-06 Thread Jason Wang
On 2020/7/23 下午5:12, Jason Wang wrote: We ignore the err of requesting config interrupt, fix this. Fixes: e7991f376a4d ("ifcvf: implement config interrupt in IFCVF") Cc: Zhu Lingshan Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 4 1 file changed, 4

Re: [PATCH] vdpa/mlx5: Fix erroneous null pointer checks

2020-08-06 Thread Jason Wang
INULL)") Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Alex Dewar Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vn

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-06 Thread Jason Wang
On 2020/8/6 下午1:58, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 11:37:38AM +0800, Jason Wang wrote: On 2020/8/5 下午7:45, Michael S. Tsirkin wrote: #define virtio_cread(vdev, structname, member, ptr) \ do

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-06 Thread Jason Wang
On 2020/8/6 下午8:29, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 03:03:55PM +0300, Eli Cohen wrote: On Wed, Aug 05, 2020 at 08:51:56AM -0400, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:44AM +0800, Jason Wang wrote: This patch introduce a config op to get valid iova range

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-06 Thread Jason Wang
On 2020/8/6 下午8:10, Eli Cohen wrote: On Wed, Jun 17, 2020 at 06:29:44AM +0300, Jason Wang wrote: This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 14 ++ 1 file changed, 14 insertions(+) diff

Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy

2020-08-06 Thread Jason Wang
On 2020/8/6 下午6:00, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 03:27:38PM +0800, Jason Wang wrote: On 2020/8/6 下午1:53, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 11:23:05AM +0800, Jason Wang wrote: On 2020/8/5 下午7:40, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 02:14

Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy

2020-08-06 Thread Jason Wang
On 2020/8/6 下午1:53, Michael S. Tsirkin wrote: On Thu, Aug 06, 2020 at 11:23:05AM +0800, Jason Wang wrote: On 2020/8/5 下午7:40, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 02:14:07PM +0800, Jason Wang wrote: On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: Some legacy guests just assume

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Jason Wang
On 2020/8/5 下午7:45, Michael S. Tsirkin wrote: #define virtio_cread(vdev, structname, member, ptr) \ do {\ might_sleep(); \ /* Must

Re: [PATCH 4/4] vhost: vdpa: report iova range

2020-08-05 Thread Jason Wang
On 2020/8/5 下午8:58, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:47AM +0800, Jason Wang wrote: This patch introduces a new ioctl for vhost-vdpa device that can report the iova range by the device. For device that depends on platform IOMMU, we fetch the iova range via

Re: [PATCH 3/4] vdpa: get_iova_range() is mandatory for device specific DMA translation

2020-08-05 Thread Jason Wang
On 2020/8/5 下午8:55, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:46AM +0800, Jason Wang wrote: In order to let userspace work correctly, get_iova_range() is a must for the device that has its own DMA translation logic. I guess you mean for a device. However in absence of ths op

Re: [PATCH 1/4] vdpa: introduce config op to get valid iova range

2020-08-05 Thread Jason Wang
On 2020/8/5 下午8:51, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:29:44AM +0800, Jason Wang wrote: This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang --- include/linux/vdpa.h | 14 ++ 1 file changed, 14 insertions

Re: [PATCH v2 22/24] vdpa_sim: fix endian-ness of config space

2020-08-05 Thread Jason Wang
On 2020/8/5 下午8:06, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 02:21:07PM +0800, Jason Wang wrote: On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: VDPA sim accesses config space as native endian - this is wrong since it's a modern device and actually uses LE. It only supports modern

Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy

2020-08-05 Thread Jason Wang
On 2020/8/5 下午7:40, Michael S. Tsirkin wrote: On Wed, Aug 05, 2020 at 02:14:07PM +0800, Jason Wang wrote: On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: Some legacy guests just assume features are 0 after reset. We detect that config space is accessed before features are set and set features

Re: [PATCH V4 linux-next 00/12] VDPA support for Mellanox ConnectX devices

2020-08-05 Thread Jason Wang
Add support library for mlx5 VDPA implementation vdpa/mlx5: Add shared memory registration code vdpa/mlx5: Add VDPA driver for supported mlx5 devices Jason Wang (5): vhost-vdpa: refine ioctl pre-processing vhost: generialize backend features setting/getting vhost-vdpa: support get/

Re: [PATCH V4 linux-next 00/12] VDPA support for Mellanox ConnectX devices

2020-08-05 Thread Jason Wang
On 2020/8/5 上午12:20, Eli Cohen wrote: Hi Michael, please note that this series depends on mlx5 core device driver patches in mlx5-next branch in git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git. git pull git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git

Re: [PATCH V4 linux-next 12/12] vdpa/mlx5: Add VDPA driver for supported mlx5 devices

2020-08-05 Thread Jason Wang
the driver. Currently, only VFs are supported. In subsequent patches we will have devlink support to control which VF is used for VDPA and which function is used for regular networking. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen --- Acked-by: Jason Wang

Re: [PATCH V4 linux-next 08/12] vdpa: Modify get_vq_state() to return error code

2020-08-05 Thread Jason Wang
On 2020/8/5 上午12:20, Eli Cohen wrote: Modify get_vq_state() so it returns an error code. In case of hardware acceleration, the available index may be retrieved from the device, an operation that can possibly fail. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen Acked-by: Jason Wang

Re: [PATCH v2 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Jason Wang
On 2020/8/4 上午4:58, Michael S. Tsirkin wrote: Currently all config space fields are of the type __uXX. This confuses people and some drivers (notably vdpa) access them using CPU endian-ness - which only works well for legacy or LE platforms. Update virtio_cread/virtio_cwrite macros to allow

Re: [PATCH v2 22/24] vdpa_sim: fix endian-ness of config space

2020-08-05 Thread Jason Wang
On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: VDPA sim accesses config space as native endian - this is wrong since it's a modern device and actually uses LE. It only supports modern guests so we could punt and just force LE, but let's use the full virtio APIs since people tend to copy/paste

Re: [PATCH v2 19/24] vdpa: make sure set_features in invoked for legacy

2020-08-05 Thread Jason Wang
On 2020/8/4 上午5:00, Michael S. Tsirkin wrote: Some legacy guests just assume features are 0 after reset. We detect that config space is accessed before features are set and set features to 0 automatically. Note: some legacy guests might not even access config space, if this is reported in the

Re: [PATCH -next v3] virtio_ring: Avoid loop when vq is broken in virtqueue_poll

2020-08-03 Thread Jason Wang
ll_packed(_vq, last_used_idx) : virtqueue_poll_split(_vq, last_used_idx); Acked-by: Jason Wang

Re: [PATCH] virtio_pci_modern: Fix the comment of virtio_pci_find_capability()

2020-08-03 Thread Jason Wang
y: Yi Wang Acked-by: Jason Wang --- drivers/virtio/virtio_pci_modern.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c index db93cedd262f..9bdc6f68221f 100644 --- a/drivers/virtio/virtio_pci_modern.c +++ b/driv

[PATCH] vdpasim: protect concurrent access to iommu iotlb

2020-07-31 Thread Jason Wang
pasim: vDPA device simulator") Cc: sta...@vger.kernel.org Signed-off-by: Max Gurtovoy Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 31 +++ 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/dr

[PATCH net-next] tun: add missing rcu annotation in tun_set_ebpf()

2020-07-30 Thread Jason Wang
: warning: incorrect type in argument 2 (different address spaces) drivers/net/tun.c:3296:42:expected struct tun_prog **prog_p drivers/net/tun.c:3296:42:got struct tun_prog [noderef] __rcu ** Reported-by: Michael S. Tsirkin Signed-off-by: Jason Wang --- drivers/net/tun.c | 2 +- 1 file

Re: [PATCH] virtio_balloon: fix up endian-ness for free cmd id

2020-07-29 Thread Jason Wang
o_has_feature(vb->vdev, VIRTIO_F_VERSION_1)) + vb->cmd_id_received_cache = le32_to_cpu((__force __le32)vb->cmd_id_received_cache); + } return vb->cmd_id_received_cache; } Acked-by: Jason Wang

Re: [PATCH V3 vhost next 00/10] VDPA support for Mellanox ConnectX devices

2020-07-28 Thread Jason Wang
On 2020/7/28 下午2:40, Jason Wang wrote: On 2020/7/28 下午2:32, Eli Cohen wrote: On Tue, Jul 28, 2020 at 02:18:16PM +0800, Jason Wang wrote: On 2020/7/28 下午2:05, Eli Cohen wrote: Hi Michael, please note that this series depends on mlx5 core device driver patches in mlx5-next branch in git

Re: [PATCH V3 vhost next 00/10] VDPA support for Mellanox ConnectX devices

2020-07-28 Thread Jason Wang
On 2020/7/28 下午2:32, Eli Cohen wrote: On Tue, Jul 28, 2020 at 02:18:16PM +0800, Jason Wang wrote: On 2020/7/28 下午2:05, Eli Cohen wrote: Hi Michael, please note that this series depends on mlx5 core device driver patches in mlx5-next branch in git://git.kernel.org/pub/scm/linux/kernel/git

Re: [PATCH V3 vhost next 00/10] VDPA support for Mellanox ConnectX devices

2020-07-28 Thread Jason Wang
ror code vdpa/mlx5: Add hardware descriptive header file vdpa/mlx5: Add support library for mlx5 VDPA implementation vdpa/mlx5: Add shared memory registration code vdpa/mlx5: Add VDPA driver for supported mlx5 devices Jason Wang (2): vhost-vdpa: support batch updating vdpa_sim:

[PATCH 2/2] vdpa: ifcvf: free config irq in ifcvf_free_irq()

2020-07-23 Thread Jason Wang
IFCVF") Cc: Zhu Lingshan Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.h | 2 +- drivers/vdpa/ifcvf/ifcvf_main.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf/ifcvf_base.h index f4554412e607..29

[PATCH 1/2] vdpa: ifcvf: return err when fail to request config irq

2020-07-23 Thread Jason Wang
We ignore the err of requesting config interrupt, fix this. Fixes: e7991f376a4d ("ifcvf: implement config interrupt in IFCVF") Cc: Zhu Lingshan Signed-off-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/vdpa/ifcvf/if

Re: [PATCH V2 vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices

2020-07-20 Thread Jason Wang
ion 8. Avoid call put_device() since this is not a pci device driver. Looks good to me. Acked-by: Jason Wang

Re: [PATCH V2 vhost next 06/10] vdpa: Modify get_vq_state() to return error code

2020-07-20 Thread Jason Wang
On 2020/7/20 下午3:14, Eli Cohen wrote: Modify get_vq_state() so it returns an error code. In case of hardware acceleration, the available index may be retrieved from the device, an operation that can possibly fail. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen Acked-by: Jason Wang

Re: [PATCH V2 vhost next 05/10] vhost: Fix documentation

2020-07-20 Thread Jason Wang
On 2020/7/20 下午3:14, Eli Cohen wrote: Fix documentation to match actual function prototypes. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen Acked-by: Jason Wang --- drivers/vhost/iotlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vhost

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-20 Thread Jason Wang
On 2020/7/20 下午7:16, Eugenio Pérez wrote: On Mon, Jul 20, 2020 at 11:27 AM Michael S. Tsirkin wrote: On Thu, Jul 16, 2020 at 07:16:27PM +0200, Eugenio Perez Martin wrote: On Fri, Jul 10, 2020 at 7:58 AM Michael S. Tsirkin wrote: On Fri, Jul 10, 2020 at 07:39:26AM +0200, Eugenio Perez

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-20 Thread Jason Wang
On 2020/7/17 上午1:16, Eugenio Perez Martin wrote: On Fri, Jul 10, 2020 at 7:58 AM Michael S. Tsirkin wrote: On Fri, Jul 10, 2020 at 07:39:26AM +0200, Eugenio Perez Martin wrote: How about playing with the batch size? Make it a mod parameter instead of the hard coded 64, and measure for all

[PATCH] vhost: vdpa: remove per device feature whitelist

2020-07-20 Thread Jason Wang
to emulate a software control virtqueue. - we don't do it in virtio-vDPA driver So remove this limitation. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 37 - 1 file changed, 37 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index

Re: [PATCH vhost next 06/10] vdpa: Add means to communicate vq status on get_vq_state

2020-07-19 Thread Jason Wang
On 2020/7/16 下午6:25, Eli Cohen wrote: On Thu, Jul 16, 2020 at 05:35:18PM +0800, Jason Wang wrote: On 2020/7/16 下午4:21, Eli Cohen wrote: On Thu, Jul 16, 2020 at 04:11:00PM +0800, Jason Wang wrote: On 2020/7/16 下午3:23, Eli Cohen wrote: Currently, get_vq_state() is used only to pass

Re: [PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices

2020-07-19 Thread Jason Wang
On 2020/7/19 上午3:49, Eli Cohen wrote: On Fri, Jul 17, 2020 at 04:57:29PM +0800, Jason Wang wrote: Looks like checking intialized is enough. Will fix this. + +static void mlx5_vdpa_set_vq_ready(struct vdpa_device *vdev, u16 idx, bool ready) +{ + struct mlx5_vdpa_dev *mvdev = to_mvdev

Re: [PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices

2020-07-17 Thread Jason Wang
On 2020/7/16 下午7:54, Eli Cohen wrote: On Thu, Jul 16, 2020 at 05:14:32PM +0800, Jason Wang wrote: +static void suspend_vqs(struct mlx5_vdpa_net *ndev) +{ + int i; + + for (i = 0; i < MLX5_MAX_SUPPORTED_VQS; i++) + suspend_vq(ndev, >vqs[i]); In teardown_virt

Re: [PATCH vhost next 06/10] vdpa: Add means to communicate vq status on get_vq_state

2020-07-16 Thread Jason Wang
On 2020/7/16 下午4:21, Eli Cohen wrote: On Thu, Jul 16, 2020 at 04:11:00PM +0800, Jason Wang wrote: On 2020/7/16 下午3:23, Eli Cohen wrote: Currently, get_vq_state() is used only to pass the available index value of a vq. Extend the struct to return status on the VQ to the caller. For now

Re: [PATCH vhost next 09/10] vdpa/mlx5: Add shared memory registration code

2020-07-16 Thread Jason Wang
On 2020/7/16 下午4:28, Eli Cohen wrote: On Thu, Jul 16, 2020 at 04:13:21PM +0800, Jason Wang wrote: On 2020/7/16 下午3:23, Eli Cohen wrote: Add code to support registering guest's memory region for the device. It would be better to use "userspace" memory here since vhost-vDPA cou

Re: [PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices

2020-07-16 Thread Jason Wang
On 2020/7/16 下午3:23, Eli Cohen wrote: Add a front end VDPA driver that registers in the VDPA bus and provides networking to a guest. The VDPA driver creates the necessary resources on the VF it is driving such that data path will be offloaded. Notifications are being communicated through the

Re: [PATCH vhost next 09/10] vdpa/mlx5: Add shared memory registration code

2020-07-16 Thread Jason Wang
On 2020/7/16 下午3:23, Eli Cohen wrote: Add code to support registering guest's memory region for the device. It would be better to use "userspace" memory here since vhost-vDPA could be used by e.g dpdk application on the host in the future. Thanks

Re: [PATCH vhost next 06/10] vdpa: Add means to communicate vq status on get_vq_state

2020-07-16 Thread Jason Wang
On 2020/7/16 下午3:23, Eli Cohen wrote: Currently, get_vq_state() is used only to pass the available index value of a vq. Extend the struct to return status on the VQ to the caller. For now, define VQ_STATE_NOT_READY. In the future it will be extended to include other infomration. Modify

Re: [PATCH vhost next 05/10] vhost: Fix documentation

2020-07-16 Thread Jason Wang
On 2020/7/16 下午3:23, Eli Cohen wrote: Fix documentation to match actual function prototypes. Reviewed-by: Parav Pandit Signed-off-by: Eli Cohen Acked-by: Jason Wang --- drivers/vhost/iotlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vhost

Re: [PATCH RFC don't apply] vdpa_sim: endian-ness for config space

2020-07-16 Thread Jason Wang
On 2020/7/16 下午1:42, Michael S. Tsirkin wrote: On Wed, Jul 15, 2020 at 10:02:32PM +0800, Jason Wang wrote: On 2020/7/15 下午9:58, Michael S. Tsirkin wrote: VDPA sim stores config space as native endian, but that is wrong: modern guests expect LE. I coded up the following to fix it up

Re: [PATCH RFC don't apply] vdpa_sim: endian-ness for config space

2020-07-15 Thread Jason Wang
On 2020/7/15 下午9:58, Michael S. Tsirkin wrote: VDPA sim stores config space as native endian, but that is wrong: modern guests expect LE. I coded up the following to fix it up, but it is wrong too: vdpasim_create is called before guest features are known. So what should we do? New ioctl to

Re: [PATCH v7 2/2] s390: virtio: PV needs VIRTIO I/O device protection

2020-07-15 Thread Jason Wang
On 2020/7/15 下午5:50, Michael S. Tsirkin wrote: On Wed, Jul 15, 2020 at 10:31:09AM +0200, Pierre Morel wrote: If protected virtualization is active on s390, the virtio queues are not accessible to the host, unless VIRTIO_F_IOMMU_PLATFORM has been negotiated. Use the new

Re: [PATCH v7 0/2] s390: virtio: let arch validate VIRTIO features

2020-07-15 Thread Jason Wang
changed please can I get back your acked-by with these changes? Yes. Acked-by: Jason Wang Thanks 2) Rewording for warning messages Regards, Pierre Pierre Morel (2): virtio: let arch validate VIRTIO features s390: virtio: PV needs VIRTIO I/O device protection arch/s390/mm

Re: [PATCH] virtio_balloon: clear modern features under legacy

2020-07-12 Thread Jason Wang
-by: Jason Wang

Re: [PATCH] virtio_ring: sparse warning fixup

2020-07-12 Thread Jason Wang
); \ + mb(); \ + } \ +} while (0) \ struct virtio_device; struct virtqueue; Acked-by: Jason Wang

Re: [PATCH] vhost/scsi: fix up req type endian-ness

2020-07-12 Thread Jason Wang
virtio_scsi_ctrl_tmf_req); Acked-by: Jason Wang

Re: [PATCH] virtio_balloon: fix sparse warning

2020-07-12 Thread Jason Wang
_active, sizeof(vb->cmd_id_active)); err = virtqueue_add_outbuf(vq, , 1, >cmd_id_active, GFP_KERNEL); Acked-by: Jason Wang

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-10 Thread Jason Wang
On 2020/7/10 下午1:39, Eugenio Perez Martin wrote: It is allocated 1 thread in lcore 1 (F_THREAD=1) which belongs to the same NUMA as testpmd. Actually, it is the testpmd master core, so it should be a good idea to move it to another lcore of the same NUMA node. Is this enough for pktgen to

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-09 Thread Jason Wang
On 2020/7/10 上午1:37, Michael S. Tsirkin wrote: On Thu, Jul 09, 2020 at 06:46:13PM +0200, Eugenio Perez Martin wrote: On Wed, Jul 1, 2020 at 4:10 PM Jason Wang wrote: On 2020/7/1 下午9:04, Eugenio Perez Martin wrote: On Wed, Jul 1, 2020 at 2:40 PM Jason Wang wrote: On 2020/7/1 下午6:43

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

2020-07-09 Thread Jason Wang
On 2020/7/8 下午9:13, Kishon Vijay Abraham I wrote: Hi Jason, On 7/8/2020 4:52 PM, Jason Wang wrote: On 2020/7/7 下午10:45, Kishon Vijay Abraham I wrote: Hi Jason, On 7/7/2020 3:17 PM, Jason Wang wrote: On 2020/7/6 下午5:32, Kishon Vijay Abraham I wrote: Hi Jason, On 7/3/2020 12:46 PM, Jason

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

2020-07-08 Thread Jason Wang
On 2020/7/7 下午10:45, Kishon Vijay Abraham I wrote: Hi Jason, On 7/7/2020 3:17 PM, Jason Wang wrote: On 2020/7/6 下午5:32, Kishon Vijay Abraham I wrote: Hi Jason, On 7/3/2020 12:46 PM, Jason Wang wrote: On 2020/7/2 下午9:35, Kishon Vijay Abraham I wrote: Hi Jason, On 7/2/2020 3:40 PM, Jason

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

2020-07-07 Thread Jason Wang
On 2020/7/6 下午5:32, Kishon Vijay Abraham I wrote: Hi Jason, On 7/3/2020 12:46 PM, Jason Wang wrote: On 2020/7/2 下午9:35, Kishon Vijay Abraham I wrote: Hi Jason, On 7/2/2020 3:40 PM, Jason Wang wrote: On 2020/7/2 下午5:51, Michael S. Tsirkin wrote: On Thu, Jul 02, 2020 at 01:51:21PM +0530

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

2020-07-03 Thread Jason Wang
On 2020/7/2 下午9:35, Kishon Vijay Abraham I wrote: Hi Jason, On 7/2/2020 3:40 PM, Jason Wang wrote: On 2020/7/2 下午5:51, Michael S. Tsirkin wrote: On Thu, Jul 02, 2020 at 01:51:21PM +0530, Kishon Vijay Abraham I wrote: This series enhances Linux Vhost support to enable SoC-to-SoC

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

2020-07-02 Thread Jason Wang
On 2020/7/2 下午5:51, Michael S. Tsirkin wrote: On Thu, Jul 02, 2020 at 01:51:21PM +0530, Kishon Vijay Abraham I wrote: This series enhances Linux Vhost support to enable SoC-to-SoC communication over MMIO. This series enables rpmsg communication between two SoCs using both PCIe RC<->EP and

Re: [PATCH 2/2] virtio-mmio: Reject invalid IRQ 0 command line argument

2020-07-01 Thread Jason Wang
tform: Clarify that IRQ 0 is invalid") Signed-off-by: Bjorn Helgaas Cc: Michael S. Tsirkin Cc: Jason Wang Cc: virtualizat...@lists.linux-foundation.org --- drivers/virtio/virtio_mmio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-01 Thread Jason Wang
On 2020/7/1 下午9:04, Eugenio Perez Martin wrote: On Wed, Jul 1, 2020 at 2:40 PM Jason Wang wrote: On 2020/7/1 下午6:43, Eugenio Perez Martin wrote: On Tue, Jun 23, 2020 at 6:15 PM Eugenio Perez Martin wrote: On Mon, Jun 22, 2020 at 6:29 PM Michael S. Tsirkin wrote: On Mon, Jun 22, 2020

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-07-01 Thread Jason Wang
On 2020/7/1 下午6:43, Eugenio Perez Martin wrote: On Tue, Jun 23, 2020 at 6:15 PM Eugenio Perez Martin wrote: On Mon, Jun 22, 2020 at 6:29 PM Michael S. Tsirkin wrote: On Mon, Jun 22, 2020 at 06:11:21PM +0200, Eugenio Perez Martin wrote: On Mon, Jun 22, 2020 at 5:55 PM Michael S. Tsirkin

[PATCH 5/5] vdpasim: support batch updating

2020-07-01 Thread Jason Wang
. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 40 +--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index c7334cc65bb2..a7a0962ed8a8 100644 --- a/drivers/vdpa

[PATCH 4/5] vhost-vdpa: support IOTLB batching hints

2020-07-01 Thread Jason Wang
require set_map(), no behavior changes. This capability is advertised via VHOST_BACKEND_F_IOTLB_BATCH capability. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 30 +++--- include/uapi/linux/vhost.h | 2 ++ include/uapi/linux/vhost_types.h | 11

[PATCH 3/5] vhost-vdpa: support get/set backend features

2020-07-01 Thread Jason Wang
This patch makes userspace can get and set backend features to vhost-vdpa. Signed-off-by: Cindy Lu Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index db4c9cb44c61

[PATCH 2/5] vhost: generialize backend features setting/getting

2020-07-01 Thread Jason Wang
Move the backend features setting/getting from net.c to vhost.c to be reused by vhost-vdpa. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 18 ++ drivers/vhost/vhost.c | 15 +++ drivers/vhost/vhost.h | 2 ++ 3 files changed, 19 insertions(+), 16 deletions

[PATCH 1/5] vhost-vdpa: refine ioctl pre-processing

2020-07-01 Thread Jason Wang
Switch to use 'switch' to make the codes more easier to be extended. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 77a0c9fb6cc3..db4c9cb44c61 100644 --- a/drivers

[PATCH 0/5]

2020-07-01 Thread Jason Wang
to get best performance. Note, this only impacts the devices that want its own DMA translation (less times of set_map() call). For other type of devices, there's no changes in the behaviour. Changes from RFCV1: - tweak the comments per Michael's request Jason Wang (5): vhost-vdpa: refi

Re: [PATCH] vhost: Fix documentation

2020-06-29 Thread Jason Wang
On 2020/6/30 下午1:29, Eli Cohen wrote: Fix documentation to match actual function prototypes "end" used instead of "last". Fix that. Signed-off-by: Eli Cohen --- Acked-by: Jason Wang Thanks drivers/vhost/iotlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

Re: [PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints

2020-06-29 Thread Jason Wang
On 2020/6/29 下午11:49, Michael S. Tsirkin wrote: On Mon, Jun 29, 2020 at 05:26:03PM +0800, Jason Wang wrote: On 2020/6/28 下午5:58, Michael S. Tsirkin wrote: On Thu, Jun 18, 2020 at 01:56:25PM +0800, Jason Wang wrote: This patches extend the vhost IOTLB API to accept batch updating hints form

Re: [PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints

2020-06-29 Thread Jason Wang
On 2020/6/28 下午5:58, Michael S. Tsirkin wrote: On Thu, Jun 18, 2020 at 01:56:25PM +0800, Jason Wang wrote: This patches extend the vhost IOTLB API to accept batch updating hints form userspace. When userspace wants update the device IOTLB in a batch, it may do: 1) Write vhost_iotlb_msg

Re: [PATCH v2 2/2] virtio: virtio_has_iommu_quirk -> virtio_has_dma_quirk

2020-06-28 Thread Jason Wang
k * @vdev: the device */ -static inline bool virtio_has_iommu_quirk(const struct virtio_device *vdev) +static inline bool virtio_has_dma_quirk(const struct virtio_device *vdev) { /* * Note the reverse polarity of the quirk feature (compared to most Acked-by: Jason Wang

Re: [PATCH] virtio: VIRTIO_F_IOMMU_PLATFORM -> VIRTIO_F_ACCESS_PLATFORM

2020-06-28 Thread Jason Wang
* other features), this is for compatibility with legacy systems. */ - return !virtio_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); + return !virtio_has_feature(vdev, VIRTIO_F_ACCESS_PLATFORM); } static inline bool virtio_is_little_endian(struct virtio_device *vdev) Acked-by: Jason Wang

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-06-23 Thread Jason Wang
On 2020/6/23 下午3:00, Eugenio Perez Martin wrote: On Tue, Jun 23, 2020 at 4:51 AM Jason Wang wrote: On 2020/6/23 上午12:00, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:19:26AM +0800, Jason Wang wrote: On 2020/6/11 下午7:34, Michael S. Tsirkin wrote: static void

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-06-22 Thread Jason Wang
On 2020/6/23 上午12:00, Michael S. Tsirkin wrote: On Wed, Jun 17, 2020 at 11:19:26AM +0800, Jason Wang wrote: On 2020/6/11 下午7:34, Michael S. Tsirkin wrote: static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) { kfree(vq->descs); @@ -394,6 +400,9 @@ static l

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-06-22 Thread Jason Wang
On 2020/6/20 上午2:07, Eugenio Perez Martin wrote: On Mon, Jun 15, 2020 at 2:28 PM Eugenio Perez Martin wrote: On Thu, Jun 11, 2020 at 5:22 PM Konrad Rzeszutek Wilk wrote: On Thu, Jun 11, 2020 at 07:34:19AM -0400, Michael S. Tsirkin wrote: As testing shows no performance change, switch to

Re: [PATCH] virtio-mem: Fix build error due to improper use 'select'

2020-06-19 Thread Jason Wang
r provides access to virtio-mem paravirtualized memory devices, allowing to hotplug and hotunplug memory. Acked-by: Jason Wang

[PATCH RFC 5/5] vdpasim: support batch updating

2020-06-17 Thread Jason Wang
. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 40 +--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c index c7334cc65bb2..a7a0962ed8a8 100644 --- a/drivers/vdpa

[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints

2020-06-17 Thread Jason Wang
require set_map(), no behavior changes. This capability is advertised via VHOST_BACKEND_F_IOTLB_BATCH capability. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 30 +++--- include/uapi/linux/vhost.h | 2 ++ include/uapi/linux/vhost_types.h | 7

[PATCH RFC 3/5] vhost-vdpa: support get/set backend features

2020-06-17 Thread Jason Wang
This patch makes userspace can get and set backend features to vhost-vdpa. Signed-off-by: Cindy Lu Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index db4c9cb44c61

[PATCH RFC 2/5] vhost: generialize backend features setting/getting

2020-06-17 Thread Jason Wang
Move the backend features setting/getting from net.c to vhost.c to be reused by vhost-vdpa. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 18 ++ drivers/vhost/vhost.c | 15 +++ drivers/vhost/vhost.h | 2 ++ 3 files changed, 19 insertions(+), 16 deletions

[PATCH RFC 1/5] vhost-vdpa: refine ioctl pre-processing

2020-06-17 Thread Jason Wang
Switch to use 'switch' to make the codes more easier to be extended. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 77a0c9fb6cc3..db4c9cb44c61 100644 --- a/drivers

[PATCH RFC 0/5] support batched IOTLB updating in vhost-vdpa

2020-06-17 Thread Jason Wang
to get best performance. Note, this only impact the devices that want its own DMA translation. For other type of device, no changes in behaviour. Please reivew. Jason Wang (5): vhost-vdpa: refine ioctl pre-processing vhost: generialize backend features setting/getting vhost-vdpa: sup

[PATCH 3/4] vdpa: get_iova_range() is mandatory for device specific DMA translation

2020-06-16 Thread Jason Wang
In order to let userspace work correctly, get_iova_range() is a must for the device that has its own DMA translation logic. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index de211ef3738c

[PATCH 4/4] vhost: vdpa: report iova range

2020-06-16 Thread Jason Wang
. Signed-off-by: Jason Wang --- drivers/vhost/vdpa.c | 27 +++ include/uapi/linux/vhost.h | 4 include/uapi/linux/vhost_types.h | 5 + 3 files changed, 36 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 77a0c9fb6cc3

[PATCH 2/4] vdpa_sim: implement get_iova_range bus operation

2020-06-16 Thread Jason Wang
This patch implements get_iova_range method for vdpa_sim. Since vdpa_sim is a software device, simply advertise a [0ULL, ~0ULL] range. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c

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

2020-06-16 Thread Jason Wang
is enabled, determine a valid guest address width Please review. Thanks Jason Wang (4): vdpa: introduce config op to get valid iova range vdpa_sim: implement get_iova_range bus operation vdpa: get_iova_range() is mandatory for device specific DMA translation vhost: vdpa: report iova

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

2020-06-16 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 | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 239db794357c..b7633ed2500c 100644 --- a/include

Re: [PATCH RFC v8 02/11] vhost: use batched get_vq_desc version

2020-06-16 Thread Jason Wang
On 2020/6/11 下午7:34, Michael S. Tsirkin wrote: static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) { kfree(vq->descs); @@ -394,6 +400,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) for (i = 0; i < dev->nvqs; ++i) { vq = dev->vqs[i];

Re: [PATCH v2 1/1] s390: virtio: let arch accept devices without IOMMU feature

2020-06-16 Thread Jason Wang
VIRTIO_F_IOMMU_PLATFORM. Signed-off-by: Pierre Morel Acked-by: Jason Wang --- arch/s390/mm/init.c | 6 ++ drivers/virtio/virtio.c | 9 + include/linux/virtio.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 87b2d024e75a

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-14 Thread Jason Wang
On 2020/6/12 下午7:38, Pierre Morel wrote: On 2020-06-12 11:21, Pierre Morel wrote: On 2020-06-11 05:10, Jason Wang wrote: On 2020/6/10 下午9:11, Pierre Morel wrote: Protected Virtualisation protects the memory of the guest and do not allow a the host to access all of its memory. Let's

Re: [PATCH RFC v6 02/11] vhost: use batched get_vq_desc version

2020-06-14 Thread Jason Wang
On 2020/6/11 下午5:06, Michael S. Tsirkin wrote: On Thu, Jun 11, 2020 at 11:02:57AM +0800, Jason Wang wrote: On 2020/6/10 下午7:05, Michael S. Tsirkin wrote: +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ void

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