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 V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-08-05 Thread Jason Wang
On 2020/7/31 下午2:55, Zhu Lingshan wrote: +static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid) +{ + struct vhost_virtqueue *vq = >vqs[qid]; + const struct vdpa_config_ops *ops = v->vdpa->config; + struct vdpa_device *vdpa = v->vdpa; + int ret, irq; + +

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 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 V4 linux-next 12/12] vdpa/mlx5: Add VDPA driver for supported mlx5 devices

2020-08-05 Thread Jason Wang
On 2020/8/5 上午12:20, 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 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 V4 linux-next 00/12] VDPA support for Mellanox ConnectX devices

2020-08-05 Thread Jason Wang
On 2020/8/5 下午1:01, Eli Cohen wrote: On Tue, Aug 04, 2020 at 05:29:09PM -0400, Michael S. Tsirkin wrote: On Tue, Aug 04, 2020 at 07:20:36PM +0300, Eli Cohen wrote: Hi Michael, please note that this series depends on mlx5 core device driver patches in mlx5-next branch in

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 4/4] vhost: vdpa: report iova range

2020-08-05 Thread Michael S. Tsirkin
On Thu, Aug 06, 2020 at 11:29:16AM +0800, Jason Wang wrote: > > 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

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 1/4] vdpa: introduce config op to get valid iova range

2020-08-05 Thread Michael S. Tsirkin
On Thu, Aug 06, 2020 at 11:25:11AM +0800, Jason Wang wrote: > > 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:

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

2020-08-05 Thread Michael S. Tsirkin
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 features are 0 after reset. > >

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, I

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

[vhost:vhost 32/65] drivers/virtio/virtio_input.c:247:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16

2020-08-05 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: 1a86b377aa2147a7c866b03142e848c18e5f3cb8 commit: b025584098e621d88894d28e80af686958e273af [32/65] virtio_input: convert to LE accessors config: powerpc-randconfig-r031-20200805 (attached as .config) compiler

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 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 03/24] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Michael S. Tsirkin
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 v2 17/24] virtio_config: disallow native type fields

2020-08-05 Thread Michael S. Tsirkin
On Tue, Aug 04, 2020 at 04:50:39PM +0200, Cornelia Huck wrote: > On Mon, 3 Aug 2020 16:59:57 -0400 > "Michael S. Tsirkin" wrote: > > > Transitional devices should all use __virtioXX types. > > I think they should use __leXX for those fields that are not present > with legacy devices? Will

Re: [PATCH v2 18/24] mlxbf-tmfifo: sparse tags for config access

2020-08-05 Thread Michael S. Tsirkin
On Tue, Aug 04, 2020 at 04:56:34PM +0200, Cornelia Huck wrote: > On Mon, 3 Aug 2020 17:00:01 -0400 > "Michael S. Tsirkin" wrote: > > > mlxbf-tmfifo accesses config space using native types - > > which works for it since the legacy virtio native types. > > > > This will break if it ever needs to

Re: [PATCH v2 14/24] virtio_net: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
On Tue, Aug 04, 2020 at 04:44:44PM +0200, Cornelia Huck wrote: > On Mon, 3 Aug 2020 16:59:37 -0400 > "Michael S. Tsirkin" wrote: > > > Tag config space fields as having virtio endian-ness. > > > > Signed-off-by: Michael S. Tsirkin > > --- > > include/uapi/linux/virtio_net.h | 8 > >

[PATCH] virtio_net: use LE accessors for speed/duplex

2020-08-05 Thread Michael S. Tsirkin
Speed and duplex config fields depend on VIRTIO_NET_F_SPEED_DUPLEX which being 63>31 depends on VIRTIO_F_VERSION_1. Accordingly, use LE accessors for these fields. Reported-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin --- drivers/net/virtio_net.c| 9 +

Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers

2020-08-05 Thread Jürgen Groß
On 05.08.20 16:12, pet...@infradead.org wrote: On Wed, Aug 05, 2020 at 03:59:40PM +0200, Marco Elver wrote: On Wed, Aug 05, 2020 at 03:42PM +0200, pet...@infradead.org wrote: Shouldn't we __always_inline those? They're going to be really small. I can send a v2, and you can choose. For

Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers

2020-08-05 Thread peterz
On Wed, Aug 05, 2020 at 04:12:37PM +0200, pet...@infradead.org wrote: > On Wed, Aug 05, 2020 at 03:59:40PM +0200, Marco Elver wrote: > > On Wed, Aug 05, 2020 at 03:42PM +0200, pet...@infradead.org wrote: > > > > Shouldn't we __always_inline those? They're going to be really small. > > > > I can

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

2020-08-05 Thread Michael S. Tsirkin
On Wed, Aug 05, 2020 at 04:01:58PM +0300, Eli Cohen wrote: > On Wed, Aug 05, 2020 at 08:48:52AM -0400, Michael S. Tsirkin wrote: > > > > > > Did you merge this?: > > > git pull git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git > > > mlx5-next > > > > > > I can only merge this

[PATCH v3 08/38] virtio_crypto: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Since crypto is a modern-only device, tag config space fields as having little endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_crypto.h | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git

[PATCH v3 21/38] virtio_vdpa: legacy features handling

2020-08-05 Thread Michael S. Tsirkin
We normally expect vdpa to use the modern interface. However for consistency, let's use same APIs as vhost for legacy guests. Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_vdpa.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git

[PATCH v3 28/38] virtio_config: add virtio_cread_le_feature

2020-08-05 Thread Michael S. Tsirkin
Mirrors virtio_cread_feature but for LE fields. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 5b5196fec899..cc7a2b1fd7b2 100644 ---

[PATCH v3 24/38] virtio_config: rewrite using _Generic

2020-08-05 Thread Michael S. Tsirkin
Min compiler version has been raised, so that's ok now. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 163 -- 1 file changed, 77 insertions(+), 86 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h

[PATCH v3 10/38] virtio_gpu: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Since gpu is a modern-only device, tag config space fields as having little endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_gpu.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/virtio_gpu.h

[PATCH v3 09/38] virtio_fs: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Since fs is a modern-only device, tag config space fields as having little endian-ness. Signed-off-by: Michael S. Tsirkin Acked-by: Vivek Goyal Acked-by: Vivek Goyal Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v3 13/38] virtio_mem: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Since this is a modern-only device, tag config space fields as having little endian-ness. TODO: check other uses of __virtioXX types in this header, should probably be __leXX. Signed-off-by: Michael S. Tsirkin Acked-by: David Hildenbrand Reviewed-by: Cornelia Huck ---

[PATCH v3 19/38] vdpa: make sure set_features is invoked for legacy

2020-08-05 Thread Michael S. Tsirkin
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 field we might need to catch a kick to handle

[PATCH v3 29/38] virtio_balloon: use LE config space accesses

2020-08-05 Thread Michael S. Tsirkin
Balloon is LE, it's cleaner to access it as such directly. Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_balloon.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c

[PATCH v3 25/38] virtio_config: disallow native type fields (again)

2020-08-05 Thread Michael S. Tsirkin
_Generic version allowed __uXX types but that is no longer necessary: Transitional devices should all use __virtioXX types (and __leXX for fields not present in the legacy devices). Modern ones should use __leXX. _uXX type would be a bug. Let's prevent that. Signed-off-by: Michael S. Tsirkin

[PATCH v3 20/38] vhost/vdpa: switch to new helpers

2020-08-05 Thread Michael S. Tsirkin
For new helpers handling legacy features to be effective, vhost needs to invoke them. Tie them in. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vdpa.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index

[PATCH v3 17/38] virtio_config: disallow native type fields

2020-08-05 Thread Michael S. Tsirkin
Transitional devices should all use __virtioXX types (and __leXX for fields not present in legacy devices). Modern ones should use __leXX. _uXX type would be a bug. Let's prevent that. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 5 ++--- 1 file changed, 2

[PATCH v3 36/38] virtio-iommu: convert to LE accessors

2020-08-05 Thread Michael S. Tsirkin
Virtio iommu is modern-only. Use LE accessors for config space. Signed-off-by: Michael S. Tsirkin --- drivers/iommu/virtio-iommu.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c

