[PATCH v6] tests/functional: add a vfio-user smoke test

2025-09-11 Thread John Levon
From: Mark Cave-Ayland Add a basic test of the vfio-user PCI client implementation. Co-authored-by: John Levon Signed-off-by: Mark Cave-Ayland Signed-off-by: John Levon --- MAINTAINERS | 1 + tests/functional/x86_64/meson.build | 1

Re: [PATCH v5] tests/functional: add a vfio-user smoke test

2025-09-11 Thread John Levon
On Thu, Sep 11, 2025 at 05:27:24PM +0200, Thomas Huth wrote: > I'm not a python expert, but I guess it would make sense to move that > description block next to the "class VfioUserClient(QemuSystemTest):" line > so that it's the description for the class? (that would fix the "Missing > class docst

[PATCH v5] tests/functional: add a vfio-user smoke test

2025-09-11 Thread John Levon
From: Mark Cave-Ayland Add a basic test of the vfio-user PCI client implementation. Co-authored-by: John Levon Signed-off-by: Mark Cave-Ayland Signed-off-by: John Levon --- MAINTAINERS | 1 + tests/functional/x86_64/meson.build | 1

Re: [PATCH v4 3/3] tests/functional: add a vfio-user smoke test

2025-09-09 Thread John Levon
On Mon, Sep 08, 2025 at 03:42:35PM +0100, Daniel P. Berrangé wrote: > ...but no using of -snapshot here, so copying the asset would be > required? > > Can we just use -snapshot in both cases & avoid the copying ? Yes; thanks. > > +def setup_vfio_user_pci_server(self, server_vm): > > +

[PATCH v4 0/3] vfio-user client functional test

2025-09-04 Thread John Levon
Add a basic functional test for the vfio-user client, along with a couple of test framework extensions to support it. v4: generalize the test so it's less sensitive to build/environment John Levon (2): tests/functional: return output from cmd.py helpers tests/functional: add vm par

[PATCH v4 1/3] tests/functional: return output from cmd.py helpers

2025-09-03 Thread John Levon
Tests might want to look at the whole output from a command execution, as well as just logging it. Add support for this. Signed-off-by: John Levon --- tests/functional/qemu_test/cmd.py | 53 +-- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/tests

[PATCH v4 2/3] tests/functional: add vm param to cmd.py helpers

2025-09-03 Thread John Levon
Extend the "vm" parameter of wait_for_console_pattern() to all the other utility functions; this allows them to be used on a VM other than test.vm. Signed-off-by: John Levon --- tests/functional/qemu_test/cmd.py | 18 -- 1 file changed, 12 insertions(+), 6 deletion

[PATCH v4 3/3] tests/functional: add a vfio-user smoke test

2025-09-03 Thread John Levon
From: Mark Cave-Ayland Add a basic test of the vfio-user PCI client implementation. Co-authored-by: John Levon Signed-off-by: Mark Cave-Ayland Signed-off-by: John Levon --- MAINTAINERS | 1 + tests/functional/x86_64/meson.build | 1

Re: [PATCH 2/4] docs/system: unify the naming style for VirtIO devices

2025-09-03 Thread John Levon
On Tue, Sep 02, 2025 at 05:50:46PM +0100, Alex Bennée wrote: > This makes the index look a little neater. > > Signed-off-by: Alex Bennée Reviewed-by: John Levon regards john

Re: [PATCH v3 0/3] vfio-user client functional test

2025-09-03 Thread John Levon
On Tue, Sep 02, 2025 at 11:25:46AM +0200, Cédric Le Goater wrote: > On 8/28/25 12:05, John Levon wrote: > > Add a basic functional test for the vfio-user client, along with a couple of > > test framework extensions to support it. > > > > John Levon (2): > >

Re: [PATCH 1/4] docs/system: split VirtIO devices from the rest

2025-09-03 Thread John Levon
; references appropriately. > > Add a short preface to the VirtIO section nudging users to use VirtIO > unless they specifically want a particular piece of hardware > emulation. > > Signed-off-by: Alex Bennée Reviewed-by: John Levon regards john

Re: [PATCH 3/4] docs/system: drop vhost-user-rng docs

2025-09-02 Thread John Levon
On Tue, Sep 02, 2025 at 05:50:47PM +0100, Alex Bennée wrote: > This is a fairly lightweight document which doesn't add much to the > general advice in vhost-user. Update the vhost-user docs to point > directly at the rust-vmm repo. > > Signed-off-by: Alex Bennée Rev

Re: [PATCH 09/22] vfio/container.c: use QOM casts where appropriate

2025-08-28 Thread John Levon
On Thu, Aug 28, 2025 at 04:14:06PM +0100, Mark Cave-Ayland wrote: > On 15/07/2025 15:13, John Levon wrote: > > > On Tue, Jul 15, 2025 at 10:25:49AM +0100, Mark Cave-Ayland wrote: > > > > > Use QOM casts to convert between VFIOUserContainer and VFIOContainerBase >

[PATCH v3 2/3] tests/functional: add vm param to cmd.py helpers

2025-08-28 Thread John Levon
Extend the "vm" parameter of wait_for_console_pattern() to all the other utility functions; this allows them to be used on a VM other than test.vm. Signed-off-by: John Levon --- tests/functional/qemu_test/cmd.py | 18 -- 1 file changed, 12 insertions(+), 6 deletion

[PATCH v3 1/3] tests/functional: return output from cmd.py helpers

2025-08-28 Thread John Levon
Tests might want to look at the whole output from a command execution, as well as just logging it. Add support for this. Signed-off-by: John Levon --- tests/functional/qemu_test/cmd.py | 53 +-- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/tests

[PATCH v3 3/3] tests/functional: add a vfio-user smoke test

2025-08-28 Thread John Levon
From: Mark Cave-Ayland Add a basic test of the vfio-user PCI client implementation. Co-authored-by: John Levon Signed-off-by: Mark Cave-Ayland Signed-off-by: John Levon --- MAINTAINERS | 1 + tests/functional/x86_64/meson.build | 1

[PATCH v3 0/3] vfio-user client functional test

2025-08-28 Thread John Levon
Add a basic functional test for the vfio-user client, along with a couple of test framework extensions to support it. John Levon (2): tests/functional: return output from cmd.py helpers tests/functional: add vm param to cmd.py helpers Mark Cave-Ayland (1): tests/functional: add a vfio-user

[PATCH] hw/vfio-user: add x-pci-class-code

2025-08-27 Thread John Levon
This new option was not added to vfio_user_pci_dev_properties, which caused an incorrect class code for vfio-user devices. Fixes: a59d06305fff ("vfio/pci: Introduce x-pci-class-code option") Signed-off-by: John Levon --- hw/vfio-user/pci.c | 2 ++ 1 file changed, 2 insertions(+) di

[PATCH v2 2/3] tests/functional: add vm param to cmd.py helpers

2025-08-26 Thread John Levon
Extend the "vm" parameter of wait_for_console_pattern() to all the other utility functions; this allows them to be used on a VM other than test.vm. Signed-off-by: John Levon --- tests/functional/qemu_test/cmd.py | 18 -- 1 file changed, 12 insertions(+), 6 deletion

[PATCH v2 1/3] tests/functional: return output from cmd.py helpers

2025-08-26 Thread John Levon
Tests might want to look at the whole output from a command execution, as well as just logging it. Add support for this. Signed-off-by: John Levon --- tests/functional/qemu_test/cmd.py | 53 +-- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/tests

[PATCH v2 0/3] vfio-user client functional test

2025-08-26 Thread John Levon
Add a basic functional test for the vfio-user client, along with a couple of test framework extensions to support it. John Levon (2): tests/functional: return output from cmd.py helpers tests/functional: add vm param to cmd.py helpers Mark Cave-Ayland (1): tests/functional: add a vfio-user

[PATCH v2 3/3] tests/functional: add a vfio-user smoke test

2025-08-26 Thread John Levon
From: Mark Cave-Ayland Add a basic test of the vfio-user PCI client implementation. Co-authored-by: John Levon Signed-off-by: Mark Cave-Ayland Signed-off-by: John Levon --- MAINTAINERS | 1 + tests/functional/meson.build | 1 + tests/functional

[PATCH 2/3] tests/functional: add vm param to console routines

2025-08-18 Thread John Levon
Extend the "vm" parameter of wait_for_console_pattern() to all the other utility functions; this allows them to be used on a VM other than test.vm. Signed-off-by: John Levon --- tests/functional/qemu_test/cmd.py | 18 -- 1 file changed, 12 insertions(+), 6 deletion

[PATCH 1/3] tests/functional: return output from exec_command_and_wait_for_pattern()

2025-08-18 Thread John Levon
Tests might want to look at the whole output from a command execution, as well as just logging it. Add support for this. Signed-off-by: John Levon --- tests/functional/qemu_test/cmd.py | 38 +++ 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/tests

[PATCH 0/3] vfio-user client functional test

2025-08-18 Thread John Levon
Add a basic functional test for the vfio-user client, along with a couple of test framework extensions to support it. John Levon (2): tests/functional: return output from exec_command_and_wait_for_pattern() tests/functional: add vm param to console routines Mark Cave-Ayland (1): tests

[PATCH 3/3] tests/functional: add a vfio-user smoke test

2025-08-18 Thread John Levon
From: Mark Cave-Ayland Add a basic test of the vfio-user PCI client implementation. Co-authored-by: John Levon Signed-off-by: Mark Cave-Ayland Signed-off-by: John Levon --- MAINTAINERS | 1 + tests/functional/meson.build | 1 + tests/functional

Re: [PATCH 20/22] vfio-user/pci.c: use QOM casts where appropriate

2025-07-15 Thread John Levon
ead(VFIOPCIDevice *vdev, > VFIOUserDMARW *msg) > > static void vfio_user_dma_write(VFIOPCIDevice *vdev, VFIOUserDMARW *msg) > { > -PCIDevice *pdev = &vdev->pdev; > +PCIDevice *pdev = PCI_DEVICE(vdev); > VFIOUserProxy *proxy = vdev->vbasedev.proxy; > MemTxResult r; > Reviewed-by: John Levon

Re: [PATCH 09/22] vfio/container.c: use QOM casts where appropriate

2025-07-15 Thread John Levon
On Tue, Jul 15, 2025 at 10:25:49AM +0100, Mark Cave-Ayland wrote: > Use QOM casts to convert between VFIOUserContainer and VFIOContainerBase > instead > of accessing bcontainer directly. > > Signed-off-by: Mark Cave-Ayland Patch subject should be "vfio-user/container.c" not vfio/container.c

Re: [PATCH 13/22] vfio-user/pci.c: rename VFIOUserPCIDevice device field to parent_obj

2025-07-15 Thread John Levon
_USER_PCI) > > struct VFIOUserPCIDevice { > -VFIOPCIDevice device; > +VFIOPCIDevice parent_obj; > > SocketAddress *socket; > bool send_queued; /* all sends are queued */ Reviewed-by: John Levon

Re: [PATCH 10/22] vfio-user/container.h: rename VFIOUserContainer bcontainer field to parent_obj

2025-07-15 Thread John Levon
ntainer sub-class for vfio-user. */ > struct VFIOUserContainer { > -VFIOContainerBase bcontainer; > +VFIOContainerBase parent_obj; > > VFIOUserProxy *proxy; > }; Reviewed-by: John Levon

Re: [PATCH 12/22] vfio-user/pci.c: use QOM casts where appropriate

2025-07-15 Thread John Levon
r *name, > VFIOUserPCIDevice *udev = VFIO_USER_PCI(obj); > bool success; > > -if (udev->device.vbasedev.proxy) { > +if (VFIO_PCI_BASE(udev)->vbasedev.proxy) { > error_setg(errp, "Proxy is connected"); > return; > } Reviewed-by: John Levon

Re: [PATCH 11/22] vfio-user/pci.c: update VFIOUserPCIDevice declaration

2025-07-15 Thread John Levon
ruct VFIOUserPCIDevice { > VFIOPCIDevice device; > + > SocketAddress *socket; > bool send_queued; /* all sends are queued */ > uint32_t wait_time; /* timeout for message replies */ Reviewed-by: John Levon

Re: [PATCH 08/22] vfio-user/container.h: update VFIOUserContainer declaration

2025-07-15 Thread John Levon
se bcontainer; > + > VFIOUserProxy *proxy; > -} VFIOUserContainer; > +}; > > OBJECT_DECLARE_SIMPLE_TYPE(VFIOUserContainer, VFIO_IOMMU_USER); > Reviewed-by: John Levon

[PATCH v3 1/4] hw/vfio-user: add Cédric Le Goater as a maintainer

2025-07-15 Thread John Levon
Signed-off-by: John Levon --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e88ed2c0a9..30e9b71e6e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4287,6 +4287,7 @@ F: tests/functional/test_multiprocess.py VFIO-USER: M: John Levon M: Thanos

[PATCH v3 4/4] hw/vfio-user: fix use of uninitialized variable

2025-07-15 Thread John Levon
e same way to resolve this. Resolves: Coverity CID 1611805 Fixes: 18e899e6 ("vfio-user: implement VFIO_USER_DMA_MAP/UNMAP") Reported-by: Cédric Le Goater Signed-off-by: John Levon Reviewed-by: Cédric Le Goater --- hw/vfio-user/container.c | 6 +- 1 file changed, 1 insertion(+), 5 del

[PATCH v3 0/4] vfio-user fixes

2025-07-15 Thread John Levon
Some small Coverity and related fixes for the recently merged vfio-user series. thanks john John Levon (4): hw/vfio-user: add Cédric Le Goater as a maintainer hw/vfio: fix region fd initialization hw/vfio-user: wait for proxy close correctly hw/vfio-user: fix use of uninitialized

[PATCH v3 3/4] hw/vfio-user: wait for proxy close correctly

2025-07-15 Thread John Levon
ity. Signed-off-by: John Levon Reviewed-by: Mark Cave-Ayland Reviewed-by: Cédric Le Goater --- hw/vfio-user/proxy.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/vfio-user/proxy.c b/hw/vfio-user/proxy.c index c418954440..2275d3fe39 100644 --- a/hw/vfio-u

[PATCH v3 2/4] hw/vfio: fix region fd initialization

2025-07-15 Thread John Levon
We were not initializing the region fd array to -1, so we would accidentally try to close(0) on cleanup for any region that is not referenced. Fixes: 95cdb024 ("vfio: add region info cache") Signed-off-by: John Levon Reviewed-by: Mark Cave-Ayland Reviewed-by: Cédric Le Goater --

Re: [PATCH v2 3/4] hw/vfio-user: wait for proxy close correctly

2025-07-15 Thread John Levon
On Tue, Jul 15, 2025 at 10:01:59AM +0100, Mark Cave-Ayland wrote: > On 15/07/2025 06:52, John Levon wrote: > > > Coverity reported: > > > > CID 1611806: Concurrent data access violations (BAD_CHECK_OF_WAIT_COND) > > > > A wait is performed without a loop

[PATCH v2 4/4] hw/vfio-user: fix use of uninitialized variable

2025-07-14 Thread John Levon
e same way to resolve this. Resolves: Coverity CID 1611805 Fixes: 18e899e6 ("vfio-user: implement VFIO_USER_DMA_MAP/UNMAP") Reported-by: Cédric Le Goater Signed-off-by: John Levon --- hw/vfio-user/container.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/vfi

[PATCH v2 3/4] hw/vfio-user: wait for proxy close correctly

2025-07-14 Thread John Levon
xes: 0b3d881a ("vfio-user: implement message receive infrastructure") Signed-off-by: John Levon --- hw/vfio-user/proxy.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/vfio-user/proxy.c b/hw/vfio-user/proxy.c index c418954440..2275d3fe39 100644 --- a

[PATCH v2 2/4] hw/vfio: fix region fd initialization

2025-07-14 Thread John Levon
We were not initializing the region fd array to -1, so we would accidentally try to close(0) on cleanup for any region that is not referenced. Fixes: 95cdb024 ("vfio: add region info cache") Signed-off-by: John Levon --- hw/vfio/device.c | 6 +- 1 file changed, 5 insertions(+),

[PATCH v2 1/4] hw/vfio-user: add Cédric Le Goater as a maintainer

2025-07-14 Thread John Levon
Signed-off-by: John Levon --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e88ed2c0a9..30e9b71e6e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4287,6 +4287,7 @@ F: tests/functional/test_multiprocess.py VFIO-USER: M: John Levon M: Thanos

[PATCH v2 0/4] vfio-user fixes

2025-07-14 Thread John Levon
Some small Coverity and related fixes for the recently merged vfio-user series. thanks john John Levon (4): hw/vfio-user: add Cédric Le Goater as a maintainer hw/vfio: fix region fd initialization hw/vfio-user: wait for proxy close correctly hw/vfio-user: fix use of uninitialized

[PATCH v2] hw/vfio-user: wait for proxy close correctly

2025-07-11 Thread John Levon
ity. Signed-off-by: John Levon --- hw/vfio-user/proxy.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/vfio-user/proxy.c b/hw/vfio-user/proxy.c index c418954440..2275d3fe39 100644 --- a/hw/vfio-user/proxy.c +++ b/hw/vfio-user/proxy.c @@ -32,7 +32,6 @@ static v

[PATCH] hw/vfio: fix region fd initialization

2025-07-10 Thread John Levon
We were not initializing the region fd array to -1, so we would accidentally try to close(0) on cleanup for any region that is not referenced. Fixes: 95cdb024 ("vfio: add region info cache") Signed-off-by: John Levon --- hw/vfio/device.c | 6 +- 1 file changed, 5 insertions(+),

[PATCH] hw/vfio-user: wait for proxy close correctly

2025-07-10 Thread John Levon
Coverity reported: CID 1611806: Concurrent data access violations (BAD_CHECK_OF_WAIT_COND) A wait is performed without a loop. If there is a spurious wakeup, the condition may not be satisfied. Fix this by checking ->state for VFIO_PROXY_CLOSED in a loop. Signed-off-by: John Levon ---

Re: [PULL 08/25] vfio-user: connect vfio proxy to remote server

2025-07-10 Thread John Levon
On Thu, Jul 10, 2025 at 01:33:17PM +0100, Peter Maydell wrote: > On Thu, 26 Jun 2025 at 08:51, Cédric Le Goater wrote: > > > > From: John Levon > > > > Introduce the vfio-user "proxy": this is the client code responsible for > > sending and receiving v

[PATCH] hw/vfio-user: fix use of uninitialized variable

2025-07-08 Thread John Levon
e same way to resolve this. Reported-by: Cédric Le Goater Signed-off-by: John Levon --- hw/vfio-user/container.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/vfio-user/container.c b/hw/vfio-user/container.c index d318e6a339..d589dd90f5 100644 --- a/hw/vfio-user/cont

[PATCH v5 06/19] vfio-user: implement VFIO_USER_DEVICE_GET_REGION_INFO

2025-06-25 Thread John Levon
Add support for getting region info for vfio-user. As vfio-user has one fd per region, enable ->use_region_fds. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/device.h | 2 ++ hw/vfio-user/protoco

[PATCH v5 05/19] vfio-user: implement VFIO_USER_DEVICE_GET_INFO

2025-06-25 Thread John Levon
Add support for getting basic device information. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/device.h | 20 ++ hw/vfio-user/protocol.h | 12 + hw/vfio-user/proxy.h | 7

[PATCH v5 18/19] docs: add vfio-user documentation

2025-06-25 Thread John Levon
Add some basic documentation on vfio-user usage. Signed-off-by: John Levon --- docs/system/device-emulation.rst | 1 + docs/system/devices/vfio-user.rst | 26 ++ 2 files changed, 27 insertions(+) create mode 100644 docs/system/devices/vfio-user.rst diff --git a/docs

[PATCH v5 14/19] vfio-user: implement VFIO_USER_DMA_READ/WRITE

2025-06-25 Thread John Levon
Unlike most other messages, this is a server->client message, for when a server wants to do "DMA"; this is slow, so normally the server has memory directly mapped instead. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-b

[PATCH v5 19/19] vfio-user: introduce vfio-user protocol specification

2025-06-25 Thread John Levon
discussed as an RFC in: "RFC: use VFIO over a UNIX domain socket to implement device offloading" Signed-off-by: Thanos Makatos Signed-off-by: John Levon --- MAINTAINERS|3 +- docs/interop/index.rst |1 + docs/interop/vfio-user.

[PATCH v5 12/19] vfio-user: implement VFIO_USER_DEVICE_RESET

2025-06-25 Thread John Levon
Hook this call up to the legacy reset handler for vfio-user-pci. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/device.h | 2 ++ hw/vfio-user/device.c | 18 ++ hw/vfio-user/pci.c| 15

[PATCH v5 09/19] vfio-user: implement VFIO_USER_DEVICE_GET/SET_IRQ*

2025-06-25 Thread John Levon
IRQ setup uses the same semantics as the traditional vfio path, but we need to share the corresponding file descriptors with the server as necessary. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user

[PATCH v5 10/19] vfio-user: forward MSI-X PBA BAR accesses to server

2025-06-25 Thread John Levon
For vfio-user, the server holds the pending IRQ state; set up an I/O region for the MSI-X PBA so we can ask the server for this state on a PBA read. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio/pci.h

[PATCH v5 11/19] vfio-user: set up container access to the proxy

2025-06-25 Thread John Levon
The user container will shortly need access to the underlying vfio-user proxy; set this up. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/container.h | 2 ++ hw/vfio-user/container.c | 43

[PATCH v5 13/19] vfio-user: implement VFIO_USER_DMA_MAP/UNMAP

2025-06-25 Thread John Levon
From: John Levon When the vfio-user container gets mapping updates, share them with the vfio-user by sending a message; this can include the region fd, allowing the server to directly mmap() the region as needed. For performance, we only wait for the message responses when we're doing w

[PATCH v5 03/19] vfio-user: implement message receive infrastructure

2025-06-25 Thread John Levon
Add the basic implementation for receiving vfio-user messages from the control socket. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- meson.build | 1 + hw/vfio-user/protocol.h | 53 + hw/vfio

[PATCH v5 08/19] vfio-user: set up PCI in vfio_user_pci_realize()

2025-06-25 Thread John Levon
Re-use PCI setup functions from hw/vfio/pci.c to realize the vfio-user PCI device. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/pci.c | 29 + 1 file changed, 29 insertions

[PATCH v5 02/19] vfio-user: connect vfio proxy to remote server

2025-06-25 Thread John Levon
rPCIDevice instance. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/proxy.h | 79 + include/hw/vfio/vfio-device.h | 2 + hw/vfio-user/pci.c| 22 + hw/vfio-us

[PATCH v5 07/19] vfio-user: implement VFIO_USER_REGION_READ/WRITE

2025-06-25 Thread John Levon
Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/protocol.h | 12 ++ hw/vfio-user/device.c | 79 +++ hw/vfio-user/trace-events | 1 + 3 files changed, 92

[PATCH v5 04/19] vfio-user: implement message send infrastructure

2025-06-25 Thread John Levon
Add plumbing for sending vfio-user messages on the control socket. Add initial version negotation on connection. Originally-by: John Johnson Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John Levon --- hw/vfio-user/protocol.h | 62 + hw/vfio-user

[PATCH v5 16/19] vfio-user: support posted writes

2025-06-25 Thread John Levon
Support an asynchronous send of a vfio-user socket message (no wait for a reply) when the write is posted. This is only safe when no regions are mappable by the VM. Add an option to explicitly disable this as well. Signed-off-by: John Levon --- hw/vfio-user/proxy.h | 6 ++ hw/vfio-user

[PATCH v5 17/19] vfio-user: add coalesced posted writes

2025-06-25 Thread John Levon
: John Levon --- hw/vfio-user/protocol.h | 21 ++ hw/vfio-user/proxy.h | 12 ++ hw/vfio-user/device.c | 40 +++ hw/vfio-user/proxy.c | 84 +++ hw/vfio-user/trace-events | 1 + 5 files changed, 158 insertions(+) diff

[PATCH v5 15/19] vfio-user: add 'x-msg-timeout' option

2025-06-25 Thread John Levon
By default, the vfio-user subsystem will wait 5 seconds for a message reply from the server. Add an option to allow this to be configurable. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/proxy.h | 1

[PATCH v5 00/19] vfio-user client

2025-06-25 Thread John Levon
functional test is still being worked on. A previous version of this series can be found at https://lore.kernel.org/qemu-devel/20250619133154.264786-1-john.le...@nutanix.com/ Changes since last series: - fixed SPDX identifier nits - code review changes for error handling thanks john John Levon (18

[PATCH v5 01/19] vfio-user: add vfio-user class and container

2025-06-25 Thread John Levon
.c for instantiating VFIOUserPCIDevice objects, sharing some common code from hw/vfio/pci.c. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- MAINTAINERS | 8 + hw/vfio-user/container.h

Re: [PATCH] vfio: add license tag to some files

2025-06-25 Thread John Levon
On Tue, Jun 24, 2025 at 11:35:52AM +0200, Cédric Le Goater wrote: > > These files came from hw/vfio/ and were then modified so would carry the > > same > > license. Please let me know what you'd like me to do. > > Ah. Please consider them as new. These are infrastructure files which are > all si

Re: [PATCH v4 03/19] vfio-user: implement message receive infrastructure

2025-06-25 Thread John Levon
On Wed, Jun 25, 2025 at 10:02:50AM +0200, Cédric Le Goater wrote: > > +/* > > + * Process a received message. > > + */ > > +static void vfio_user_process(VFIOUserProxy *proxy, VFIOUserMsg *msg, > > + bool isreply) > > This routine could have an 'Error **errp' paramete

Re: [PATCH v4 00/19] vfio-user client

2025-06-25 Thread John Levon
On Wed, Jun 25, 2025 at 10:56:44AM +0200, Cédric Le Goater wrote: > Could you please send v5 this week ? I plan to merge it first as other > proposals are knocking at the VFIO door and I am OOO on week 28. Will take care of your Error comments then send out thanks john

Re: [PATCH] vfio: add license tag to some files

2025-06-24 Thread John Levon
On Tue, Jun 24, 2025 at 11:27:57AM +0200, Cédric Le Goater wrote: > On 6/24/25 11:19, John Levon wrote: > > On Tue, Jun 24, 2025 at 10:05:44AM +0100, Daniel P. Berrangé wrote: > > > > > On Tue, Jun 24, 2025 at 10:34:40AM +0200, Cédric Le Goater wrote: > > > >

Re: [PATCH] vfio: add license tag to some files

2025-06-24 Thread John Levon
On Tue, Jun 24, 2025 at 10:05:44AM +0100, Daniel P. Berrangé wrote: > On Tue, Jun 24, 2025 at 10:34:40AM +0200, Cédric Le Goater wrote: > > + Daniel > > > > On 6/23/25 11:30, John Levon wrote: > > > Add SPDX-License-Identifier to some files missing it in hw/vfi

Re: [PATCH v3 00/23] vfio-user client

2025-06-23 Thread John Levon
On Sun, Jun 22, 2025 at 02:57:57PM +0200, Cédric Le Goater wrote: > PCI enumeration work but the kernel module won't load on ubuntu 24.04 Sorry, I forgot - there's a kernel bug in the Ubuntu LTS kernel for this driver. Mark has a fix - Mark, can you share? regards john

[PATCH] vfio: add license tag to some files

2025-06-23 Thread John Levon
Add SPDX-License-Identifier to some files missing it in hw/vfio/. Signed-off-by: John Levon --- hw/vfio/trace.h | 3 +++ hw/vfio/Kconfig | 2 ++ hw/vfio/meson.build | 2 ++ hw/vfio/trace-events | 2 ++ 4 files changed, 9 insertions(+) diff --git a/hw/vfio/trace.h b/hw/vfio/trace.h

Re: [PATCH v4 00/19] vfio-user client

2025-06-21 Thread John Levon
On Sat, Jun 21, 2025 at 04:25:24PM +0200, Cédric Le Goater wrote: > > So please let me know what if anything needs to be fixed (and if I should > > make > > the same retrospective fix to hw/vfio/ equivalent). > > Did you update the QEMU tree ? > > $ git describe > v10.0.0-1657-g6e1571533fd9

Re: [PATCH v4 00/19] vfio-user client

2025-06-21 Thread John Levon
On Fri, Jun 20, 2025 at 11:11:10AM +0200, Cédric Le Goater wrote: > > The series contains an implement of a vfio-user client in QEMU, along with > > a few > > more preparatory patches. > > Please run ./scripts/checkpatch.pl and resend later on, as we might get > reviews. Output is below, MAINTA

Re: [PATCH v3 00/23] vfio-user client

2025-06-21 Thread John Levon
On Fri, Jun 20, 2025 at 10:32:10AM +0200, Cédric Le Goater wrote: > Before merging, I would like to be able to experiment a minimum. > > Does a dummy device (server side) implementation exist ? and a > GH repo I could pull the code from. > > John, > > How do you test ? I use these scripts for

[PATCH v4 17/19] vfio-user: add coalesced posted writes

2025-06-19 Thread John Levon
: John Levon --- hw/vfio-user/protocol.h | 21 ++ hw/vfio-user/proxy.h | 12 ++ hw/vfio-user/device.c | 40 +++ hw/vfio-user/proxy.c | 84 +++ hw/vfio-user/trace-events | 1 + 5 files changed, 158 insertions(+) diff

[PATCH v4 09/19] vfio-user: implement VFIO_USER_DEVICE_GET/SET_IRQ*

2025-06-19 Thread John Levon
IRQ setup uses the same semantics as the traditional vfio path, but we need to share the corresponding file descriptors with the server as necessary. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user

[PATCH v4 12/19] vfio-user: implement VFIO_USER_DEVICE_RESET

2025-06-19 Thread John Levon
Hook this call up to the legacy reset handler for vfio-user-pci. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/device.h | 2 ++ hw/vfio-user/device.c | 12 hw/vfio-user/pci.c| 15

[PATCH v4 15/19] vfio-user: add 'x-msg-timeout' option

2025-06-19 Thread John Levon
By default, the vfio-user subsystem will wait 5 seconds for a message reply from the server. Add an option to allow this to be configurable. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/proxy.h | 1

[PATCH v4 10/19] vfio-user: forward MSI-X PBA BAR accesses to server

2025-06-19 Thread John Levon
For vfio-user, the server holds the pending IRQ state; set up an I/O region for the MSI-X PBA so we can ask the server for this state on a PBA read. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio/pci.h

[PATCH v4 05/19] vfio-user: implement VFIO_USER_DEVICE_GET_INFO

2025-06-19 Thread John Levon
Add support for getting basic device information. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/device.h | 20 hw/vfio-user/protocol.h | 12 ++ hw/vfio-user/proxy.h

[PATCH v4 04/19] vfio-user: implement message send infrastructure

2025-06-19 Thread John Levon
Add plumbing for sending vfio-user messages on the control socket. Add initial version negotation on connection. Originally-by: John Johnson Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John Levon --- hw/vfio-user/protocol.h | 62 + hw/vfio-user

[PATCH v4 01/19] vfio-user: add vfio-user class and container

2025-06-19 Thread John Levon
.c for instantiating VFIOUserPCIDevice objects, sharing some common code from hw/vfio/pci.c. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- MAINTAINERS | 8 + hw/vfio-user/container.h

[PATCH v4 16/19] vfio-user: support posted writes

2025-06-19 Thread John Levon
Support an asynchronous send of a vfio-user socket message (no wait for a reply) when the write is posted. This is only safe when no regions are mappable by the VM. Add an option to explicitly disable this as well. Signed-off-by: John Levon --- hw/vfio-user/proxy.h | 5 + hw/vfio-user

[PATCH v4 18/19] docs: add vfio-user documentation

2025-06-19 Thread John Levon
Add some basic documentation on vfio-user usage. Signed-off-by: John Levon --- docs/system/device-emulation.rst | 1 + docs/system/devices/vfio-user.rst | 24 2 files changed, 25 insertions(+) create mode 100644 docs/system/devices/vfio-user.rst diff --git a/docs

[PATCH v4 08/19] vfio-user: set up PCI in vfio_user_pci_realize()

2025-06-19 Thread John Levon
Re-use PCI setup functions from hw/vfio/pci.c to realize the vfio-user PCI device. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/pci.c | 29 + 1 file changed, 29 insertions

[PATCH v4 03/19] vfio-user: implement message receive infrastructure

2025-06-19 Thread John Levon
Add the basic implementation for receiving vfio-user messages from the control socket. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- meson.build | 1 + hw/vfio-user/protocol.h | 53 + hw/vfio

[PATCH v4 06/19] vfio-user: implement VFIO_USER_DEVICE_GET_REGION_INFO

2025-06-19 Thread John Levon
Add support for getting region info for vfio-user. As vfio-user has one fd per region, enable ->use_region_fds. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/device.h | 2 ++ hw/vfio-user/protoco

[PATCH v4 07/19] vfio-user: implement VFIO_USER_REGION_READ/WRITE

2025-06-19 Thread John Levon
Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/protocol.h | 12 +++ hw/vfio-user/device.c | 67 +++ hw/vfio-user/trace-events | 1 + 3 files changed, 80

[PATCH v4 13/19] vfio-user: implement VFIO_USER_DMA_MAP/UNMAP

2025-06-19 Thread John Levon
From: John Levon When the vfio-user container gets mapping updates, share them with the vfio-user by sending a message; this can include the region fd, allowing the server to directly mmap() the region as needed. For performance, we only wait for the message responses when we're doing w

[PATCH v4 19/19] vfio-user: introduce vfio-user protocol specification

2025-06-19 Thread John Levon
discussed as an RFC in: "RFC: use VFIO over a UNIX domain socket to implement device offloading" Signed-off-by: Thanos Makatos Signed-off-by: John Levon --- MAINTAINERS|3 +- docs/interop/index.rst |1 + docs/interop/vfio-user.

[PATCH v4 14/19] vfio-user: implement VFIO_USER_DMA_READ/WRITE

2025-06-19 Thread John Levon
Unlike most other messages, this is a server->client message, for when a server wants to do "DMA"; this is slow, so normally the server has memory directly mapped instead. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-b

[PATCH v4 11/19] vfio-user: set up container access to the proxy

2025-06-19 Thread John Levon
The user container will shortly need access to the underlying vfio-user proxy; set this up. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/container.h | 2 ++ hw/vfio-user/container.c | 43

[PATCH v4 02/19] vfio-user: connect vfio proxy to remote server

2025-06-19 Thread John Levon
rPCIDevice instance. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio-user/proxy.h | 79 + include/hw/vfio/vfio-device.h | 2 + hw/vfio-user/pci.c| 22 + hw/vfio-us

[PATCH v4 00/19] vfio-user client

2025-06-19 Thread John Levon
has been removed - the documentation has been relocated next to vhost-user's - SocketAddress is now used for the command line parameter - small bits of code review feedback John Levon (18): vfio-user: add vfio-user class and container vfio-user: connect vfio proxy to remote server

[PATCH] vfio: add vfio_device_get_region_fd()

2025-06-16 Thread John Levon
This keeps the existence of ->region_fds private to hw/vfio/device.c. Signed-off-by: John Levon --- include/hw/vfio/vfio-device.h | 12 hw/vfio/device.c | 7 +++ hw/vfio/region.c | 5 + 3 files changed, 20 insertions(+), 4 deletions(-) d

  1   2   3   4   5   >