[PATCH 0/2] Enable virtio-fs on s390x

Marc Hartmayer posted 2 patches 1 week ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200730140731.32912-1-mhartmay@linux.ibm.com
Maintainers: Richard Henderson <rth@twiddle.net>, David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@de.ibm.com>
contrib/libvhost-user/libvhost-user.c | 77 +++++++++++++++------------
hw/s390x/Makefile.objs                |  1 +
hw/s390x/vhost-user-fs-ccw.c          | 75 ++++++++++++++++++++++++++
3 files changed, 119 insertions(+), 34 deletions(-)
create mode 100644 hw/s390x/vhost-user-fs-ccw.c

[PATCH 0/2] Enable virtio-fs on s390x

Posted by Marc Hartmayer 1 week ago
This patch series is about enabling virtio-fs on s390x. For that we need
 + some shim code (first patch), and we need
 + libvhost-user to deal with virtio endiannes for non-legacy virtio
   devices as mandated by the spec.

How to use?

For general instructions how to use virtio-fs (on x86) please have a
look at https://virtio-fs.gitlab.io/howto-qemu.html. Most of the
instructions can also be applied on s390x.

In short:

1. Install self-compiled QEMU with this patch series applied
2. Prepare host and guest kernel so they support virtio-fs

Start virtiofsd on the host

 $ virtiofsd -f --socket-path=/tmp/vhostqemu -o source=/tmp/shared

Now you can start QEMU in a separate shell on the host:

 $ qemu-system-s390x -machine type=s390-ccw-virtio,accel=kvm,memory-backend=mem \
   -object memory-backend-file,id=mem,size=2G,mem-path=/dev/shm/virtiofs,share=on,prealloc=on,prealloc-threads=1 \
   -chardev socket,id=char0,path=/tmp/vhostqemu -device vhost-user-fs-ccw,queue-size=1024,chardev=char0,tag=myfs \
   -drive if=virtio,file=disk.qcow2 \
   -m 2G -smp 2 -nographic

Log into the guest and mount it

 $ mount -t virtiofs myfs /mnt

Changelog:
 RFC v2 -> v1:
 - patch 1:
  + Added `force_revision_1 = true` (Conny)
  + I didn't add the r-b from Stefan Hajnoczi as I've added the
    changes suggested by Conny
 - squashed patches 2 and 3:
  + removed assertion in performance critical code path (Stefan)
  + dropped all dead code (Stefan)
  + removed libvhost-access.h
  
 RFC v1 -> RFC v2:
  + rebased
  + drop patch "libvhost-user: print invalid address on vu_panic" as it's not related to this series
  + drop patch "[RFC 4/4] HACK: Hard-code the libvhost-user.o-cflags for s390x"
  + patch "virtio: add vhost-user-fs-ccw device": replace qdev_set_parent_bus and object_property_set_bool by qdev_realize
  + patch "libvhost-user: handle endianness as mandated by the spec":
    Drop support for legacy virtio devices
  + add patch to fence legacy virtio devices
*** BLURB HERE ***

Halil Pasic (1):
  virtio: add vhost-user-fs-ccw device

Marc Hartmayer (1):
  libvhost-user: handle endianness as mandated by the spec

 contrib/libvhost-user/libvhost-user.c | 77 +++++++++++++++------------
 hw/s390x/Makefile.objs                |  1 +
 hw/s390x/vhost-user-fs-ccw.c          | 75 ++++++++++++++++++++++++++
 3 files changed, 119 insertions(+), 34 deletions(-)
 create mode 100644 hw/s390x/vhost-user-fs-ccw.c

-- 
2.25.4


Re: [PATCH 0/2] Enable virtio-fs on s390x

Posted by Michael S. Tsirkin 1 week ago
On Thu, Jul 30, 2020 at 04:07:29PM +0200, Marc Hartmayer wrote:
> This patch series is about enabling virtio-fs on s390x. For that we need
>  + some shim code (first patch), and we need
>  + libvhost-user to deal with virtio endiannes for non-legacy virtio
>    devices as mandated by the spec.
> 
> How to use?
> 
> For general instructions how to use virtio-fs (on x86) please have a
> look at https://virtio-fs.gitlab.io/howto-qemu.html. Most of the
> instructions can also be applied on s390x.
> 
> In short:
> 
> 1. Install self-compiled QEMU with this patch series applied
> 2. Prepare host and guest kernel so they support virtio-fs
> 
> Start virtiofsd on the host
> 
>  $ virtiofsd -f --socket-path=/tmp/vhostqemu -o source=/tmp/shared
> 
> Now you can start QEMU in a separate shell on the host:
> 
>  $ qemu-system-s390x -machine type=s390-ccw-virtio,accel=kvm,memory-backend=mem \
>    -object memory-backend-file,id=mem,size=2G,mem-path=/dev/shm/virtiofs,share=on,prealloc=on,prealloc-threads=1 \
>    -chardev socket,id=char0,path=/tmp/vhostqemu -device vhost-user-fs-ccw,queue-size=1024,chardev=char0,tag=myfs \
>    -drive if=virtio,file=disk.qcow2 \
>    -m 2G -smp 2 -nographic
> 
> Log into the guest and mount it
> 
>  $ mount -t virtiofs myfs /mnt

Who's merging this? My tree?