[PATCH v3 37/38] virtio_config: drop LE option from config space

2020-08-05 Thread Michael S. Tsirkin
All drivers now use virtio_cread/write_le for LE config space fields. Drop LE option from virtio_cread/write, only leaving the option to access transitional fields. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 28 ++-- 1 file changed, 2

[PATCH v3 32/38] virtio_crypto: convert to LE accessors

2020-08-05 Thread Michael S. Tsirkin
Virtio crypto is modern-only. Use LE accessors for config space. Signed-off-by: Michael S. Tsirkin --- drivers/crypto/virtio/virtio_crypto_core.c | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/crypto/virtio/virtio_crypto_core.c

[PATCH v3 16/38] virtio_scsi: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Tag config space fields as having virtio endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck --- drivers/scsi/virtio_scsi.c | 4 ++-- include/uapi/linux/virtio_scsi.h | 20 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git

[PATCH v3 12/38] virtio_iommu: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Since this is a modern-only device, tag config space fields as having little endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Jean-Philippe Brucker Reviewed-by: Jean-Philippe Brucker Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_iommu.h | 12 ++-- 1 file

[PATCH v3 23/38] virtio_config: cread/write cleanup

2020-08-05 Thread Michael S. Tsirkin
Use vars of the correct type instead of casting. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index

[PATCH v3 14/38] virtio_net: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Tag config space fields as having virtio endian-ness. Signed-off-by: Michael S. Tsirkin --- include/uapi/linux/virtio_net.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index

[PATCH v3 06/38] virtio_blk: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Tag config space fields as having virtio endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_blk.h | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/include/uapi/linux/virtio_blk.h

[PATCH v3 07/38] virtio_console: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Tag config space fields as having virtio endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_console.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/virtio_console.h

[PATCH v3 22/38] vdpa_sim: fix endian-ness of config space

2020-08-05 Thread Michael S. Tsirkin
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 code, and this is not data path anyway.

[PATCH v3 26/38] virtio_config: LE config space accessors

2020-08-05 Thread Michael S. Tsirkin
To be used by modern code, as well as to handle LE only fields such as balloon. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_config.h | 65 +++ 1 file changed, 65 insertions(+) diff --git a/include/linux/virtio_config.h

[PATCH v3 01/38] virtio_balloon: fix sparse warning

2020-08-05 Thread Michael S. Tsirkin
balloon uses virtio32_to_cpu instead of cpu_to_virtio32 to convert a native endian number to virtio. No practical difference but makes sparse warn. Fix it up. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck Acked-by: David Hildenbrand Reviewed-by: Cornelia Huck ---

[PATCH v3 03/38] virtio: allow __virtioXX, __leXX in config space

2020-08-05 Thread Michael S. Tsirkin
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 __virtioXX and __leXX field types. Follow-up

[PATCH v3 04/38] virtio_9p: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Tag config space fields as having virtio endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_9p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/virtio_9p.h b/include/uapi/linux/virtio_9p.h index

[PATCH v3 05/38] virtio_balloon: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Tag config space fields as having little endian-ness. Note that balloon is special: LE even when using the legacy interface. Signed-off-by: Michael S. Tsirkin Acked-by: David Hildenbrand Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_balloon.h | 10 +- 1 file changed, 5

[PATCH v3 11/38] virtio_input: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Since this is a modern-only device, tag config space fields as having little endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Gerd Hoffmann Reviewed-by: Gerd Hoffmann Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_input.h | 18 +- 1 file changed, 9

[PATCH v3 15/38] virtio_pmem: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Since this is a modern-only device, tag config space fields as having little endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck --- include/uapi/linux/virtio_pmem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/virtio_pmem.h

[PATCH v3 02/38] virtio_ring: sparse warning fixup

2020-08-05 Thread Michael S. Tsirkin
virtio_store_mb was built with split ring in mind so it accepts __virtio16 arguments. Packed ring uses __le16 values, so sparse complains. It's just a store with some barriers so let's convert it to a macro, we don't loose too much type safety by doing that. Signed-off-by: Michael S. Tsirkin

Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers

2020-08-05 Thread peterz
On Wed, Aug 05, 2020 at 03:26:29PM +0200, Marco Elver wrote: > Add missing noinstr to arch_local*() helpers, as they may be called from > noinstr code. > > On a KCSAN config with CONFIG_PARAVIRT=y, syzbot stumbled across corrupt Cute, so I've been working on adding objtool support for this a

[PATCH v3 34/38] drm/virtio: convert to LE accessors

2020-08-05 Thread Michael S. Tsirkin
Virtgpu is modern-only. Use LE accessors for config space. Signed-off-by: Michael S. Tsirkin --- drivers/gpu/drm/virtio/virtgpu_kms.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c

[PATCH v3 27/38] virtio_caif: correct tags for config space fields

2020-08-05 Thread Michael S. Tsirkin
Tag config space fields as having virtio endian-ness. Signed-off-by: Michael S. Tsirkin --- include/linux/virtio_caif.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/virtio_caif.h b/include/linux/virtio_caif.h index 5d2d3124ca3d..ea722479510c 100644 ---

[PATCH v3 30/38] virtio_input: convert to LE accessors

2020-08-05 Thread Michael S. Tsirkin
Virtio input is modern-only. Use LE accessors for config space. Signed-off-by: Michael S. Tsirkin --- drivers/virtio/virtio_input.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/virtio/virtio_input.c

[PATCH v3 38/38] virtio_net: use LE accessors for speed/duplex

2020-08-05 Thread Michael S. Tsirkin
Speed and duplex config fields depend on VIRTIO_NET_F_SPEED_DUPLEX which being 63>31 depends on VIRTIO_F_VERSION_1. Accordingly, use LE accessors for these fields. Reported-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin --- drivers/net/virtio_net.c| 9 +

[PATCH v3 31/38] virtio_fs: convert to LE accessors

2020-08-05 Thread Michael S. Tsirkin
Virtio fs is modern-only. Use LE accessors for config space. Signed-off-by: Michael S. Tsirkin --- fs/fuse/virtio_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 4c4ef5d69298..104f35de5270 100644 ---

Re: [PATCH v3 38/38] virtio_net: use LE accessors for speed/duplex

2020-08-05 Thread Cornelia Huck
On Wed, 5 Aug 2020 09:45:00 -0400 "Michael S. Tsirkin" wrote: > Speed and duplex config fields depend on VIRTIO_NET_F_SPEED_DUPLEX > which being 63>31 depends on VIRTIO_F_VERSION_1. > > Accordingly, use LE accessors for these fields. > > Reported-by: Cornelia Huck > Signed-off-by: Michael S.

Re: [PATCH] x86/paravirt: Add missing noinstr to arch_local*() helpers

2020-08-05 Thread peterz
On Wed, Aug 05, 2020 at 03:59:40PM +0200, Marco Elver wrote: > On Wed, Aug 05, 2020 at 03:42PM +0200, pet...@infradead.org wrote: > > Shouldn't we __always_inline those? They're going to be really small. > > I can send a v2, and you can choose. For reference, though: > > 86271ee0

Re: [PATCH v3 06/38] virtio_blk: correct tags for config space fields

2020-08-05 Thread Stefano Garzarella
On Wed, Aug 05, 2020 at 09:43:30AM -0400, Michael S. Tsirkin wrote: > Tag config space fields as having virtio endian-ness. > > Signed-off-by: Michael S. Tsirkin > Reviewed-by: Cornelia Huck > --- > include/uapi/linux/virtio_blk.h | 26 +- > 1 file changed, 13

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

2020-08-05 Thread Michael S. Tsirkin
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 guests so we could punt and > >

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

2020-08-05 Thread Michael S. Tsirkin
On Tue, Aug 04, 2020 at 07:20:36PM +0300, 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

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

2020-08-05 Thread Michael S. Tsirkin
On Wed, Aug 05, 2020 at 03:40:54PM +0300, Eli Cohen wrote: > On Wed, Aug 05, 2020 at 08:00:55AM -0400, Michael S. Tsirkin wrote: > > On Tue, Aug 04, 2020 at 07:20:36PM +0300, Eli Cohen wrote: > > > Hi Michael, > > > please note that this series depends on mlx5 core device driver patches > > > in

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

