Re: [PULL V2 00/15] Net patches

2022-03-10 Thread Jason Wang
On Fri, Mar 11, 2022 at 1:07 AM Peter Maydell 
wrote:

> On Thu, 10 Mar 2022 at 02:39, Jason Wang  wrote:
> >
> > The following changes since commit
> d9ccf33f9479201e5add8db0af68ca9ca8da358b:
> >
> >   Merge remote-tracking branch
> 'remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request' into staging
> (2022-03-09 20:01:17 +)
> >
> > are available in the git repository at:
> >
> >   https://github.com/jasowang/qemu.git tags/net-pull-request
> >
> > for you to fetch changes up to eea40402ecf895ed345f8e8eb07dbb484f4542c5:
> >
> >   vdpa: Expose VHOST_F_LOG_ALL on SVQ (2022-03-10 10:26:32 +0800)
> >
> > 
> >
>
> Lots of 32-bit compile issues: this is 32-bit arm:
> https://gitlab.com/qemu-project/qemu/-/jobs/2188500721
> i386 the same:
> https://gitlab.com/qemu-project/qemu/-/jobs/2188500747
> and 32-bit mips:
> https://gitlab.com/qemu-project/qemu/-/jobs/2188500753


Eugenio, please fix those warnings and send a new version.

Thanks


