All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Enable vhost-user to be used on BSD systems
@ 2022-03-03 11:59 ` Sergio Lopez
  0 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Christian Borntraeger, Alex Williamson, Cornelia Huck,
	Thomas Huth, Paolo Bonzini, Stefan Hajnoczi, Michael S. Tsirkin,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman, Sergio Lopez

Since QEMU is already able to emulate ioeventfd using pipefd, we're already
pretty close to supporting vhost-user on non-Linux systems.

This two patches bridge the gap by:

1. Adding a new event_notifier_get_wfd() to return wfd on the places where
   the peer is expected to write to the notifier.

2. Modifying the build system to it allows enabling vhost-user on BSD.

v1->v2:
  - Drop: "Allow returning EventNotifier's wfd" (Alex Williamson)
  - Add: "event_notifier: add event_notifier_get_wfd()" (Alex Williamson)
  - Add: "vhost: use wfd on functions setting vring call fd"
  - Rename: "Allow building vhost-user in BSD" to "configure, meson: allow
    enabling vhost-user on all POSIX systems"
  - Instead of making possible enabling vhost-user on Linux and BSD systems,
    allow enabling it on all non-Windows platforms. (Paolo Bonzini)

v2->v3:
  - Add a section to docs/interop/vhost-user.rst explaining how vhost-user
    is supported on non-Linux platforms. (Stefan Hajnoczi)

Sergio Lopez (4):
  event_notifier: add event_notifier_get_wfd()
  vhost: use wfd on functions setting vring call fd
  configure, meson: allow enabling vhost-user on all POSIX systems
  docs: vhost-user: add subsection for non-Linux platforms

 configure                     |  4 ++--
 docs/interop/vhost-user.rst   | 18 ++++++++++++++++++
 hw/virtio/vhost.c             |  6 +++---
 include/qemu/event_notifier.h |  1 +
 meson.build                   |  2 +-
 util/event_notifier-posix.c   |  5 +++++
 6 files changed, 30 insertions(+), 6 deletions(-)

-- 
2.35.1



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v3 0/4] Enable vhost-user to be used on BSD systems
@ 2022-03-03 11:59 ` Sergio Lopez
  0 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	David Hildenbrand, Eric Farman, Alex Williamson, kvm, qemu-block,
	Michael S. Tsirkin, Halil Pasic, Christian Borntraeger, vgoyal,
	Thomas Huth, Sergio Lopez, Richard Henderson, qemu-s390x,
	Stefan Hajnoczi, Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

Since QEMU is already able to emulate ioeventfd using pipefd, we're already
pretty close to supporting vhost-user on non-Linux systems.

This two patches bridge the gap by:

1. Adding a new event_notifier_get_wfd() to return wfd on the places where
   the peer is expected to write to the notifier.

2. Modifying the build system to it allows enabling vhost-user on BSD.

v1->v2:
  - Drop: "Allow returning EventNotifier's wfd" (Alex Williamson)
  - Add: "event_notifier: add event_notifier_get_wfd()" (Alex Williamson)
  - Add: "vhost: use wfd on functions setting vring call fd"
  - Rename: "Allow building vhost-user in BSD" to "configure, meson: allow
    enabling vhost-user on all POSIX systems"
  - Instead of making possible enabling vhost-user on Linux and BSD systems,
    allow enabling it on all non-Windows platforms. (Paolo Bonzini)

v2->v3:
  - Add a section to docs/interop/vhost-user.rst explaining how vhost-user
    is supported on non-Linux platforms. (Stefan Hajnoczi)

Sergio Lopez (4):
  event_notifier: add event_notifier_get_wfd()
  vhost: use wfd on functions setting vring call fd
  configure, meson: allow enabling vhost-user on all POSIX systems
  docs: vhost-user: add subsection for non-Linux platforms

 configure                     |  4 ++--
 docs/interop/vhost-user.rst   | 18 ++++++++++++++++++
 hw/virtio/vhost.c             |  6 +++---
 include/qemu/event_notifier.h |  1 +
 meson.build                   |  2 +-
 util/event_notifier-posix.c   |  5 +++++
 6 files changed, 30 insertions(+), 6 deletions(-)

-- 
2.35.1




^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v3 1/4] event_notifier: add event_notifier_get_wfd()
  2022-03-03 11:59 ` Sergio Lopez
@ 2022-03-03 11:59   ` Sergio Lopez
  -1 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Christian Borntraeger, Alex Williamson, Cornelia Huck,
	Thomas Huth, Paolo Bonzini, Stefan Hajnoczi, Michael S. Tsirkin,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman, Sergio Lopez

event_notifier_get_fd(const EventNotifier *e) always returns
EventNotifier's read file descriptor (rfd). This is not a problem when
the EventNotifier is backed by a an eventfd, as a single file
descriptor is used both for reading and triggering events (rfd ==
wfd).

But, when EventNotifier is backed by a pipe pair, we have two file
descriptors, one that can only be used for reads (rfd), and the other
only for writes (wfd).

There's, at least, one known situation in which we need to obtain wfd
instead of rfd, which is when setting up the file that's going to be
sent to the peer in vhost's SET_VRING_CALL.

Add a new event_notifier_get_wfd(const EventNotifier *e) that can be
used to obtain wfd where needed.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 include/qemu/event_notifier.h | 1 +
 util/event_notifier-posix.c   | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/include/qemu/event_notifier.h b/include/qemu/event_notifier.h
index b79add035d..8a4ff308e1 100644
--- a/include/qemu/event_notifier.h
+++ b/include/qemu/event_notifier.h
@@ -38,6 +38,7 @@ int event_notifier_test_and_clear(EventNotifier *);
 #ifdef CONFIG_POSIX
 void event_notifier_init_fd(EventNotifier *, int fd);
 int event_notifier_get_fd(const EventNotifier *);
+int event_notifier_get_wfd(const EventNotifier *);
 #else
 HANDLE event_notifier_get_handle(EventNotifier *);
 #endif
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index 8307013c5d..16294e98d4 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -99,6 +99,11 @@ int event_notifier_get_fd(const EventNotifier *e)
     return e->rfd;
 }
 
+int event_notifier_get_wfd(const EventNotifier *e)
+{
+    return e->wfd;
+}
+
 int event_notifier_set(EventNotifier *e)
 {
     static const uint64_t value = 1;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v3 1/4] event_notifier: add event_notifier_get_wfd()
@ 2022-03-03 11:59   ` Sergio Lopez
  0 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	David Hildenbrand, Eric Farman, Alex Williamson, kvm, qemu-block,
	Michael S. Tsirkin, Halil Pasic, Christian Borntraeger, vgoyal,
	Thomas Huth, Sergio Lopez, Richard Henderson, qemu-s390x,
	Stefan Hajnoczi, Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

event_notifier_get_fd(const EventNotifier *e) always returns
EventNotifier's read file descriptor (rfd). This is not a problem when
the EventNotifier is backed by a an eventfd, as a single file
descriptor is used both for reading and triggering events (rfd ==
wfd).

But, when EventNotifier is backed by a pipe pair, we have two file
descriptors, one that can only be used for reads (rfd), and the other
only for writes (wfd).

There's, at least, one known situation in which we need to obtain wfd
instead of rfd, which is when setting up the file that's going to be
sent to the peer in vhost's SET_VRING_CALL.

Add a new event_notifier_get_wfd(const EventNotifier *e) that can be
used to obtain wfd where needed.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 include/qemu/event_notifier.h | 1 +
 util/event_notifier-posix.c   | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/include/qemu/event_notifier.h b/include/qemu/event_notifier.h
index b79add035d..8a4ff308e1 100644
--- a/include/qemu/event_notifier.h
+++ b/include/qemu/event_notifier.h
@@ -38,6 +38,7 @@ int event_notifier_test_and_clear(EventNotifier *);
 #ifdef CONFIG_POSIX
 void event_notifier_init_fd(EventNotifier *, int fd);
 int event_notifier_get_fd(const EventNotifier *);
+int event_notifier_get_wfd(const EventNotifier *);
 #else
 HANDLE event_notifier_get_handle(EventNotifier *);
 #endif
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index 8307013c5d..16294e98d4 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -99,6 +99,11 @@ int event_notifier_get_fd(const EventNotifier *e)
     return e->rfd;
 }
 
+int event_notifier_get_wfd(const EventNotifier *e)
+{
+    return e->wfd;
+}
+
 int event_notifier_set(EventNotifier *e)
 {
     static const uint64_t value = 1;
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v3 2/4] vhost: use wfd on functions setting vring call fd
  2022-03-03 11:59 ` Sergio Lopez
@ 2022-03-03 11:59   ` Sergio Lopez
  -1 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Christian Borntraeger, Alex Williamson, Cornelia Huck,
	Thomas Huth, Paolo Bonzini, Stefan Hajnoczi, Michael S. Tsirkin,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman, Sergio Lopez

When ioeventfd is emulated using qemu_pipe(), only EventNotifier's wfd
can be used for writing.

Use the recently introduced event_notifier_get_wfd() function to
obtain the fd that our peer must use to signal the vring.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 hw/virtio/vhost.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 7b03efccec..b643f42ea4 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1287,7 +1287,7 @@ static int vhost_virtqueue_init(struct vhost_dev *dev,
         return r;
     }
 
-    file.fd = event_notifier_get_fd(&vq->masked_notifier);
+    file.fd = event_notifier_get_wfd(&vq->masked_notifier);
     r = dev->vhost_ops->vhost_set_vring_call(dev, &file);
     if (r) {
         VHOST_OPS_DEBUG(r, "vhost_set_vring_call failed");
@@ -1542,9 +1542,9 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n,
 
     if (mask) {
         assert(vdev->use_guest_notifier_mask);
-        file.fd = event_notifier_get_fd(&hdev->vqs[index].masked_notifier);
+        file.fd = event_notifier_get_wfd(&hdev->vqs[index].masked_notifier);
     } else {
-        file.fd = event_notifier_get_fd(virtio_queue_get_guest_notifier(vvq));
+        file.fd = event_notifier_get_wfd(virtio_queue_get_guest_notifier(vvq));
     }
 
     file.index = hdev->vhost_ops->vhost_get_vq_index(hdev, n);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v3 2/4] vhost: use wfd on functions setting vring call fd
@ 2022-03-03 11:59   ` Sergio Lopez
  0 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	David Hildenbrand, Eric Farman, Alex Williamson, kvm, qemu-block,
	Michael S. Tsirkin, Halil Pasic, Christian Borntraeger, vgoyal,
	Thomas Huth, Sergio Lopez, Richard Henderson, qemu-s390x,
	Stefan Hajnoczi, Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

When ioeventfd is emulated using qemu_pipe(), only EventNotifier's wfd
can be used for writing.

Use the recently introduced event_notifier_get_wfd() function to
obtain the fd that our peer must use to signal the vring.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 hw/virtio/vhost.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 7b03efccec..b643f42ea4 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1287,7 +1287,7 @@ static int vhost_virtqueue_init(struct vhost_dev *dev,
         return r;
     }
 
-    file.fd = event_notifier_get_fd(&vq->masked_notifier);
+    file.fd = event_notifier_get_wfd(&vq->masked_notifier);
     r = dev->vhost_ops->vhost_set_vring_call(dev, &file);
     if (r) {
         VHOST_OPS_DEBUG(r, "vhost_set_vring_call failed");
@@ -1542,9 +1542,9 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n,
 
     if (mask) {
         assert(vdev->use_guest_notifier_mask);
-        file.fd = event_notifier_get_fd(&hdev->vqs[index].masked_notifier);
+        file.fd = event_notifier_get_wfd(&hdev->vqs[index].masked_notifier);
     } else {
-        file.fd = event_notifier_get_fd(virtio_queue_get_guest_notifier(vvq));
+        file.fd = event_notifier_get_wfd(virtio_queue_get_guest_notifier(vvq));
     }
 
     file.index = hdev->vhost_ops->vhost_get_vq_index(hdev, n);
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v3 3/4] configure, meson: allow enabling vhost-user on all POSIX systems
  2022-03-03 11:59 ` Sergio Lopez
@ 2022-03-03 11:59   ` Sergio Lopez
  -1 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Christian Borntraeger, Alex Williamson, Cornelia Huck,
	Thomas Huth, Paolo Bonzini, Stefan Hajnoczi, Michael S. Tsirkin,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman, Sergio Lopez

With the possibility of using a pipe pair via qemu_pipe() as a
replacement on operating systems that doesn't support eventfd,
vhost-user can also work on all POSIX systems.

This change allows enabling vhost-user on all non-Windows platforms
and makes libvhost_user (which still depends on eventfd) a linux-only
feature.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 configure   | 4 ++--
 meson.build | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index c56ed53ee3..daccf4be7c 100755
--- a/configure
+++ b/configure
@@ -1659,8 +1659,8 @@ fi
 # vhost interdependencies and host support
 
 # vhost backends
-if test "$vhost_user" = "yes" && test "$linux" != "yes"; then
-  error_exit "vhost-user is only available on Linux"
+if test "$vhost_user" = "yes" && test "$mingw32" = "yes"; then
+  error_exit "vhost-user is not available on Windows"
 fi
 test "$vhost_vdpa" = "" && vhost_vdpa=$linux
 if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then
diff --git a/meson.build b/meson.build
index 8df40bfac4..f2bc439c30 100644
--- a/meson.build
+++ b/meson.build
@@ -2701,7 +2701,7 @@ if have_system or have_user
 endif
 
 vhost_user = not_found
-if 'CONFIG_VHOST_USER' in config_host
+if targetos == 'linux' and 'CONFIG_VHOST_USER' in config_host
   libvhost_user = subproject('libvhost-user')
   vhost_user = libvhost_user.get_variable('vhost_user_dep')
 endif
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v3 3/4] configure, meson: allow enabling vhost-user on all POSIX systems
@ 2022-03-03 11:59   ` Sergio Lopez
  0 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	David Hildenbrand, Eric Farman, Alex Williamson, kvm, qemu-block,
	Michael S. Tsirkin, Halil Pasic, Christian Borntraeger, vgoyal,
	Thomas Huth, Sergio Lopez, Richard Henderson, qemu-s390x,
	Stefan Hajnoczi, Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

With the possibility of using a pipe pair via qemu_pipe() as a
replacement on operating systems that doesn't support eventfd,
vhost-user can also work on all POSIX systems.

This change allows enabling vhost-user on all non-Windows platforms
and makes libvhost_user (which still depends on eventfd) a linux-only
feature.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 configure   | 4 ++--
 meson.build | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index c56ed53ee3..daccf4be7c 100755
--- a/configure
+++ b/configure
@@ -1659,8 +1659,8 @@ fi
 # vhost interdependencies and host support
 
 # vhost backends
-if test "$vhost_user" = "yes" && test "$linux" != "yes"; then
-  error_exit "vhost-user is only available on Linux"
+if test "$vhost_user" = "yes" && test "$mingw32" = "yes"; then
+  error_exit "vhost-user is not available on Windows"
 fi
 test "$vhost_vdpa" = "" && vhost_vdpa=$linux
 if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then
diff --git a/meson.build b/meson.build
index 8df40bfac4..f2bc439c30 100644
--- a/meson.build
+++ b/meson.build
@@ -2701,7 +2701,7 @@ if have_system or have_user
 endif
 
 vhost_user = not_found
-if 'CONFIG_VHOST_USER' in config_host
+if targetos == 'linux' and 'CONFIG_VHOST_USER' in config_host
   libvhost_user = subproject('libvhost-user')
   vhost_user = libvhost_user.get_variable('vhost_user_dep')
 endif
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms
  2022-03-03 11:59 ` Sergio Lopez
@ 2022-03-03 11:59   ` Sergio Lopez
  -1 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Christian Borntraeger, Alex Williamson, Cornelia Huck,
	Thomas Huth, Paolo Bonzini, Stefan Hajnoczi, Michael S. Tsirkin,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman, Sergio Lopez

Add a section explaining how vhost-user is supported on platforms
other than Linux.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 docs/interop/vhost-user.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index edc3ad84a3..590a626b92 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost-user.rst
@@ -38,6 +38,24 @@ conventions <backend_conventions>`.
 *Master* and *slave* can be either a client (i.e. connecting) or
 server (listening) in the socket communication.
 
+Support for platforms other than Linux
+--------------------------------------
+
+While vhost-user was initially developed targeting Linux, nowadays is
+supported on any platform that provides the following features:
+
+- The ability to share a mapping injected into the guest between
+  multiple processes, so both QEMU and the vhost-user daemon servicing
+  the device can access simultaneously the memory regions containing
+  the virtqueues and the data associated with each request.
+
+- AF_UNIX sockets with SCM_RIGHTS, so QEMU can communicate with the
+  vhost-user daemon and send it file descriptors when needed.
+
+- Either eventfd or pipe/pipe2. On platforms where eventfd is not
+  available, QEMU will automatically fallback to pipe2 or, as a last
+  resort, pipe.
+
 Message Specification
 =====================
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms
@ 2022-03-03 11:59   ` Sergio Lopez
  0 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-03 11:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	David Hildenbrand, Eric Farman, Alex Williamson, kvm, qemu-block,
	Michael S. Tsirkin, Halil Pasic, Christian Borntraeger, vgoyal,
	Thomas Huth, Sergio Lopez, Richard Henderson, qemu-s390x,
	Stefan Hajnoczi, Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

Add a section explaining how vhost-user is supported on platforms
other than Linux.

Signed-off-by: Sergio Lopez <slp@redhat.com>
---
 docs/interop/vhost-user.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
index edc3ad84a3..590a626b92 100644
--- a/docs/interop/vhost-user.rst
+++ b/docs/interop/vhost-user.rst
@@ -38,6 +38,24 @@ conventions <backend_conventions>`.
 *Master* and *slave* can be either a client (i.e. connecting) or
 server (listening) in the socket communication.
 
+Support for platforms other than Linux
+--------------------------------------
+
+While vhost-user was initially developed targeting Linux, nowadays is
+supported on any platform that provides the following features:
+
+- The ability to share a mapping injected into the guest between
+  multiple processes, so both QEMU and the vhost-user daemon servicing
+  the device can access simultaneously the memory regions containing
+  the virtqueues and the data associated with each request.
+
+- AF_UNIX sockets with SCM_RIGHTS, so QEMU can communicate with the
+  vhost-user daemon and send it file descriptors when needed.
+
+- Either eventfd or pipe/pipe2. On platforms where eventfd is not
+  available, QEMU will automatically fallback to pipe2 or, as a last
+  resort, pipe.
+
 Message Specification
 =====================
 
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms
  2022-03-03 11:59   ` Sergio Lopez
@ 2022-03-03 14:34     ` Stefan Hajnoczi
  -1 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2022-03-03 14:34 UTC (permalink / raw)
  To: Sergio Lopez
  Cc: qemu-devel, Christian Borntraeger, Alex Williamson,
	Cornelia Huck, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman

[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]

On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote:
> Add a section explaining how vhost-user is supported on platforms
> other than Linux.
> 
> Signed-off-by: Sergio Lopez <slp@redhat.com>
> ---
>  docs/interop/vhost-user.rst | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
> index edc3ad84a3..590a626b92 100644
> --- a/docs/interop/vhost-user.rst
> +++ b/docs/interop/vhost-user.rst
> @@ -38,6 +38,24 @@ conventions <backend_conventions>`.
>  *Master* and *slave* can be either a client (i.e. connecting) or
>  server (listening) in the socket communication.
>  
> +Support for platforms other than Linux
> +--------------------------------------
> +
> +While vhost-user was initially developed targeting Linux, nowadays is

s/is/it is/

> +supported on any platform that provides the following features:
> +
> +- The ability to share a mapping injected into the guest between
> +  multiple processes, so both QEMU and the vhost-user daemon servicing
> +  the device can access simultaneously the memory regions containing
> +  the virtqueues and the data associated with each request.

Please generalize this statement since there are other vhost-user
protocol features aside from guest RAM access that involve shared
memory:
1. VHOST_USER_SET_LOG_BASE
2. VHOST_USER_SET_INFLIGHT_FD

The exact requirement is:

  The vhost-user protocol relies on shared memory represented by a file
  descriptor so it can be passed over a UNIX domain socket and then
  mapped by the other process.

> +
> +- AF_UNIX sockets with SCM_RIGHTS, so QEMU can communicate with the
> +  vhost-user daemon and send it file descriptors when needed.
> +
> +- Either eventfd or pipe/pipe2. On platforms where eventfd is not
> +  available, QEMU will automatically fallback to pipe2 or, as a last

The noun is "fallback", the verb form is "fall back":
s/fallback/fall back/

It's worth mentioning that events are sent over pipe fds by writing an
8-byte value. The 8-byte value has no meaning and should not be
interpreted.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms
@ 2022-03-03 14:34     ` Stefan Hajnoczi
  0 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2022-03-03 14:34 UTC (permalink / raw)
  To: Sergio Lopez
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	Eric Farman, David Hildenbrand, qemu-devel, Alex Williamson, kvm,
	qemu-block, Michael S. Tsirkin, Halil Pasic,
	Christian Borntraeger, vgoyal, Thomas Huth, Richard Henderson,
	qemu-s390x, Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]

On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote:
> Add a section explaining how vhost-user is supported on platforms
> other than Linux.
> 
> Signed-off-by: Sergio Lopez <slp@redhat.com>
> ---
>  docs/interop/vhost-user.rst | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
> index edc3ad84a3..590a626b92 100644
> --- a/docs/interop/vhost-user.rst
> +++ b/docs/interop/vhost-user.rst
> @@ -38,6 +38,24 @@ conventions <backend_conventions>`.
>  *Master* and *slave* can be either a client (i.e. connecting) or
>  server (listening) in the socket communication.
>  
> +Support for platforms other than Linux
> +--------------------------------------
> +
> +While vhost-user was initially developed targeting Linux, nowadays is

s/is/it is/

> +supported on any platform that provides the following features:
> +
> +- The ability to share a mapping injected into the guest between
> +  multiple processes, so both QEMU and the vhost-user daemon servicing
> +  the device can access simultaneously the memory regions containing
> +  the virtqueues and the data associated with each request.

Please generalize this statement since there are other vhost-user
protocol features aside from guest RAM access that involve shared
memory:
1. VHOST_USER_SET_LOG_BASE
2. VHOST_USER_SET_INFLIGHT_FD

The exact requirement is:

  The vhost-user protocol relies on shared memory represented by a file
  descriptor so it can be passed over a UNIX domain socket and then
  mapped by the other process.

> +
> +- AF_UNIX sockets with SCM_RIGHTS, so QEMU can communicate with the
> +  vhost-user daemon and send it file descriptors when needed.
> +
> +- Either eventfd or pipe/pipe2. On platforms where eventfd is not
> +  available, QEMU will automatically fallback to pipe2 or, as a last

The noun is "fallback", the verb form is "fall back":
s/fallback/fall back/

It's worth mentioning that events are sent over pipe fds by writing an
8-byte value. The 8-byte value has no meaning and should not be
interpreted.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 0/4] Enable vhost-user to be used on BSD systems
  2022-03-03 11:59 ` Sergio Lopez
@ 2022-03-03 14:35   ` Stefan Hajnoczi
  -1 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2022-03-03 14:35 UTC (permalink / raw)
  To: Sergio Lopez
  Cc: qemu-devel, Christian Borntraeger, Alex Williamson,
	Cornelia Huck, Thomas Huth, Paolo Bonzini, Michael S. Tsirkin,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

On Thu, Mar 03, 2022 at 12:59:07PM +0100, Sergio Lopez wrote:
> Since QEMU is already able to emulate ioeventfd using pipefd, we're already
> pretty close to supporting vhost-user on non-Linux systems.
> 
> This two patches bridge the gap by:
> 
> 1. Adding a new event_notifier_get_wfd() to return wfd on the places where
>    the peer is expected to write to the notifier.
> 
> 2. Modifying the build system to it allows enabling vhost-user on BSD.
> 
> v1->v2:
>   - Drop: "Allow returning EventNotifier's wfd" (Alex Williamson)
>   - Add: "event_notifier: add event_notifier_get_wfd()" (Alex Williamson)
>   - Add: "vhost: use wfd on functions setting vring call fd"
>   - Rename: "Allow building vhost-user in BSD" to "configure, meson: allow
>     enabling vhost-user on all POSIX systems"
>   - Instead of making possible enabling vhost-user on Linux and BSD systems,
>     allow enabling it on all non-Windows platforms. (Paolo Bonzini)
> 
> v2->v3:
>   - Add a section to docs/interop/vhost-user.rst explaining how vhost-user
>     is supported on non-Linux platforms. (Stefan Hajnoczi)
> 
> Sergio Lopez (4):
>   event_notifier: add event_notifier_get_wfd()
>   vhost: use wfd on functions setting vring call fd
>   configure, meson: allow enabling vhost-user on all POSIX systems
>   docs: vhost-user: add subsection for non-Linux platforms
> 
>  configure                     |  4 ++--
>  docs/interop/vhost-user.rst   | 18 ++++++++++++++++++
>  hw/virtio/vhost.c             |  6 +++---
>  include/qemu/event_notifier.h |  1 +
>  meson.build                   |  2 +-
>  util/event_notifier-posix.c   |  5 +++++
>  6 files changed, 30 insertions(+), 6 deletions(-)
> 
> -- 
> 2.35.1
> 
> 

I posted comments on the vhost-user.rst patch. Otherwise:

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 0/4] Enable vhost-user to be used on BSD systems
@ 2022-03-03 14:35   ` Stefan Hajnoczi
  0 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2022-03-03 14:35 UTC (permalink / raw)
  To: Sergio Lopez
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	Eric Farman, David Hildenbrand, qemu-devel, Alex Williamson, kvm,
	qemu-block, Michael S. Tsirkin, Halil Pasic,
	Christian Borntraeger, vgoyal, Thomas Huth, Richard Henderson,
	qemu-s390x, Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

On Thu, Mar 03, 2022 at 12:59:07PM +0100, Sergio Lopez wrote:
> Since QEMU is already able to emulate ioeventfd using pipefd, we're already
> pretty close to supporting vhost-user on non-Linux systems.
> 
> This two patches bridge the gap by:
> 
> 1. Adding a new event_notifier_get_wfd() to return wfd on the places where
>    the peer is expected to write to the notifier.
> 
> 2. Modifying the build system to it allows enabling vhost-user on BSD.
> 
> v1->v2:
>   - Drop: "Allow returning EventNotifier's wfd" (Alex Williamson)
>   - Add: "event_notifier: add event_notifier_get_wfd()" (Alex Williamson)
>   - Add: "vhost: use wfd on functions setting vring call fd"
>   - Rename: "Allow building vhost-user in BSD" to "configure, meson: allow
>     enabling vhost-user on all POSIX systems"
>   - Instead of making possible enabling vhost-user on Linux and BSD systems,
>     allow enabling it on all non-Windows platforms. (Paolo Bonzini)
> 
> v2->v3:
>   - Add a section to docs/interop/vhost-user.rst explaining how vhost-user
>     is supported on non-Linux platforms. (Stefan Hajnoczi)
> 
> Sergio Lopez (4):
>   event_notifier: add event_notifier_get_wfd()
>   vhost: use wfd on functions setting vring call fd
>   configure, meson: allow enabling vhost-user on all POSIX systems
>   docs: vhost-user: add subsection for non-Linux platforms
> 
>  configure                     |  4 ++--
>  docs/interop/vhost-user.rst   | 18 ++++++++++++++++++
>  hw/virtio/vhost.c             |  6 +++---
>  include/qemu/event_notifier.h |  1 +
>  meson.build                   |  2 +-
>  util/event_notifier-posix.c   |  5 +++++
>  6 files changed, 30 insertions(+), 6 deletions(-)
> 
> -- 
> 2.35.1
> 
> 

I posted comments on the vhost-user.rst patch. Otherwise:

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms
  2022-03-03 11:59   ` Sergio Lopez
@ 2022-03-04 10:35     ` Michael S. Tsirkin
  -1 siblings, 0 replies; 20+ messages in thread
From: Michael S. Tsirkin @ 2022-03-04 10:35 UTC (permalink / raw)
  To: Sergio Lopez
  Cc: qemu-devel, Christian Borntraeger, Alex Williamson,
	Cornelia Huck, Thomas Huth, Paolo Bonzini, Stefan Hajnoczi,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman

On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote:
> Add a section explaining how vhost-user is supported on platforms
> other than Linux.
> 
> Signed-off-by: Sergio Lopez <slp@redhat.com>
> ---
>  docs/interop/vhost-user.rst | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
> index edc3ad84a3..590a626b92 100644
> --- a/docs/interop/vhost-user.rst
> +++ b/docs/interop/vhost-user.rst
> @@ -38,6 +38,24 @@ conventions <backend_conventions>`.
>  *Master* and *slave* can be either a client (i.e. connecting) or
>  server (listening) in the socket communication.
>  
> +Support for platforms other than Linux


It's not just Linux - any platform without eventfd.

So I think we should have a section explaining that whereever
spec says eventfd it can be a pipe if system does not
support creating eventfd.

> +--------------------------------------
> +
> +While vhost-user was initially developed targeting Linux, nowadays is
> +supported on any platform that provides the following features:
> +
> +- The ability to share a mapping injected into the guest between
> +  multiple processes, so both QEMU and the vhost-user daemon servicing
> +  the device can access simultaneously the memory regions containing
> +  the virtqueues and the data associated with each request.
> +
> +- AF_UNIX sockets with SCM_RIGHTS, so QEMU can communicate with the
> +  vhost-user daemon and send it file descriptors when needed.
> +
> +- Either eventfd or pipe/pipe2. On platforms where eventfd is not
> +  available, QEMU will automatically fallback to pipe2 or, as a last
> +  resort, pipe.
> +
>  Message Specification
>  =====================
>  
> -- 
> 2.35.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms
@ 2022-03-04 10:35     ` Michael S. Tsirkin
  0 siblings, 0 replies; 20+ messages in thread
From: Michael S. Tsirkin @ 2022-03-04 10:35 UTC (permalink / raw)
  To: Sergio Lopez
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	Eric Farman, qemu-devel, Alex Williamson, kvm, qemu-block,
	David Hildenbrand, Halil Pasic, Christian Borntraeger, vgoyal,
	Thomas Huth, Richard Henderson, qemu-s390x, Stefan Hajnoczi,
	Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote:
> Add a section explaining how vhost-user is supported on platforms
> other than Linux.
> 
> Signed-off-by: Sergio Lopez <slp@redhat.com>
> ---
>  docs/interop/vhost-user.rst | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
> index edc3ad84a3..590a626b92 100644
> --- a/docs/interop/vhost-user.rst
> +++ b/docs/interop/vhost-user.rst
> @@ -38,6 +38,24 @@ conventions <backend_conventions>`.
>  *Master* and *slave* can be either a client (i.e. connecting) or
>  server (listening) in the socket communication.
>  
> +Support for platforms other than Linux


It's not just Linux - any platform without eventfd.

So I think we should have a section explaining that whereever
spec says eventfd it can be a pipe if system does not
support creating eventfd.

> +--------------------------------------
> +
> +While vhost-user was initially developed targeting Linux, nowadays is
> +supported on any platform that provides the following features:
> +
> +- The ability to share a mapping injected into the guest between
> +  multiple processes, so both QEMU and the vhost-user daemon servicing
> +  the device can access simultaneously the memory regions containing
> +  the virtqueues and the data associated with each request.
> +
> +- AF_UNIX sockets with SCM_RIGHTS, so QEMU can communicate with the
> +  vhost-user daemon and send it file descriptors when needed.
> +
> +- Either eventfd or pipe/pipe2. On platforms where eventfd is not
> +  available, QEMU will automatically fallback to pipe2 or, as a last
> +  resort, pipe.
> +
>  Message Specification
>  =====================
>  
> -- 
> 2.35.1



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 0/4] Enable vhost-user to be used on BSD systems
  2022-03-03 11:59 ` Sergio Lopez
@ 2022-03-04 10:38   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 20+ messages in thread
From: Michael S. Tsirkin @ 2022-03-04 10:38 UTC (permalink / raw)
  To: Sergio Lopez
  Cc: qemu-devel, Christian Borntraeger, Alex Williamson,
	Cornelia Huck, Thomas Huth, Paolo Bonzini, Stefan Hajnoczi,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman

On Thu, Mar 03, 2022 at 12:59:07PM +0100, Sergio Lopez wrote:
> Since QEMU is already able to emulate ioeventfd using pipefd, we're already
> pretty close to supporting vhost-user on non-Linux systems.
> 
> This two patches bridge the gap by:
> 
> 1. Adding a new event_notifier_get_wfd() to return wfd on the places where
>    the peer is expected to write to the notifier.
> 
> 2. Modifying the build system to it allows enabling vhost-user on BSD.
> 
> v1->v2:
>   - Drop: "Allow returning EventNotifier's wfd" (Alex Williamson)
>   - Add: "event_notifier: add event_notifier_get_wfd()" (Alex Williamson)
>   - Add: "vhost: use wfd on functions setting vring call fd"
>   - Rename: "Allow building vhost-user in BSD" to "configure, meson: allow
>     enabling vhost-user on all POSIX systems"
>   - Instead of making possible enabling vhost-user on Linux and BSD systems,
>     allow enabling it on all non-Windows platforms. (Paolo Bonzini)


I picked 1,2.
Waiting on updated doc patch to apply 3,4.

> v2->v3:
>   - Add a section to docs/interop/vhost-user.rst explaining how vhost-user
>     is supported on non-Linux platforms. (Stefan Hajnoczi)
> 
> Sergio Lopez (4):
>   event_notifier: add event_notifier_get_wfd()
>   vhost: use wfd on functions setting vring call fd
>   configure, meson: allow enabling vhost-user on all POSIX systems
>   docs: vhost-user: add subsection for non-Linux platforms
> 
>  configure                     |  4 ++--
>  docs/interop/vhost-user.rst   | 18 ++++++++++++++++++
>  hw/virtio/vhost.c             |  6 +++---
>  include/qemu/event_notifier.h |  1 +
>  meson.build                   |  2 +-
>  util/event_notifier-posix.c   |  5 +++++
>  6 files changed, 30 insertions(+), 6 deletions(-)
> 
> -- 
> 2.35.1
> 


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 0/4] Enable vhost-user to be used on BSD systems
@ 2022-03-04 10:38   ` Michael S. Tsirkin
  0 siblings, 0 replies; 20+ messages in thread
From: Michael S. Tsirkin @ 2022-03-04 10:38 UTC (permalink / raw)
  To: Sergio Lopez
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	Eric Farman, qemu-devel, Alex Williamson, kvm, qemu-block,
	David Hildenbrand, Halil Pasic, Christian Borntraeger, vgoyal,
	Thomas Huth, Richard Henderson, qemu-s390x, Stefan Hajnoczi,
	Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

On Thu, Mar 03, 2022 at 12:59:07PM +0100, Sergio Lopez wrote:
> Since QEMU is already able to emulate ioeventfd using pipefd, we're already
> pretty close to supporting vhost-user on non-Linux systems.
> 
> This two patches bridge the gap by:
> 
> 1. Adding a new event_notifier_get_wfd() to return wfd on the places where
>    the peer is expected to write to the notifier.
> 
> 2. Modifying the build system to it allows enabling vhost-user on BSD.
> 
> v1->v2:
>   - Drop: "Allow returning EventNotifier's wfd" (Alex Williamson)
>   - Add: "event_notifier: add event_notifier_get_wfd()" (Alex Williamson)
>   - Add: "vhost: use wfd on functions setting vring call fd"
>   - Rename: "Allow building vhost-user in BSD" to "configure, meson: allow
>     enabling vhost-user on all POSIX systems"
>   - Instead of making possible enabling vhost-user on Linux and BSD systems,
>     allow enabling it on all non-Windows platforms. (Paolo Bonzini)


I picked 1,2.
Waiting on updated doc patch to apply 3,4.

> v2->v3:
>   - Add a section to docs/interop/vhost-user.rst explaining how vhost-user
>     is supported on non-Linux platforms. (Stefan Hajnoczi)
> 
> Sergio Lopez (4):
>   event_notifier: add event_notifier_get_wfd()
>   vhost: use wfd on functions setting vring call fd
>   configure, meson: allow enabling vhost-user on all POSIX systems
>   docs: vhost-user: add subsection for non-Linux platforms
> 
>  configure                     |  4 ++--
>  docs/interop/vhost-user.rst   | 18 ++++++++++++++++++
>  hw/virtio/vhost.c             |  6 +++---
>  include/qemu/event_notifier.h |  1 +
>  meson.build                   |  2 +-
>  util/event_notifier-posix.c   |  5 +++++
>  6 files changed, 30 insertions(+), 6 deletions(-)
> 
> -- 
> 2.35.1
> 



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms
  2022-03-04 10:35     ` Michael S. Tsirkin
@ 2022-03-04 10:50       ` Sergio Lopez
  -1 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-04 10:50 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: qemu-devel, Christian Borntraeger, Alex Williamson,
	Cornelia Huck, Thomas Huth, Paolo Bonzini, Stefan Hajnoczi,
	David Hildenbrand, Elena Ufimtseva, kvm, Halil Pasic, Fam Zheng,
	John G Johnson, Richard Henderson, Matthew Rosato, Hanna Reitz,
	Philippe Mathieu-Daudé,
	qemu-s390x, vgoyal, Jagannathan Raman, Kevin Wolf, qemu-block,
	Eric Farman

[-- Attachment #1: Type: text/plain, Size: 2053 bytes --]

On Fri, Mar 04, 2022 at 05:35:01AM -0500, Michael S. Tsirkin wrote:
> On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote:
> > Add a section explaining how vhost-user is supported on platforms
> > other than Linux.
> > 
> > Signed-off-by: Sergio Lopez <slp@redhat.com>
> > ---
> >  docs/interop/vhost-user.rst | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
> > index edc3ad84a3..590a626b92 100644
> > --- a/docs/interop/vhost-user.rst
> > +++ b/docs/interop/vhost-user.rst
> > @@ -38,6 +38,24 @@ conventions <backend_conventions>`.
> >  *Master* and *slave* can be either a client (i.e. connecting) or
> >  server (listening) in the socket communication.
> >  
> > +Support for platforms other than Linux
> 
> 
> It's not just Linux - any platform without eventfd.
> 
> So I think we should have a section explaining that whereever
> spec says eventfd it can be a pipe if system does not
> support creating eventfd.

I'm confused. This is exactly what this subsection intends to do...

Thanks,
Sergio.

> > +--------------------------------------
> > +
> > +While vhost-user was initially developed targeting Linux, nowadays is
> > +supported on any platform that provides the following features:
> > +
> > +- The ability to share a mapping injected into the guest between
> > +  multiple processes, so both QEMU and the vhost-user daemon servicing
> > +  the device can access simultaneously the memory regions containing
> > +  the virtqueues and the data associated with each request.
> > +
> > +- AF_UNIX sockets with SCM_RIGHTS, so QEMU can communicate with the
> > +  vhost-user daemon and send it file descriptors when needed.
> > +
> > +- Either eventfd or pipe/pipe2. On platforms where eventfd is not
> > +  available, QEMU will automatically fallback to pipe2 or, as a last
> > +  resort, pipe.
> > +
> >  Message Specification
> >  =====================
> >  
> > -- 
> > 2.35.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms
@ 2022-03-04 10:50       ` Sergio Lopez
  0 siblings, 0 replies; 20+ messages in thread
From: Sergio Lopez @ 2022-03-04 10:50 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Elena Ufimtseva, Fam Zheng, Matthew Rosato, John G Johnson,
	Eric Farman, qemu-devel, Alex Williamson, kvm, qemu-block,
	David Hildenbrand, Halil Pasic, Christian Borntraeger, vgoyal,
	Thomas Huth, Richard Henderson, qemu-s390x, Stefan Hajnoczi,
	Jagannathan Raman, Kevin Wolf, Cornelia Huck,
	Philippe Mathieu-Daudé,
	Hanna Reitz, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 2053 bytes --]

On Fri, Mar 04, 2022 at 05:35:01AM -0500, Michael S. Tsirkin wrote:
> On Thu, Mar 03, 2022 at 12:59:11PM +0100, Sergio Lopez wrote:
> > Add a section explaining how vhost-user is supported on platforms
> > other than Linux.
> > 
> > Signed-off-by: Sergio Lopez <slp@redhat.com>
> > ---
> >  docs/interop/vhost-user.rst | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst
> > index edc3ad84a3..590a626b92 100644
> > --- a/docs/interop/vhost-user.rst
> > +++ b/docs/interop/vhost-user.rst
> > @@ -38,6 +38,24 @@ conventions <backend_conventions>`.
> >  *Master* and *slave* can be either a client (i.e. connecting) or
> >  server (listening) in the socket communication.
> >  
> > +Support for platforms other than Linux
> 
> 
> It's not just Linux - any platform without eventfd.
> 
> So I think we should have a section explaining that whereever
> spec says eventfd it can be a pipe if system does not
> support creating eventfd.

I'm confused. This is exactly what this subsection intends to do...

Thanks,
Sergio.

> > +--------------------------------------
> > +
> > +While vhost-user was initially developed targeting Linux, nowadays is
> > +supported on any platform that provides the following features:
> > +
> > +- The ability to share a mapping injected into the guest between
> > +  multiple processes, so both QEMU and the vhost-user daemon servicing
> > +  the device can access simultaneously the memory regions containing
> > +  the virtqueues and the data associated with each request.
> > +
> > +- AF_UNIX sockets with SCM_RIGHTS, so QEMU can communicate with the
> > +  vhost-user daemon and send it file descriptors when needed.
> > +
> > +- Either eventfd or pipe/pipe2. On platforms where eventfd is not
> > +  available, QEMU will automatically fallback to pipe2 or, as a last
> > +  resort, pipe.
> > +
> >  Message Specification
> >  =====================
> >  
> > -- 
> > 2.35.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-03-04 10:51 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 11:59 [PATCH v3 0/4] Enable vhost-user to be used on BSD systems Sergio Lopez
2022-03-03 11:59 ` Sergio Lopez
2022-03-03 11:59 ` [PATCH v3 1/4] event_notifier: add event_notifier_get_wfd() Sergio Lopez
2022-03-03 11:59   ` Sergio Lopez
2022-03-03 11:59 ` [PATCH v3 2/4] vhost: use wfd on functions setting vring call fd Sergio Lopez
2022-03-03 11:59   ` Sergio Lopez
2022-03-03 11:59 ` [PATCH v3 3/4] configure, meson: allow enabling vhost-user on all POSIX systems Sergio Lopez
2022-03-03 11:59   ` Sergio Lopez
2022-03-03 11:59 ` [PATCH v3 4/4] docs: vhost-user: add subsection for non-Linux platforms Sergio Lopez
2022-03-03 11:59   ` Sergio Lopez
2022-03-03 14:34   ` Stefan Hajnoczi
2022-03-03 14:34     ` Stefan Hajnoczi
2022-03-04 10:35   ` Michael S. Tsirkin
2022-03-04 10:35     ` Michael S. Tsirkin
2022-03-04 10:50     ` Sergio Lopez
2022-03-04 10:50       ` Sergio Lopez
2022-03-03 14:35 ` [PATCH v3 0/4] Enable vhost-user to be used on BSD systems Stefan Hajnoczi
2022-03-03 14:35   ` Stefan Hajnoczi
2022-03-04 10:38 ` Michael S. Tsirkin
2022-03-04 10:38   ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.