2020-08-05 Thread Michael S. Tsirkin
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 DOMAIN_ATTR_GEOMETRY. For > devices that has its own DMA

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

2020-08-05 Thread Michael S. Tsirkin
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 guests so we could punt and > >

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

2020-08-05 Thread Michael S. Tsirkin
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 to 0 automatically. > > Note: some

Re: [PATCH 2/2] vhost_vdpa: unified set_vq_irq() and update_vq_irq()

2020-08-05 Thread Michael S. Tsirkin
On Wed, Aug 05, 2020 at 07:38:32PM +0800, Zhu Lingshan wrote: > This commit merge vhost_vdpa_update_vq_irq() logics into > vhost_vdpa_setup_vq_irq(), so that code are unified. > > In vhost_vdpa_setup_vq_irq(), added checks for the existence > for get_vq_irq(). > > Signed-off-by: Zhu Lingshan

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

2020-08-05 Thread Michael S. Tsirkin
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, I don't see what is wrong with just assuming

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

2020-08-05 Thread Michael S. Tsirkin
On Wed, Aug 05, 2020 at 02:28:23PM +0800, Jason Wang wrote: > > 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

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

2020-08-05 Thread Michael S. Tsirkin
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

Re: [PATCH v4 0/4] Add a vhost RPMsg API

2020-08-05 Thread Michael S. Tsirkin
On Tue, Aug 04, 2020 at 01:30:32PM -0600, Mathieu Poirier wrote: > On Tue, 4 Aug 2020 at 08:07, Michael S. Tsirkin wrote: > > > > On Tue, Aug 04, 2020 at 07:37:49AM -0600, Mathieu Poirier wrote: > > > On Mon, 3 Aug 2020 at 14:47, Michael S. Tsirkin wrote: > > > > > > > > On Mon, Aug 03, 2020 at

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

2020-08-05 Thread Saeed Mahameed
On Wed, 2020-08-05 at 09:12 -0400, Michael S. Tsirkin wrote: > On Wed, Aug 05, 2020 at 04:01:58PM +0300, Eli Cohen wrote: > > On Wed, Aug 05, 2020 at 08:48:52AM -0400, Michael S. Tsirkin wrote: > > > > Did you merge this?: > > > > git pull > > > >

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

2020-08-05 Thread Jason Gunthorpe
On Wed, Aug 05, 2020 at 07:01:52PM +, Saeed Mahameed wrote: > On Wed, 2020-08-05 at 09:12 -0400, Michael S. Tsirkin wrote: > > On Wed, Aug 05, 2020 at 04:01:58PM +0300, Eli Cohen wrote: > > > On Wed, Aug 05, 2020 at 08:48:52AM -0400, Michael S. Tsirkin wrote: > > > > > Did you merge this?: > >

[vhost:vhost 32/52] include/linux/typecheck.h:12:18: warning: comparison of distinct pointer types lacks a cast

2020-08-05 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: 4c05433bc6fb4ae172270f0279be8ba89a3da64f commit: b025584098e621d88894d28e80af686958e273af [32/52] virtio_input: convert to LE accessors config: parisc-randconfig-r003-20200805 (attached as .config) compiler: hppa

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

2020-08-05 Thread Michael S. Tsirkin
On Wed, Aug 05, 2020 at 04:46:46PM -0300, Jason Gunthorpe wrote: > On Wed, Aug 05, 2020 at 07:01:52PM +, Saeed Mahameed wrote: > > On Wed, 2020-08-05 at 09:12 -0400, Michael S. Tsirkin wrote: > > > On Wed, Aug 05, 2020 at 04:01:58PM +0300, Eli Cohen wrote: > > > > On Wed, Aug 05, 2020 at

Re: [vhost:vhost 32/52] include/linux/typecheck.h:12:18: warning: comparison of distinct pointer types lacks a cast

2020-08-05 Thread Michael S. Tsirkin
LE accessors > config: parisc-randconfig-r003-20200805 (attached as .config) > compiler: hppa-linux-gcc (GCC) 9.3.0 > reproduce (this is a W=1 build): > wget > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O > ~/bin/make.cross > chmod