>
>
> ../hw/virtio/vhost-shadow-virtqueue.c: In function
> 'vhost_svq_valid_features':
> ../hw/virtio/vhost-shadow-virtqueue.c:43:28: error: passing argument 2
> of 'set_bit' from incompatible pointer type
> [-Werror=incompatible-pointer-types]
> set_bit(b, _features);
> ^
> In file included from /builds/qemu-project/qemu/include/qemu/bitmap.h:16,
> from /builds/qemu-project/qemu/include/hw/qdev-core.h:5,
> from /builds/qemu-project/qemu/include/hw/virtio/virtio.h:18,
> from /builds/qemu-project/qemu/hw/virtio/vhost-shadow-virtqueue.h:14,
> from ../hw/virtio/vhost-shadow-virtqueue.c:11:
> /builds/qemu-project/qemu/include/qemu/bitops.h:36:52: note: expected
> 'long unsigned int *' but argument is of type 'uint64_t *' {aka 'long
> long unsigned int *'}
> static inline void set_bit(long nr, unsigned long *addr)
> ~~~^~~~
> ../hw/virtio/vhost-shadow-virtqueue.c:50:30: error: passing argument 2
> of 'clear_bit' from incompatible pointer type
> [-Werror=incompatible-pointer-types]
> clear_bit(b, _features);
> ^
> In file included from /builds/qemu-project/qemu/include/qemu/bitmap.h:16,
> from /builds/qemu-project/qemu/include/hw/qdev-core.h:5,
> from /builds/qemu-project/qemu/include/hw/virtio/virtio.h:18,
> from /builds/qemu-project/qemu/hw/virtio/vhost-shadow-virtqueue.h:14,
> from ../hw/virtio/vhost-shadow-virtqueue.c:11:
> /builds/qemu-project/qemu/include/qemu/bitops.h:62:54: note: expected
> 'long unsigned int *' but argument is of type 'uint64_t *' {aka 'long
> long unsigned int *'}
> static inline void clear_bit(long nr, unsigned long *addr)
> ~~~^~~~
> ../hw/virtio/vhost-shadow-virtqueue.c: In function
> 'vhost_svq_translate_addr':
> ../hw/virtio/vhost-shadow-virtqueue.c:91:32: error: cast from pointer
> to integer of different size [-Werror=pointer-to-int-cast]
> .translated_addr = (hwaddr)iovec[i].iov_base,
> ^
> ../hw/virtio/vhost-shadow-virtqueue.c:109:20: error: cast to pointer
> from integer of different size [-Werror=int-to-pointer-cast]
> addrs[i] = (void *)(map->iova + off);
> ^
> In file included from /builds/qemu-project/qemu/include/qemu/osdep.h:37,
> from ../hw/virtio/vhost-shadow-virtqueue.c:10:
> ../hw/virtio/vhost-shadow-virtqueue.c:111:49: error: incompatible type
> for argument 1 of 'int128_add'
> if (unlikely(int128_gt(int128_add(needle.translated_addr,
> ~~^~~~
> /builds/qemu-project/qemu/include/qemu/compiler.h:43:43: note: in
> definition of macro 'unlikely'
> #define unlikely(x) __builtin_expect(!!(x), 0)
> ^
> In file included from /builds/qemu-project/qemu/include/exec/memory.h:26,
> from /builds/qemu-project/qemu/include/hw/virtio/virtio.h:17,
> from /builds/qemu-project/qemu/hw/virtio/vhost-shadow-virtqueue.h:14,
> from ../hw/virtio/vhost-shadow-virtqueue.c:11:
> /builds/qemu-project/qemu/include/qemu/int128.h:313:40: note: expected
> 'Int128' {aka 'struct Int128'} but argument is of type 'hwaddr' {aka
> 'long long unsigned int'}
> static inline Int128 int128_add(Int128 a, Int128 b)
> ~~~^
> In file included from /builds/qemu-project/qemu/include/qemu/osdep.h:37,
> from ../hw/virtio/vhost-shadow-virtqueue.c:10:
> ../hw/virtio/vhost-shadow-virtqueue.c:112:51: error: incompatible type
> for argument 2 of 'int128_add'
> iovec[i].iov_len),
> ^~~~
> /builds/qemu-project/qemu/include/qemu/compiler.h:43:43: note: in
> definition of macro 'unlikely'
> #define unlikely(x) __builtin_expect(!!(x), 0)
> ^
> In file included from /builds/qemu-project/qemu/include/exec/memory.h:26,
> from /builds/qemu-project/qemu/include/hw/virtio/virtio.h:17,
> from /builds/qemu-project/qemu/hw/virtio/vhost-shadow-virtqueue.h:14,
> from ../hw/virtio/vhost-shadow-virtqueue.c:11:
> /builds/qemu-project/qemu/include/qemu/int128.h:313:50: note: expected
> 'Int128' {aka 'struct Int128'} but argument is of type 'size_t' {aka
> 'const unsigned int'}
> static inline Int128 int128_add(Int128 a, Int128 b)
> ~~~^
> In file 

Re: [PULL V2 00/15] Net patches

2022-03-10 Thread Peter Maydell
On Thu, 10 Mar 2022 at 02:39, Jason Wang  wrote:
>
> The following changes since commit d9ccf33f9479201e5add8db0af68ca9ca8da358b:
>
>   Merge remote-tracking branch 
> 'remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request' into staging 
> (2022-03-09 20:01:17 +)
>
> are available in the git repository at:
>
>   https://github.com/jasowang/qemu.git tags/net-pull-request
>
> for you to fetch changes up to eea40402ecf895ed345f8e8eb07dbb484f4542c5:
>
>   vdpa: Expose VHOST_F_LOG_ALL on SVQ (2022-03-10 10:26:32 +0800)
>
> 
>

Lots of 32-bit compile issues: this is 32-bit arm:
https://gitlab.com/qemu-project/qemu/-/jobs/2188500721
i386 the same:
https://gitlab.com/qemu-project/qemu/-/jobs/2188500747
and 32-bit mips:
https://gitlab.com/qemu-project/qemu/-/jobs/2188500753

../hw/virtio/vhost-shadow-virtqueue.c: In function 'vhost_svq_valid_features':
../hw/virtio/vhost-shadow-virtqueue.c:43:28: error: passing argument 2
of 'set_bit' from incompatible pointer type
[-Werror=incompatible-pointer-types]
set_bit(b, _features);
^
In file included from /builds/qemu-project/qemu/include/qemu/bitmap.h:16,
from /builds/qemu-project/qemu/include/hw/qdev-core.h:5,
from /builds/qemu-project/qemu/include/hw/virtio/virtio.h:18,
from /builds/qemu-project/qemu/hw/virtio/vhost-shadow-virtqueue.h:14,
from ../hw/virtio/vhost-shadow-virtqueue.c:11:
/builds/qemu-project/qemu/include/qemu/bitops.h:36:52: note: expected
'long unsigned int *' but argument is of type 'uint64_t *' {aka 'long
long unsigned int *'}
static inline void set_bit(long nr, unsigned long *addr)
~~~^~~~
../hw/virtio/vhost-shadow-virtqueue.c:50:30: error: passing argument 2
of 'clear_bit' from incompatible pointer type
[-Werror=incompatible-pointer-types]
clear_bit(b, _features);
^
In file included from /builds/qemu-project/qemu/include/qemu/bitmap.h:16,
from /builds/qemu-project/qemu/include/hw/qdev-core.h:5,
from /builds/qemu-project/qemu/include/hw/virtio/virtio.h:18,
from /builds/qemu-project/qemu/hw/virtio/vhost-shadow-virtqueue.h:14,
from ../hw/virtio/vhost-shadow-virtqueue.c:11:
/builds/qemu-project/qemu/include/qemu/bitops.h:62:54: note: expected
'long unsigned int *' but argument is of type 'uint64_t *' {aka 'long
long unsigned int *'}
static inline void clear_bit(long nr, unsigned long *addr)
~~~^~~~
../hw/virtio/vhost-shadow-virtqueue.c: In function 'vhost_svq_translate_addr':
../hw/virtio/vhost-shadow-virtqueue.c:91:32: error: cast from pointer
to integer of different size [-Werror=pointer-to-int-cast]
.translated_addr = (hwaddr)iovec[i].iov_base,
^
../hw/virtio/vhost-shadow-virtqueue.c:109:20: error: cast to pointer
from integer of different size [-Werror=int-to-pointer-cast]
addrs[i] = (void *)(map->iova + off);
^
In file included from /builds/qemu-project/qemu/include/qemu/osdep.h:37,
from ../hw/virtio/vhost-shadow-virtqueue.c:10:
../hw/virtio/vhost-shadow-virtqueue.c:111:49: error: incompatible type
for argument 1 of 'int128_add'
if (unlikely(int128_gt(int128_add(needle.translated_addr,
~~^~~~
/builds/qemu-project/qemu/include/qemu/compiler.h:43:43: note: in
definition of macro 'unlikely'
#define unlikely(x) __builtin_expect(!!(x), 0)
^
In file included from /builds/qemu-project/qemu/include/exec/memory.h:26,
from /builds/qemu-project/qemu/include/hw/virtio/virtio.h:17,
from /builds/qemu-project/qemu/hw/virtio/vhost-shadow-virtqueue.h:14,
from ../hw/virtio/vhost-shadow-virtqueue.c:11:
/builds/qemu-project/qemu/include/qemu/int128.h:313:40: note: expected
'Int128' {aka 'struct Int128'} but argument is of type 'hwaddr' {aka
'long long unsigned int'}
static inline Int128 int128_add(Int128 a, Int128 b)
~~~^
In file included from /builds/qemu-project/qemu/include/qemu/osdep.h:37,
from ../hw/virtio/vhost-shadow-virtqueue.c:10:
../hw/virtio/vhost-shadow-virtqueue.c:112:51: error: incompatible type
for argument 2 of 'int128_add'
iovec[i].iov_len),
^~~~
/builds/qemu-project/qemu/include/qemu/compiler.h:43:43: note: in
definition of macro 'unlikely'
#define unlikely(x) __builtin_expect(!!(x), 0)
^
In file included from /builds/qemu-project/qemu/include/exec/memory.h:26,
from /builds/qemu-project/qemu/include/hw/virtio/virtio.h:17,
from /builds/qemu-project/qemu/hw/virtio/vhost-shadow-virtqueue.h:14,
from ../hw/virtio/vhost-shadow-virtqueue.c:11:
/builds/qemu-project/qemu/include/qemu/int128.h:313:50: note: expected
'Int128' {aka 'struct Int128'} but argument is of type 'size_t' {aka
'const unsigned int'}
static inline Int128 int128_add(Int128 a, Int128 b)
~~~^
In file included from /builds/qemu-project/qemu/include/qemu/osdep.h:37,
from ../hw/virtio/vhost-shadow-virtqueue.c:10:
../hw/virtio/vhost-shadow-virtqueue.c:113:53: error: incompatible type
for argument 2 of 'int128_gt'
map->translated_addr + map->size))) {
~^~~
/builds/qemu-project/qemu/include/qemu/compiler.h:43:43: 

[PULL V2 00/15] Net patches

2022-03-09 Thread Jason Wang
The following changes since commit d9ccf33f9479201e5add8db0af68ca9ca8da358b:

  Merge remote-tracking branch 
'remotes/lvivier-gitlab/tags/linux-user-for-7.0-pull-request' into staging 
(2022-03-09 20:01:17 +)

are available in the git repository at:

  https://github.com/jasowang/qemu.git tags/net-pull-request

for you to fetch changes up to eea40402ecf895ed345f8e8eb07dbb484f4542c5:

  vdpa: Expose VHOST_F_LOG_ALL on SVQ (2022-03-10 10:26:32 +0800)




Eugenio PĂ©rez (14):
  vhost: Add VhostShadowVirtqueue
  vhost: Add Shadow VirtQueue kick forwarding capabilities
  vhost: Add Shadow VirtQueue call forwarding capabilities
  vhost: Add vhost_svq_valid_features to shadow vq
  virtio: Add vhost_svq_get_vring_addr
  vdpa: adapt vhost_ops callbacks to svq
  vhost: Shadow virtqueue buffers forwarding
  util: Add iova_tree_alloc_map
  util: add iova_tree_find_iova
  vhost: Add VhostIOVATree
  vdpa: Add custom IOTLB translations to SVQ
  vdpa: Adapt vhost_vdpa_get_vring_base to SVQ
  vdpa: Never set log_base addr if SVQ is enabled
  vdpa: Expose VHOST_F_LOG_ALL on SVQ

Jason Wang (1):
  virtio-net: fix map leaking on error during receive

 hw/net/virtio-net.c|   1 +
 hw/virtio/meson.build  |   2 +-
 hw/virtio/vhost-iova-tree.c| 110 +++
 hw/virtio/vhost-iova-tree.h|  27 ++
 hw/virtio/vhost-shadow-virtqueue.c | 638 +
 hw/virtio/vhost-shadow-virtqueue.h |  87 +
 hw/virtio/vhost-vdpa.c | 525 +-
 include/hw/virtio/vhost-vdpa.h |   8 +
 include/qemu/iova-tree.h   |  38 ++-
 util/iova-tree.c   | 169 ++
 10 files changed, 1588 insertions(+), 17 deletions(-)
 create mode 100644 hw/virtio/vhost-iova-tree.c
 create mode 100644 hw/virtio/vhost-iova-tree.h
 create mode 100644 hw/virtio/vhost-shadow-virtqueue.c
 create mode 100644 hw/virtio/vhost-shadow-virtqueue.h