> Changelog:
>  RFC v2 -> v1:
>  - patch 1:
>   + Added `force_revision_1 = true` (Conny)
>   + I didn't add the r-b from Stefan Hajnoczi as I've added the
>     changes suggested by Conny
>  - squashed patches 2 and 3:
>   + removed assertion in performance critical code path (Stefan)
>   + dropped all dead code (Stefan)
>   + removed libvhost-access.h
>   
>  RFC v1 -> RFC v2:
>   + rebased
>   + drop patch "libvhost-user: print invalid address on vu_panic" as it's not related to this series
>   + drop patch "[RFC 4/4] HACK: Hard-code the libvhost-user.o-cflags for s390x"
>   + patch "virtio: add vhost-user-fs-ccw device": replace qdev_set_parent_bus and object_property_set_bool by qdev_realize
>   + patch "libvhost-user: handle endianness as mandated by the spec":
>     Drop support for legacy virtio devices
>   + add patch to fence legacy virtio devices
> *** BLURB HERE ***
> 
> Halil Pasic (1):
>   virtio: add vhost-user-fs-ccw device
> 
> Marc Hartmayer (1):
>   libvhost-user: handle endianness as mandated by the spec
> 
>  contrib/libvhost-user/libvhost-user.c | 77 +++++++++++++++------------
>  hw/s390x/Makefile.objs                |  1 +
>  hw/s390x/vhost-user-fs-ccw.c          | 75 ++++++++++++++++++++++++++
>  3 files changed, 119 insertions(+), 34 deletions(-)
>  create mode 100644 hw/s390x/vhost-user-fs-ccw.c
> 
> -- 
> 2.25.4


Re: [PATCH 0/2] Enable virtio-fs on s390x

Posted by Dr. David Alan Gilbert 1 week ago
* Michael S. Tsirkin (mst@redhat.com) wrote:
> On Thu, Jul 30, 2020 at 04:07:29PM +0200, Marc Hartmayer wrote:
> > This patch series is about enabling virtio-fs on s390x. For that we need
> >  + some shim code (first patch), and we need
> >  + libvhost-user to deal with virtio endiannes for non-legacy virtio
> >    devices as mandated by the spec.
> > 
> > How to use?
> > 
> > For general instructions how to use virtio-fs (on x86) please have a
> > look at https://virtio-fs.gitlab.io/howto-qemu.html. Most of the
> > instructions can also be applied on s390x.
> > 
> > In short:
> > 
> > 1. Install self-compiled QEMU with this patch series applied
> > 2. Prepare host and guest kernel so they support virtio-fs
> > 
> > Start virtiofsd on the host
> > 
> >  $ virtiofsd -f --socket-path=/tmp/vhostqemu -o source=/tmp/shared
> > 
> > Now you can start QEMU in a separate shell on the host:
> > 
> >  $ qemu-system-s390x -machine type=s390-ccw-virtio,accel=kvm,memory-backend=mem \
> >    -object memory-backend-file,id=mem,size=2G,mem-path=/dev/shm/virtiofs,share=on,prealloc=on,prealloc-threads=1 \
> >    -chardev socket,id=char0,path=/tmp/vhostqemu -device vhost-user-fs-ccw,queue-size=1024,chardev=char0,tag=myfs \
> >    -drive if=virtio,file=disk.qcow2 \
> >    -m 2G -smp 2 -nographic
> > 
> > Log into the guest and mount it
> > 
> >  $ mount -t virtiofs myfs /mnt
> 
> Who's merging this? My tree?

I think so; it seems either generic virtio or s390 more than actually
virtiofs specific in most of it.

Dave

> > Changelog:
> >  RFC v2 -> v1:
> >  - patch 1:
> >   + Added `force_revision_1 = true` (Conny)
> >   + I didn't add the r-b from Stefan Hajnoczi as I've added the
> >     changes suggested by Conny
> >  - squashed patches 2 and 3:
> >   + removed assertion in performance critical code path (Stefan)
> >   + dropped all dead code (Stefan)
> >   + removed libvhost-access.h
> >   
> >  RFC v1 -> RFC v2:
> >   + rebased
> >   + drop patch "libvhost-user: print invalid address on vu_panic" as it's not related to this series
> >   + drop patch "[RFC 4/4] HACK: Hard-code the libvhost-user.o-cflags for s390x"
> >   + patch "virtio: add vhost-user-fs-ccw device": replace qdev_set_parent_bus and object_property_set_bool by qdev_realize
> >   + patch "libvhost-user: handle endianness as mandated by the spec":
> >     Drop support for legacy virtio devices
> >   + add patch to fence legacy virtio devices
> > *** BLURB HERE ***
> > 
> > Halil Pasic (1):
> >   virtio: add vhost-user-fs-ccw device
> > 
> > Marc Hartmayer (1):
> >   libvhost-user: handle endianness as mandated by the spec
> > 
> >  contrib/libvhost-user/libvhost-user.c | 77 +++++++++++++++------------
> >  hw/s390x/Makefile.objs                |  1 +
> >  hw/s390x/vhost-user-fs-ccw.c          | 75 ++++++++++++++++++++++++++
> >  3 files changed, 119 insertions(+), 34 deletions(-)
> >  create mode 100644 hw/s390x/vhost-user-fs-ccw.c
> > 
> > -- 
> > 2.25.4
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK