Re: [PATCH v4 3/4] vhost-user: add shared_object msg

2023-07-27 Thread Albert Esteve
On Mon, Jul 17, 2023 at 4:11 PM Michael S. Tsirkin wrote: > > > > > On Mon, Jul 17, 2023 at 01:42:02PM +0200, Albert Esteve wrote: > > Hi Michael, > > > > True. It may be a good idea to impose a limit in the number of entries > that can > > be added to

Re: [PATCH v4 3/4] vhost-user: add shared_object msg

2023-07-28 Thread Albert Esteve
On Thu, Jul 27, 2023 at 4:57 PM Michael S. Tsirkin wrote: > On Thu, Jul 27, 2023 at 04:48:30PM +0200, Albert Esteve wrote: > > > > > > On Mon, Jul 17, 2023 at 4:11 PM Michael S. Tsirkin > wrote: > > > > > > > > > > > > O

[PATCH v5 2/4] virtio-dmabuf: introduce virtio-dmabuf

2023-08-02 Thread Albert Esteve
vhost backends, the API stores the pointer to the backend holding the object. Suggested-by: Gerd Hoffmann Signed-off-by: Albert Esteve --- MAINTAINERS | 7 ++ hw/display/meson.build| 1 + hw/display/virtio-dmabuf.c| 136

[PATCH v5 4/4] vhost-user: refactor send_resp code

2023-08-02 Thread Albert Esteve
Refactor code to send response message so that all common parts both for the common REPLY_ACK case, and other data responses, can call it and avoid code repetition. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c | 36 +--- 1 file changed, 9 insertions

[PATCH v5 3/4] vhost-user: add shared_object msg

2023-08-02 Thread Albert Esteve
functions to allow sending messages to interact with the virtio shared objects hash table. The messages can only be sent after successfully negotiating a new VHOST_USER_PROTOCOL_F_SHARED_OBJECT vhost-user protocol feature bit. Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst

[PATCH v5 0/4] Virtio shared dma-buf

2023-08-02 Thread Albert Esteve
d83563ab401c890 [1] - https://lwn.net/Articles/828988/ [2] - https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-3730006 [3] - https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-10500011 Albert Esteve (4): uuid: add a hash function

[PATCH v5 1/4] uuid: add a hash function

2023-08-02 Thread Albert Esteve
Add hash function to uuid module using the djb2 hash algorithm. Add a couple simple unit tests for the hash function, checking collisions for similar UUIDs. Signed-off-by: Albert Esteve --- include/qemu/uuid.h| 2 ++ tests/unit/test-uuid.c | 27 +++ util/uuid.c

Re: [PATCH v4 2/5] hw/virtio: document SharedObject structures

2024-03-06 Thread Albert Esteve
On Tue, Feb 20, 2024 at 11:34 AM Manos Pitsidianakis < manos.pitsidiana...@linaro.org> wrote: > On Mon, 19 Feb 2024 16:34, Albert Esteve wrote: > >Change VirtioSharedObject value type from > >a generic pointer to a union storing the different > >supported underlyin

Re: [PATCH v3 1/3] hw/virtio: check owner for removing objects

2024-02-15 Thread Albert Esteve
On Mon, Feb 5, 2024 at 1:57 PM Alex Bennée wrote: > Albert Esteve writes: > > > Shared objects lack spoofing protection. > > For VHOST_USER_BACKEND_SHARED_OBJECT_REMOVE messages > > received by the vhost-user interface, any backend was > > allowed to remove entr

Re: [PATCH v3 2/3] hw/virtio: cleanup shared resources

2024-02-15 Thread Albert Esteve
On Tue, Feb 6, 2024 at 12:11 AM Alex Bennée wrote: > Albert Esteve writes: > > > Ensure that we cleanup all virtio shared > > resources when the vhost devices is cleaned > > up (after a hot unplug, or a crash). > > > > To do so, we add a new function

Re: [PATCH v3 2/3] hw/virtio: cleanup shared resources

2024-02-19 Thread Albert Esteve
On Thu, Feb 15, 2024 at 10:45 AM Albert Esteve wrote: > > > On Tue, Feb 6, 2024 at 12:11 AM Alex Bennée > wrote: > >> Albert Esteve writes: >> >> > Ensure that we cleanup all virtio shared >> > resources when the vhost devices is cleaned >>

Re: [PATCH v3 2/3] hw/virtio: cleanup shared resources

2024-02-19 Thread Albert Esteve
On Mon, Feb 19, 2024 at 11:45 AM Albert Esteve wrote: > > > > On Thu, Feb 15, 2024 at 10:45 AM Albert Esteve wrote: > >> >> >> On Tue, Feb 6, 2024 at 12:11 AM Alex Bennée >> wrote: >> >>> Albert Esteve writes: >>> >>> &

[PATCH v4 0/5] Virtio dmabuf improvements

2024-02-19 Thread Albert Esteve
ame virtio dmabuf functions to `virtio_dmabuf_*` Albert Esteve (5): hw/virtio: check owner for removing objects hw/virtio: document SharedObject structures hw/virtio: change dmabuf mutex to QemuMutex hw/virtio: cleanup shared resources hw/virtio: rename virtio dmabuf API docs/interop/vh

[PATCH v4 1/5] hw/virtio: check owner for removing objects

2024-02-19 Thread Albert Esteve
the table. To fix that, add a check for all *SHARED_OBJECT_REMOVE messages received. A vhost device can only remove TYPE_VHOST_DEV entries that are owned by them, otherwise skip the removal, and inform the device that the entry has not been removed in the answer. Signed-off-by: Albert Esteve

[PATCH v4 5/5] hw/virtio: rename virtio dmabuf API

2024-02-19 Thread Albert Esteve
Functions in the virtio-dmabuf module start with 'virtio_*', which is too generic and may not correctly identify them as part of the virtio dmabuf API. Rename all functions to 'virtio_dmabuf_*' instead to avoid confusion. Signed-off-by: Albert Esteve Acked-by: Stefan H

[PATCH v4 2/5] hw/virtio: document SharedObject structures

2024-02-19 Thread Albert Esteve
Change VirtioSharedObject value type from a generic pointer to a union storing the different supported underlying types, which makes naming less confusing. With the update, use the chance to add kdoc to both the SharedObjectType enum and VirtioSharedObject struct. Signed-off-by: Albert Esteve

[PATCH v4 3/5] hw/virtio: change dmabuf mutex to QemuMutex

2024-02-19 Thread Albert Esteve
: Albert Esteve --- hw/display/virtio-dmabuf.c| 55 +-- hw/virtio/virtio.c| 3 ++ include/hw/virtio/virtio-dmabuf.h | 5 +++ tests/unit/test-virtio-dmabuf.c | 5 +++ 4 files changed, 43 insertions(+), 25 deletions(-) diff --git a/hw/display

[PATCH v4 4/5] hw/virtio: cleanup shared resources

2024-02-19 Thread Albert Esteve
parameter. Also, add a test to verify that the new function in the API behaves as expected. Signed-off-by: Albert Esteve Acked-by: Stefan Hajnoczi --- hw/display/virtio-dmabuf.c| 21 hw/virtio/vhost.c | 3 +++ include/hw/virtio/virtio-dmabuf.h | 10

Re: [PATCH v3 0/3] Virtio dmabuf improvements

2024-02-05 Thread Albert Esteve
Friendly reminder & bump Is this series waiting to be picked up, or is there anything left to do? BR, Albert On Tue, Jan 9, 2024 at 1:56 PM Albert Esteve wrote: > v1: https://www.mail-archive.com/qemu-devel@nongnu.org/msg1005257.html > v2: https://www.mail-archive.com/qemu-devel@

Re: [PATCH v4 3/5] hw/virtio: change dmabuf mutex to QemuMutex

2024-03-11 Thread Albert Esteve
unction and call it from > >virtio.c, each time a new backend structure > >is initialised. > > > >Signed-off-by: Albert Esteve > >--- > > hw/display/virtio-dmabuf.c| 55 +-- > > hw/virtio/virtio.c| 3 +

Re: [PATCH v4 0/5] Virtio dmabuf improvements

2024-03-13 Thread Albert Esteve
On Tue, Mar 12, 2024 at 7:23 PM Michael S. Tsirkin wrote: > On Mon, Feb 19, 2024 at 03:34:18PM +0100, Albert Esteve wrote: > > v1: https://www.mail-archive.com/qemu-devel@nongnu.org/msg1005257.html > > v2: https://www.mail-archive.com/qemu-devel@nongnu.org/msg1014615.html > &

Re: [PATCH 1/4] virtio-dmabuf: introduce virtio-dmabuf

2023-05-09 Thread Albert Esteve
On Mon, May 8, 2023 at 3:12 PM Cornelia Huck wrote: > On Wed, May 03 2023, Albert Esteve wrote: > > > This API manages objects (in this iteration, > > dmabuf fds) that can be shared along different > > virtio devices. > > > > The API allows the differe

Re: [PATCH 4/4] libvhost-user: add write_msg cb to dev struct

2023-05-09 Thread Albert Esteve
Hi! On Tue, May 9, 2023 at 12:12 PM Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > Hi > > On Wed, May 3, 2023 at 12:21 PM Albert Esteve wrote: > >> Add vu_write_msg_cb type as a member of the VuDev >> struct. >> >> In order to interact

Re: [PATCH 1/4] virtio-dmabuf: introduce virtio-dmabuf

2023-05-09 Thread Albert Esteve
On Tue, May 9, 2023 at 12:53 PM Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > Hi > > On Wed, May 3, 2023 at 12:21 PM Albert Esteve wrote: > >> This API manages objects (in this iteration, >> dmabuf fds) that can be shared along different >> virt

Re: [PATCH 4/4] libvhost-user: add write_msg cb to dev struct

2023-05-10 Thread Albert Esteve
On Tue, May 9, 2023 at 2:53 PM Marc-André Lureau wrote: > Hi > > On Tue, May 9, 2023 at 3:17 PM Albert Esteve wrote: > >> >> Hi! >> >> On Tue, May 9, 2023 at 12:12 PM Marc-André Lureau < >> marcandre.lur...@gmail.com> wrote: >> >&g

Re: [PATCH 1/4] virtio-dmabuf: introduce virtio-dmabuf

2023-05-17 Thread Albert Esteve
On Tue, May 9, 2023 at 2:57 PM Marc-André Lureau wrote: > Hi > > On Tue, May 9, 2023 at 4:53 PM Albert Esteve wrote: > >> >> >> On Tue, May 9, 2023 at 12:53 PM Marc-André Lureau < >> marcandre.lur...@gmail.com> wrote: >> >>> Hi >>

[PATCH v2 0/4] Virtio shared dma-buf

2023-05-18 Thread Albert Esteve
.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-10500011 Albert Esteve (4): uuid: add hash_func and equal_func virtio-dmabuf: introduce virtio-dmabuf vhost-user: add shared_object msg vhost-user: refactor send_resp code MAINTAINERS | 7 ++ docs/i

[PATCH v2 2/4] virtio-dmabuf: introduce virtio-dmabuf

2023-05-18 Thread Albert Esteve
Signed-off-by: Albert Esteve --- MAINTAINERS | 7 ++ hw/display/meson.build| 1 + hw/display/virtio-dmabuf.c| 82 ++ include/hw/virtio/virtio-dmabuf.h | 59 tests/unit/meson.build| 1 + tests/unit

[PATCH v2 3/4] vhost-user: add shared_object msg

2023-05-18 Thread Albert Esteve
the payload struct. In the libvhost-user library add helper functions to allow sending messages to interact with the virtio shared objects hash table. Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 15 hw/virtio/vhost-user.c| 68

[PATCH v2 4/4] vhost-user: refactor send_resp code

2023-05-18 Thread Albert Esteve
Refactor code to send response message so that all common parts both for the common REPLY_ACK case, and other data responses, can call it and avoid code repetition. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c | 52 +++--- 1 file changed, 24

[PATCH v2 1/4] uuid: add hash_func and equal_func

2023-05-18 Thread Albert Esteve
Add hash and an equal function to uuid module. Add a couple simple unit tests for new functions, checking collisions for similar UUIDs in the case of the hash function, and comparing generated UUIDs for the equal function. Signed-off-by: Albert Esteve --- include/qemu/uuid.h| 4

[PATCH 4/4] libvhost-user: add write_msg cb to dev struct

2023-05-03 Thread Albert Esteve
replication, backends will need the write_msg method to be exposed to them, similarly to how the read_msg is for receiving messages. Signed-off-by: Albert Esteve --- subprojects/libvhost-user/libvhost-user.c | 1 + subprojects/libvhost-user/libvhost-user.h | 16 2 files changed, 17

[PATCH 2/4] vhost-user: add shared_object msg

2023-05-03 Thread Albert Esteve
: Albert Esteve --- docs/interop/vhost-user.rst | 15 + hw/virtio/vhost-user.c| 68 +++ subprojects/libvhost-user/libvhost-user.c | 39 + subprojects/libvhost-user/libvhost-user.h | 30 ++ 4 files changed, 152 insertions

[PATCH 3/4] vhost-user: refactor send_resp code

2023-05-03 Thread Albert Esteve
Refactor code to send response message so that all common parts both for the common REPLY_ACK case, and other data responses, can call it and avoid code repetition. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c | 52 +++--- 1 file changed, 24

[PATCH 1/4] virtio-dmabuf: introduce virtio-dmabuf

2023-05-03 Thread Albert Esteve
This API manages objects (in this iteration, dmabuf fds) that can be shared along different virtio devices. The API allows the different devices to add, remove and/or retrieve the objects by simply invoking the public functions that reside in the virtio-dmabuf file. Signed-off-by: Albert Esteve

[PATCH 0/4] Virtio shared dma-buf

2023-05-03 Thread Albert Esteve
-v1.2-csd01.html#x1-10500011 Albert Esteve (4): virtio-dmabuf: introduce virtio-dmabuf vhost-user: add shared_object msg vhost-user: refactor send_resp code libvhost-user: add write_msg cb to dev struct docs/interop/vhost-user.rst | 15 +++ hw/display/meson.build

Re: [PATCH v2 1/4] uuid: add hash_func and equal_func

2023-05-22 Thread Albert Esteve
On Sat, May 20, 2023 at 9:36 AM Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > Hi > > On Thu, May 18, 2023 at 4:03 PM Albert Esteve wrote: > >> Add hash and an equal function to uuid module. >> >> Add a couple simple unit tests for new functions

Re: [PATCH v2 1/4] uuid: add hash_func and equal_func

2023-05-22 Thread Albert Esteve
On Mon, May 22, 2023 at 3:13 PM Albert Esteve wrote: > > > > On Sat, May 20, 2023 at 9:36 AM Marc-André Lureau < > marcandre.lur...@gmail.com> wrote: > >> Hi >> >> On Thu, May 18, 2023 at 4:03 PM Albert Esteve wrote: >> >>> Add hash a

[PATCH v3 0/4] Virtio shared dma-buf

2023-05-24 Thread Albert Esteve
1.2/csd01/virtio-v1.2-csd01.html#x1-10500011 Albert Esteve (4): uuid: add hash_func and equal_func virtio-dmabuf: introduce virtio-dmabuf vhost-user: add shared_object msg vhost-user: refactor send_resp code MAINTAINERS | 7 ++ docs/interop/vhost

[PATCH v3 2/4] virtio-dmabuf: introduce virtio-dmabuf

2023-05-24 Thread Albert Esteve
Signed-off-by: Albert Esteve --- MAINTAINERS | 7 ++ hw/display/meson.build| 1 + hw/display/virtio-dmabuf.c| 90 include/hw/virtio/virtio-dmabuf.h | 59 tests/unit/meson.build| 1 + tests/unit

[PATCH v3 3/4] vhost-user: add shared_object msg

2023-05-24 Thread Albert Esteve
the payload struct. In the libvhost-user library add helper functions to allow sending messages to interact with the virtio shared objects hash table. Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 15 hw/virtio/vhost-user.c| 68

[PATCH v3 4/4] vhost-user: refactor send_resp code

2023-05-24 Thread Albert Esteve
Refactor code to send response message so that all common parts both for the common REPLY_ACK case, and other data responses, can call it and avoid code repetition. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c | 52 +++--- 1 file changed, 24

[PATCH v3 1/4] uuid: add hash_func and equal_func

2023-05-24 Thread Albert Esteve
Add hash and an equal function to uuid module. Add a couple simple unit tests for new functions, checking collisions for similar UUIDs in the case of the hash function, and comparing generated UUIDs for the equal function. Signed-off-by: Albert Esteve --- include/qemu/uuid.h| 2 ++ tests

[PATCH 03/12] vhost-user-video: boiler plate code for vhost-user-video device

2023-03-22 Thread Albert Esteve
From: Peter Griffin Signed-off-by: Peter Griffin Signed-off-by: Albert Esteve --- hw/display/Kconfig | 5 + hw/display/meson.build | 3 + hw/display/vhost-user-video.c| 410 +++ include/hw/virtio/vhost-user-video.h | 42

[PATCH 00/12] [RFC PATCHv2] Add vhost-user Video decode

2023-03-22 Thread Albert Esteve
r.c Albert Esteve (5): vhost-user.json: add video type tests/qtest: add virtio-video test vhost-user-video: add dev_type to CLI vhost-user-video-udmabuf: add udmabuf helpers Add support for v4l2_memory_dmabuf Peter Griffin (7): docs: Add a vhost-virtio-video rst file MAINTAINERS:

[PATCH 07/12] vhost-user.json: add video type

2023-03-22 Thread Albert Esteve
Signed-off-by: Albert Esteve --- docs/interop/vhost-user.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/interop/vhost-user.json b/docs/interop/vhost-user.json index b6ade9e493..8c6c1ba400 100644 --- a/docs/interop/vhost-user.json +++ b/docs/interop/vhost-user.json @@ -31,6 +31,7

[PATCH 09/12] tests/qtest: add virtio-video test

2023-03-22 Thread Albert Esteve
Add some minimal testing of the vhost-user-video backend similar to what is tested for other vhost-user devices. For now it only stresses the backend instantiation and some message passing through the control socket. Signed-off-by: Albert Esteve --- tests/qtest/libqos/meson.build| 1

[PATCH 12/12] Add support for v4l2_memory_dmabuf

2023-03-22 Thread Albert Esteve
buffers between different devices, we store the UUID and keep buffers associated to them in a hash table. Signed-off-by: Albert Esteve --- tools/vhost-user-video/v4l2_backend.c | 118 +++--- tools/vhost-user-video/v4l2_backend.h | 9 +- tools/vhost-user-video/vhost-user

[PATCH 10/12] vhost-user-video: add dev_type to CLI

2023-03-22 Thread Albert Esteve
Add dev_type to the command line interface. This way we can select dev_type=encoder or dev_type=decoder and assign the virtio ID appropiately. If ommited, default virtio ID used is decoder's ID. Example: -device vhost-user-video-pci,chardev=video,dev_type=encoder,id=video Signed-off-by: A

[PATCH 06/12] hw/display: add vhost-user-video-pci

2023-03-22 Thread Albert Esteve
From: Peter Griffin Add boiler plate code for vhost-user-video-pci. Example -device vhost-user-video-pci,chardev=video,id=video -chardev socket,path=video.sock,id=video Signed-off-by: Peter Griffin Message-Id: <20211209145601.331477-8-peter.grif...@linaro.org> --- hw/display/vhost-user-video-

[PATCH 02/12] MAINTAINERS: Add virtio-video section

2023-03-22 Thread Albert Esteve
From: Peter Griffin Add myself as maintainer of the virtio-video files added in this series. Signed-off-by: Peter Griffin Signed-off-by: Albert Esteve --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9b56ccdd92..c6cc04c4f7 100644

[PATCH 08/12] tools/vhost-user-video: Add initial vhost-user-video vmm

2023-03-22 Thread Albert Esteve
2] https://lwn.net/Articles/760650/ Signed-off-by: Peter Griffin Signed-off-by: Albert Esteve --- tools/vhost-user-video/50-qemu-video.json.in |5 + tools/vhost-user-video/meson.build| 10 + tools/vhost-user-video/v4l2_backend.c | 1752 tools/vhost-us

[PATCH 11/12] vhost-user-video-udmabuf: add udmabuf helpers

2023-03-22 Thread Albert Esteve
Add helper for handling user-created DMA buffers through the udmabuf device. Buffers are stored in a hash table and associated to an UUID, so that they can be looked up later from the backend. Signed-off-by: Albert Esteve --- tools/vhost-user-video/meson.build| 2 +- tools/vhost

[PATCH 01/12] docs: Add a vhost-virtio-video rst file

2023-03-22 Thread Albert Esteve
From: Peter Griffin Add rst file with a brief description of the daemon and a cheat sheet of commands. Signed-off-by: Peter Griffin Signed-off-by: Albert Esteve --- docs/system/devices/vhost-user-video.rst | 124 +++ 1 file changed, 124 insertions(+) create mode 100644

[PATCH 04/12] vhost-user-video: add meson subdir build logic

2023-03-22 Thread Albert Esteve
From: Peter Griffin Signed-off-by: Peter Griffin Signed-off-by: Albert Esteve --- tools/meson.build | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/meson.build b/tools/meson.build index e69de29bb2..737f7dc140 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -0,0 +1,7

[PATCH 05/12] standard-headers: Add virtio_video.h

2023-03-22 Thread Albert Esteve
From: Peter Griffin Signed-off-by: Peter Griffin Message-Id: <20211209145601.331477-6-peter.grif...@linaro.org> --- include/standard-headers/linux/virtio_video.h | 513 ++ 1 file changed, 513 insertions(+) create mode 100644 include/standard-headers/linux/virtio_video.h diff -

Re: [PATCH 02/12] MAINTAINERS: Add virtio-video section

2023-03-22 Thread Albert Esteve
On Wed, Mar 22, 2023 at 3:46 PM Thomas Huth wrote: > On 22/03/2023 15.21, Albert Esteve wrote: > > From: Peter Griffin > > > > Add myself as maintainer of the virtio-video files added > > in this series. > > > > Signed-off-by: Peter Gr

Re: [RFC PATCH 1/1] vhost-user: add shmem mmap request

2024-06-26 Thread Albert Esteve
Hi Stefan, On Wed, Jun 5, 2024 at 4:28 PM Stefan Hajnoczi wrote: > On Wed, Jun 05, 2024 at 10:13:32AM +0200, Albert Esteve wrote: > > On Tue, Jun 4, 2024 at 8:54 PM Stefan Hajnoczi > wrote: > > > > > On Thu, May 30, 2024 at 05:22:23PM +0200, Albert Esteve wrote:

[RFC PATCH v2 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-06-28 Thread Albert Esteve
space. The device model needs to create MemoryRegion instances for the VIRTIO Shared Memory Regions and add them to the `VirtIODevice` instance. Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 27 + hw/virtio/vhost-user.c| 122

[RFC PATCH v2 3/5] vhost-user-dev: Add cache BAR

2024-06-28 Thread Albert Esteve
VHOST_USER_PROTOCOL_F_SHMEM feature is not supported by the backend, there is no cache. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user-base.c | 39 +-- hw/virtio/vhost-user-device-pci.c | 37 ++--- 2 files changed, 71 insertions(+), 5

[RFC PATCH v2 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-06-28 Thread Albert Esteve
ils. Albert Esteve (5): vhost-user: Add VIRTIO Shared Memory map request vhost_user: Add frontend command for shmem config vhost-user-dev: Add cache BAR vhost_user: Add MEM_READ/WRITE backend requests vhost_user: Implement mem_read/mem_write handlers docs/interop/vhost-user.

[RFC PATCH v2 5/5] vhost_user: Implement mem_read/mem_write handlers

2024-06-28 Thread Albert Esteve
Implement function handlers for memory read and write operations. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 18cacb2d68

[RFC PATCH v2 4/5] vhost_user: Add MEM_READ/WRITE backend requests

2024-06-28 Thread Albert Esteve
-by: Albert Esteve --- hw/virtio/vhost-user.c| 31 + subprojects/libvhost-user/libvhost-user.c | 84 +++ subprojects/libvhost-user/libvhost-user.h | 38 ++ 3 files changed, 153 insertions(+) diff --git a/hw/virtio/vhost-user.c b/hw/virtio

[RFC PATCH v2 2/5] vhost_user: Add frontend command for shmem config

2024-06-28 Thread Albert Esteve
`vhost-user-device` case. Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 31 +++ hw/virtio/vhost-user.c| 42 +++ include/hw/virtio/vhost-backend.h | 6 + include/hw/virtio/vhost-user.h| 1 + 4 files

[RFC PATCH 1/1] vhost-user: add shmem mmap request

2024-05-30 Thread Albert Esteve
: Albert Esteve --- docs/interop/vhost-user.rst | 23 hw/virtio/vhost-user.c | 106 hw/virtio/virtio.c | 2 + include/hw/virtio/virtio.h | 3 + 4 files changed, 134 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop

[RFC PATCH 0/1] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-05-30 Thread Albert Esteve
regions to the list, so that the devices can use them. But I wanted to gather some feedback before refining it further, as I am probably missing some required steps/or security concerns that I am not taking into account. Albert Esteve (1): vhost-user: add shmem mmap request docs/interop/vhost

Re: [RFC PATCH 0/1] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-06-05 Thread Albert Esteve
On Tue, Jun 4, 2024 at 8:16 PM Stefan Hajnoczi wrote: > On Thu, May 30, 2024 at 05:22:22PM +0200, Albert Esteve wrote: > > Hi all, > > > > This is an early attempt to have backends > > support dynamic fd mapping into shared > > memory regions. As such, the

Re: [RFC PATCH 1/1] vhost-user: add shmem mmap request

2024-06-05 Thread Albert Esteve
On Tue, Jun 4, 2024 at 8:54 PM Stefan Hajnoczi wrote: > On Thu, May 30, 2024 at 05:22:23PM +0200, Albert Esteve wrote: > > Add SHMEM_MAP/UNMAP requests to vhost-user. > > > > This request allows backends to dynamically map > > fds into a shared memory region indentif

Re: [RFC PATCH 0/1] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-06-05 Thread Albert Esteve
On Wed, Jun 5, 2024 at 1:16 PM Stefan Hajnoczi wrote: > On Wed, Jun 05, 2024 at 09:24:36AM +0200, Albert Esteve wrote: > > On Tue, Jun 4, 2024 at 8:16 PM Stefan Hajnoczi > wrote: > > > > > On Thu, May 30, 2024 at 05:22:22PM +0200, Albert Esteve wrote: > > >

Re: [RFC PATCH v2 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-03 Thread Albert Esteve
Hello all, Sorry, I have been a bit disconnected from this thread as I was on vacations and then had to switch tasks for a while. I will try to go through all comments and address them for the first non-RFC drop of this patch series. But I was discussing with some colleagues on this. So turns ou

Re: [RFC PATCH v2 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-09-03 Thread Albert Esteve
On Thu, Jul 11, 2024 at 9:45 AM Stefan Hajnoczi wrote: > On Fri, Jun 28, 2024 at 04:57:06PM +0200, Albert Esteve wrote: > > Add SHMEM_MAP/UNMAP requests to vhost-user to > > handle VIRTIO Shared Memory mappings. > > > > This request allows backends to dynamically map &

Re: [RFC PATCH v2 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-09-03 Thread Albert Esteve
On Tue, Sep 3, 2024 at 11:54 AM Albert Esteve wrote: > > > On Thu, Jul 11, 2024 at 9:45 AM Stefan Hajnoczi > wrote: > >> On Fri, Jun 28, 2024 at 04:57:06PM +0200, Albert Esteve wrote: >> > Add SHMEM_MAP/UNMAP requests to vhost-user to >> > handle VIRTIO

Re: [RFC PATCH v2 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-09-04 Thread Albert Esteve
On Thu, Jul 11, 2024 at 9:45 AM Stefan Hajnoczi wrote: > On Fri, Jun 28, 2024 at 04:57:06PM +0200, Albert Esteve wrote: > > Add SHMEM_MAP/UNMAP requests to vhost-user to > > handle VIRTIO Shared Memory mappings. > > > > This request allows backends to dynamically map &

Re: [RFC PATCH v2 2/5] vhost_user: Add frontend command for shmem config

2024-09-04 Thread Albert Esteve
On Thu, Jul 11, 2024 at 10:10 AM Stefan Hajnoczi wrote: > On Fri, Jun 28, 2024 at 04:57:07PM +0200, Albert Esteve wrote: > > The frontend can use this command to retrieve > > VIRTIO Shared Memory Regions configuration from > > the backend. The response contains the number

Re: [RFC PATCH v2 3/5] vhost-user-dev: Add cache BAR

2024-09-04 Thread Albert Esteve
On Thu, Jul 11, 2024 at 10:25 AM Stefan Hajnoczi wrote: > On Fri, Jun 28, 2024 at 04:57:08PM +0200, Albert Esteve wrote: > > Add a cache BAR in the vhost-user-device > > into which files can be directly mapped. > > > > The number, shmid, and size of the VIRTIO Shar

Re: [RFC PATCH v2 5/5] vhost_user: Implement mem_read/mem_write handlers

2024-09-04 Thread Albert Esteve
On Thu, Jul 11, 2024 at 10:55 AM Stefan Hajnoczi wrote: > On Fri, Jun 28, 2024 at 04:57:10PM +0200, Albert Esteve wrote: > > Implement function handlers for memory read and write > > operations. > > > > Signed-off-by: Albert Esteve > > ---

Re: [RFC PATCH v2 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-06 Thread Albert Esteve
On Thu, Sep 5, 2024 at 6:39 PM Stefan Hajnoczi wrote: > On Tue, Sep 03, 2024 at 10:42:34AM +0200, Albert Esteve wrote: > > Hello all, > > > > Sorry, I have been a bit disconnected from this thread as I was on > > vacations and then had to switch tasks for a whil

Re: [RFC PATCH v2 5/5] vhost_user: Implement mem_read/mem_write handlers

2024-09-10 Thread Albert Esteve
On Thu, Sep 5, 2024 at 9:18 PM Stefan Hajnoczi wrote: > On Wed, Sep 04, 2024 at 03:01:06PM +0200, Albert Esteve wrote: > > On Thu, Jul 11, 2024 at 10:55 AM Stefan Hajnoczi > > wrote: > > > > > On Fri, Jun 28, 2024 at 04:57:10PM +0200, Albert Esteve wrote: > >

Re: [RFC PATCH v2 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-09-11 Thread Albert Esteve
On Thu, Sep 5, 2024 at 6:45 PM Stefan Hajnoczi wrote: > On Tue, Sep 03, 2024 at 01:54:12PM +0200, Albert Esteve wrote: > > On Tue, Sep 3, 2024 at 11:54 AM Albert Esteve > wrote: > > > > > > > > > > > On Thu, Jul 11, 2024 at 9:45 AM Stefan Hajnoczi &

[PATCH 2/3] vhost_user.rst: Align VhostUserMsg excerpt members

2024-09-12 Thread Albert Esteve
Add missing VhostUserShared and VhostUserTransferDeviceState members to the VhostUserMsg excerpt in the vhost-user spec documentation. Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop

[PATCH 1/3] vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec

2024-09-12 Thread Albert Esteve
Add SHMEM_MAP/_UNMAP request to the vhost-user spec documentation. Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 31 +++ 1 file changed, 31 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index d8419fd2f1

[PATCH 3/3] vhost_user.rst: Add GET_SHMEM_CONFIG message

2024-09-12 Thread Albert Esteve
Add GET_SHMEM_CONFIG vhost-user frontend message to the spec documentation. Signed-off-by: Albert Esteve --- docs/interop/vhost-user.rst | 39 + 1 file changed, 39 insertions(+) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index

[PATCH 0/3] Document SHMEM vhost-user requests

2024-09-12 Thread Albert Esteve
ir systems. This is such documentation-only patch. [1] - https://lore.kernel.org/all/20240628145710.1516121-1-aest...@redhat.com/T/ Albert Esteve (3): vhost_user.rst: Add SHMEM_MAP/_UNMAP to spec vhost_user.rst: Align VhostUserMsg excerpt members vhost_user.rst: Add GET_SHMEM_CONFIG mess

[PATCH v3 1/5] vhost-user: Add VIRTIO Shared Memory map request

2024-09-12 Thread Albert Esteve
space. The device model needs to create MemoryRegion instances for the VIRTIO Shared Memory Regions and add them to the `VirtIODevice` instance. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c| 122 ++ hw/virtio/virtio.c| 13

[PATCH v3 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-12 Thread Albert Esteve
ing a descriptor that references a mapping to another backend. The first backend will not be able to see these mappings. So these requests are a fallback for vhost-user memory translation fails. Albert Esteve (5): vhost-user: Add VIRTIO Shared Memory map request virtio: Track shared mem

[PATCH v3 5/5] vhost_user: Add MEM_READ/WRITE backend requests

2024-09-12 Thread Albert Esteve
/WRITE requests have flexible array members, since we do not know in advance the number of bytes in the mapped region. Therefore, we need to allow bigger message sizes for these types, and ensure we allocate sufficient memory for them. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c

[PATCH v3 4/5] vhost-user-dev: Add cache BAR

2024-09-12 Thread Albert Esteve
VHOST_USER_PROTOCOL_F_SHMEM feature is not supported by the backend, there is no cache. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user-base.c | 37 +++-- hw/virtio/vhost-user-device-pci.c | 39 --- 2 files changed, 71 insertions(+), 5

[PATCH v3 2/5] virtio: Track shared memory mappings

2024-09-12 Thread Albert Esteve
Update shmem_list to be able to track active mappings on VIRTIO shared memory regions. This allows to verify that new mapping request received from backends do not overlap. If they do, the request shall fail in order to adhere to the specs. Signed-off-by: Albert Esteve --- hw/virtio/vhost

[PATCH v3 3/5] vhost_user: Add frontend command for shmem config

2024-09-12 Thread Albert Esteve
`vhost-user-device` case. Signed-off-by: Albert Esteve --- hw/virtio/vhost-user.c| 45 +++ include/hw/virtio/vhost-backend.h | 6 + include/hw/virtio/vhost-user.h| 1 + 3 files changed, 52 insertions(+) diff --git a/hw/virtio/vhost-user.c b/hw

Re: [PATCH 0/3] Document SHMEM vhost-user requests

2024-09-12 Thread Albert Esteve
Link to the implementation: https://lore.kernel.org/all/20240912145335.129447-1-aest...@redhat.com/T/#t On Thu, Sep 12, 2024 at 4:44 PM Albert Esteve wrote: > As a continuation of the > "Add SHMEM_MAP/UNMAP requests" patch [1], > I wanted to split vhost-user spec > parts

Re: [PATCH v3 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-12 Thread Albert Esteve
Link to the documentation: https://lore.kernel.org/all/20240912144432.126717-1-aest...@redhat.com/T/#t On Thu, Sep 12, 2024 at 4:53 PM Albert Esteve wrote: > Hi all, > > v2->v3: > - Add track for mapped memory in VIRTIO > Shared memory regions, so that boundaries > c

Re: [PATCH v3 0/5] vhost-user: Add SHMEM_MAP/UNMAP requests

2024-09-17 Thread Albert Esteve
On Mon, Sep 16, 2024 at 7:57 PM Stefan Hajnoczi wrote: > This patch series could use tests. The first two patches seem broken and > testing would have revealed that the memory allocation and pointers are > not quite right. > My bad. Previous version of the patch I did test with a device that I'v

Re: [PATCH v8 1/4] util/uuid: add a hash function

2023-10-01 Thread Albert Esteve
On Sun, Oct 1, 2023 at 10:15 PM Michael S. Tsirkin wrote: > On Fri, Sep 08, 2023 at 05:47:40PM +0200, Albert Esteve wrote: > > Add hash function to uuid module using the > > djb2 hash algorithm. > > > > Add a couple simple unit tests for the hash > > function

[PATCH v9 2/4] hw/display: introduce virtio-dmabuf

2023-10-01 Thread Albert Esteve
vhost backends, the API stores the pointer to the backend holding the object. Suggested-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Albert Esteve --- MAINTAINERS | 7 ++ hw/display/meson.build| 1 + hw/display/virtio-dmabuf.c

[PATCH v9 1/4] util/uuid: add a hash function

2023-10-01 Thread Albert Esteve
Add hash function to uuid module using the djb2 hash algorithm. Add a couple simple unit tests for the hash function, checking collisions for similar UUIDs. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Albert Esteve --- include/qemu/uuid.h| 2 ++ tests/unit/test-uuid.c | 27

[PATCH v9 4/4] libvhost-user: handle shared_object msg

2023-10-01 Thread Albert Esteve
In the libvhost-user library we need to handle VHOST_USER_GET_SHARED_OBJECT requests, and add helper functions to allow sending messages to interact with the virtio shared objects hash table. Signed-off-by: Albert Esteve --- subprojects/libvhost-user/libvhost-user.c | 120

[PATCH v9 3/4] vhost-user: add shared_object msg

2023-10-01 Thread Albert Esteve
negotiating a new VHOST_USER_PROTOCOL_F_SHARED_OBJECT vhost-user protocol feature bit. Finally, refactor code to send response message so that all common parts both for the common REPLY_ACK case, and other data responses, can call it and avoid code repetition. Signed-off-by: Albert Esteve --- docs

[PATCH v9 0/4] Virtio shared dma-buf

2023-10-01 Thread Albert Esteve
1/virtio-v1.2-csd01.html#x1-10500011 Albert Esteve (4): util/uuid: add a hash function hw/display: introduce virtio-dmabuf vhost-user: add shared_object msg libvhost-user: handle shared_object msg MAINTAINERS | 7 + docs/interop/vhost-user.rst

Re: [PATCH] hw/virtio/vhost: check nvqs at dev_start

2023-10-02 Thread Albert Esteve
consistent and print the error number. On Mon, Oct 2, 2023 at 11:27 AM Michael S. Tsirkin wrote: > On Fri, Sep 01, 2023 at 02:23:23PM +0200, Albert Esteve wrote: > > While this is not expected to happen, it could still > > be that a vhost_dev did not set its nvqs member

Re: [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID

2023-09-14 Thread Albert Esteve
On Thu, Sep 14, 2023 at 9:17 AM Akihiko Odaki wrote: > On 2023/09/13 23:18, Albert Esteve wrote: > > > > > > On Wed, Sep 13, 2023 at 3:43 PM Akihiko Odaki > <mailto:akihiko.od...@daynix.com>> wrote: > > > > On 2023/09/13 21:58, Albert Esteve w

  1   2   3   >