Re: [RFC v4 01/21] vfio-user: introduce vfio-user protocol specification

2022-07-21 Thread John Johnson
> On Mar 9, 2022, at 2:34 PM, Alex Williamson > wrote: > > On Tue, 11 Jan 2022 16:43:37 -0800 > John Johnson wrote: >> >> + >> +VFIO region type cap header >> +"""""""""""""

Re: [PATCH v1 09/24] vfio-user: define socket send functions

2023-02-01 Thread John Johnson
> On Dec 13, 2022, at 5:48 AM, Cédric Le Goater wrote: > > On 11/9/22 00:13, John Johnson wrote: >> >> + >> +static struct cap_entry ver_0_0[] = { >> +{ VFIO_USER_CAP, check_cap }, >> +{ NULL } >> +}; >> + >> +static int

Re: [PATCH v1 00/24] vfio-user client

2023-02-01 Thread John Johnson
> On Dec 16, 2022, at 3:31 AM, Cédric Le Goater wrote: > > On 11/9/22 00:13, John Johnson wrote: >> Hello, >> This is the 6th revision of the vfio-user client implementation. >> It is the first patch series (the previous revisions were RFCs) >> First of all,

Re: [PATCH v1 14/24] vfio-user: get and set IRQs

2023-02-01 Thread John Johnson
> On Dec 13, 2022, at 8:39 AM, Cédric Le Goater wrote: > > On 11/9/22 00:13, John Johnson wrote: >> >> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c >> index 7abe44e..be39a4e 100644 >> --- a/hw/vfio/pci.c >> +++ b/hw/vfio/pci.c >> @@ -713,7 +713,8 @@

Re: [PATCH v1 04/24] vfio-user: add region cache

2023-02-01 Thread John Johnson
> On Dec 12, 2022, at 3:42 AM, Philippe Mathieu-Daudé wrote: > > On 9/11/22 00:13, John Johnson wrote: >> cache VFIO_DEVICE_GET_REGION_INFO results to reduce >> memory alloc/free cycles and as prep work for vfio-user >> Signed-off-by: John G Johnson >&g

[PATCH v2 02/23] vfio-user: add VFIO base abstract class

2023-02-01 Thread John Johnson
Add an abstract base class both the kernel driver and user socket implementations can use to share code. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 16 +++-- hw/vfio/pci.c | 106 +++-

[PATCH v2 01/23] vfio-user: introduce vfio-user protocol specification

2023-02-01 Thread John Johnson
From: Thanos Makatos This patch introduces the vfio-user protocol specification (formerly known as VFIO-over-socket), which is designed to allow devices to be emulated outside QEMU, in a separate process. vfio-user reuses the existing VFIO defines, structs and concepts. It has been earlier discu

[PATCH v2 07/23] vfio-user: connect vfio proxy to remote server

2023-02-01 Thread John Johnson
add user.c & user.h files for vfio-user code add proxy struct to handle comms with remote server Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user.h| 78 +++ include/hw/vfio/vfio-common.h | 2 + hw/

[PATCH v2 04/23] vfio-user: add region cache

2023-02-01 Thread John Johnson
cache VFIO_DEVICE_GET_REGION_INFO results to reduce memory alloc/free cycles and as prep work for vfio-user Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/ccw.c | 5 - hw/vfio

[PATCH v2 21/23] vfio-user: pci reset

2023-02-01 Thread John Johnson
Message to tell the server to reset the device. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 2 ++ hw/vfio/user.h | 1 + hw/vfio/pci.c | 4 ++-- hw/vfio/user-pci.c | 15 +++ hw/vfio/user.c | 1

[PATCH v2 09/23] vfio-user: define socket send functions

2023-02-01 Thread John Johnson
Also negotiate protocol version with remote server Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson --- hw/vfio/user-protocol.h | 62 ++ hw/vfio/user.h | 9 + hw/vfio/user-pci.c | 16 ++ hw/vfio/user.c | 512 ++

[PATCH v2 16/23] vfio-user: proxy container connect/disconnect

2023-02-01 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user.h| 6 +- include/hw/vfio/vfio-common.h | 10 +++ hw/vfio/common.c | 100 --- hw/vfio/user-pci.c| 12 +++- hw/vfio/u

[PATCH v2 23/23] vfio-user: add coalesced posted writes

2023-02-01 Thread John Johnson
Add new message to send multiple writes to server. Prevents the outgoing queue from overflowing when a long latency operation is followed by a series of posted writes. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 2

[PATCH v2 18/23] vfio-user: add dma_unmap_all

2023-02-01 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/common.c | 45 ++- hw/vfio/user.c| 24 +++ 3 files changed, 61

[PATCH v2 13/23] vfio-user: pci_user_realize PCI setup

2023-02-01 Thread John Johnson
PCI BARs read from remote device PCI config reads/writes sent to remote server Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 9 ++ hw/vfio/pci.c | 257 ++--- hw/vfio/

[PATCH v2 00/23] vfio-user client

2023-02-01 Thread John Johnson
. We also have upstreamed a patch series that implement a server using QEMU. Contributors: John G Johnson John Levon Thanos Makatos Elena Ufimtseva Jagannathan Raman Changes fron v1: John Johnson (22): vfio-user: add VFIO base abstract class rename VFIOKernPCIDevice to VFIOKernelPCIDevice

[PATCH v2 10/23] vfio-user: get device info

2023-02-01 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 12 ++ hw/vfio/user.h| 1 + include/hw/vfio/vfio-common.h | 3 +++ hw/vfio/common.c | 23 +++--- hw/vfio/user-pci.

[PATCH v2 22/23] vfio-user: add 'x-msg-timeout' option that specifies msg wait times

2023-02-01 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user.h | 1 + hw/vfio/user-pci.c | 4 hw/vfio/user.c | 7 --- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/vfio/user.h b/hw/vfio/user.h index b7a9f57..

[PATCH v2 19/23] vfio-user: no-mmap DMA support

2023-02-01 Thread John Johnson
Force remote process to use DMA r/w messages instead of directly mapping guest memory. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user.h | 1 + hw/vfio/user-pci.c | 5 + hw/vfio/user.c | 2 +- 3 files changed, 7 inserti

[PATCH v2 03/23] vfio-user: add container IO ops vector

2023-02-01 Thread John Johnson
Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 24 hw/vfio/common.c | 128 -- 2 files changed, 110 insertions(

[PATCH v2 11/23] vfio-user: get region info

2023-02-01 Thread John Johnson
Add per-region FD to support mmap() of remote device regions Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 14 + hw/vfio/user.h| 2 ++ include/hw/vfio/vfio-common.h | 5 +++- hw/vfio/a

[PATCH v2 12/23] vfio-user: region read/write

2023-02-01 Thread John Johnson
Add support for posted writes on remote devices Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 12 + hw/vfio/user.h| 1 + include/hw/vfio/vfio-common.h | 3 +- hw/vfio/common.c

[PATCH v2 06/23] vfio-user: Define type vfio_user_pci_dev_info

2023-02-01 Thread John Johnson
New class for vfio-user with its class and instance constructors and destructors, and its pci ops. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 7 +++ hw/vfio/pci.c | 12 +++--- hw/vfio/user-pci.c | 121 ++

[PATCH v2 05/23] vfio-user: add device IO ops vector

2023-02-01 Thread John Johnson
Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 14 + hw/vfio/ap.c | 1 + hw/vfio/ccw.c | 1 + hw/vfio/common.c | 85 +

[PATCH v2 20/23] vfio-user: dma read/write operations

2023-02-01 Thread John Johnson
Messages from server to client that peform device DMA. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 11 + hw/vfio/user.h | 3 ++ hw/vfio/user-pci.c | 110

[PATCH v2 15/23] vfio-user: forward msix BAR accesses to server

2023-02-01 Thread John Johnson
Server holds device current device pending state Use irq masking commands in socket case Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 1 + include/hw/vfio/vfio-common.h | 3 ++ hw/vfio/ccw.c

[PATCH v2 08/23] vfio-user: define socket receive functions

2023-02-01 Thread John Johnson
Add infrastructure needed to receive incoming messages Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 54 +++ hw/vfio/user.h | 8 + hw/vfio/user-pci.c | 11 ++ hw/vfio/user.c | 408 +

[PATCH v2 17/23] vfio-user: dma map/unmap operations

2023-02-01 Thread John Johnson
Add ability to do async operations during memory transactions Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson --- hw/vfio/user-protocol.h | 32 ++ include/hw/vfio/vfio-common.h | 4 +- hw/vfio/common.c | 64 +---

[PATCH v2 14/23] vfio-user: get and set IRQs

2023-02-01 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 25 + hw/vfio/pci.c | 3 +- hw/vfio/user.c | 140 hw/vfio/trace-events| 2 + 4 files c

Re: [RFC v4 09/21] vfio-user: define socket send functions

2022-02-06 Thread John Johnson
> On Jan 26, 2022, at 2:17 AM, Thanos Makatos > wrote: > >> >> +static int wait_time = 1000; /* wait 1 sec for replies */ > > Could we make this configurable via the command line as it helps debugging? > Yes, I can add a CLI option. JJ

Re: [RFC v4 08/21] vfio-user: define socket receive functions

2022-02-06 Thread John Johnson
> On Feb 4, 2022, at 4:42 AM, Thanos Makatos wrote: > >> -Original Message- >> From: Qemu-devel > bounces+thanos.makatos=nutanix@nongnu.org> On Behalf Of Thanos >> Makatos >> Sent: 03 February 2022 21:54 >> To: John Johnson ; qemu-deve

[RFC v3 11/19] vfio-user: get region info

2021-11-08 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 14 include/hw/vfio/vfio-common.h | 4 +++- hw/vfio/common.c | 30 +- hw/vfio/user.c| 50 +

[RFC v3 13/19] vfio-user: pci_user_realize PCI setup

2021-11-08 Thread John Johnson
PCI BARs read from remote device PCI config reads/writes sent to remote server Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.c | 89 ++- 1 file changed, 88 insertions(+), 1 d

[RFC v3 09/19] vfio-user: define socket send functions

2021-11-08 Thread John Johnson
Also negotiate version with remote server Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson --- hw/vfio/user-protocol.h | 23 +++ hw/vfio/user.h | 1 + hw/vfio/pci.c | 11 ++ hw/vfio/user.c | 411 ++

[RFC v3 00/19] vfio-user client

2021-11-08 Thread John Johnson
worked on implementing a server with QEMU that is a separate patch series. Contributors: John G Johnson John Levon Thanos Makatos Elena Ufimtseva Jagannathan Raman Changes from v2->v3: John Johnson (18): vfio-user: add VFIO base abstract class Moved common vfio pci cli options to b

[RFC v3 02/19] vfio-user: add VFIO base abstract class

2021-11-08 Thread John Johnson
Add an abstract base class both the kernel driver and user socket implementations can use to share code. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 16 +++-- hw/vfio/pci.c | 112 +++-

[RFC v3 04/19] Add device IO ops vector

2021-11-08 Thread John Johnson
Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 28 hw/vfio/common.c | 159 ++ hw/vfio/pci.c |

[RFC v3 10/19] vfio-user: get device info

2021-11-08 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 13 + hw/vfio/user.h | 2 ++ hw/vfio/pci.c | 19 +++ hw/vfio/user.c | 40

[RFC v3 16/19] vfio-user: dma map/unmap operations

2021-11-08 Thread John Johnson
Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson --- hw/vfio/pci.h | 1 + hw/vfio/user-protocol.h | 32 +++ hw/vfio/user.h| 1 + include/hw/vfio/vfio-common.h | 4 + hw/vfio/common.c | 76

[RFC v3 07/19] vfio-user: connect vfio proxy to remote server

2021-11-08 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user.h| 78 +++ include/hw/vfio/vfio-common.h | 2 + hw/vfio/pci.c | 20 + hw/vfio/user.c| 170 ++

[RFC v3 05/19] Add validation ops vector

2021-11-08 Thread John Johnson
Validates cases where the return values aren't fully trusted (prep work for vfio-user, where the return values from the remote process aren't trusted) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 21 ++ hw/vfio/pci.c | 67 +

[RFC v3 14/19] vfio-user: get and set IRQs

2021-11-08 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 25 ++ hw/vfio/pci.c | 9 +++- hw/vfio/user.c | 128 3 files changed, 160 insertions(+), 2 d

[RFC v3 06/19] vfio-user: Define type vfio_user_pci_dev_info

2021-11-08 Thread John Johnson
New class for vfio-user with its class and instance constructors and destructors, and its pci ops. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 9 ++ hw/vfio/pci.c | 97 +++

[RFC v3 12/19] vfio-user: region read/write

2021-11-08 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 1 + hw/vfio/user-protocol.h | 12 + hw/vfio/user.h| 1 + include/hw/vfio/vfio-common.h | 1 + hw/vfio/common.c | 7 +

[RFC v3 17/19] vfio-user: dma read/write operations

2021-11-08 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 11 + hw/vfio/user.h | 4 ++ hw/vfio/pci.c | 105 hw/vfio/user.c | 78

[RFC v3 08/19] vfio-user: define socket receive functions

2021-11-08 Thread John Johnson
Add infrastructure needed to receive incoming messages Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 2 +- hw/vfio/user-protocol.h | 62 + hw/vfio/user.h | 9 +- hw/vfio/pci.c | 12 +-

[RFC v3 18/19] vfio-user: pci reset

2021-11-08 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user.h | 1 + hw/vfio/pci.c | 15 +++ hw/vfio/user.c | 12 3 files changed, 28 insertions(+) diff --git a/hw/vfio/user.h b/hw/vfio/user.h index e6c1091..7504681

[RFC v3 03/19] Add container IO ops vector

2021-11-08 Thread John Johnson
Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 34 +++ hw/vfio/common.c | 131 -- 2 files changed, 123 insertio

[RFC v3 01/19] vfio-user: introduce vfio-user protocol specification

2021-11-08 Thread John Johnson
From: Thanos Makatos This patch introduces the vfio-user protocol specification (formerly known as VFIO-over-socket), which is designed to allow devices to be emulated outside QEMU, in a separate process. vfio-user reuses the existing VFIO defines, structs and concepts. This patch is sourced fro

[RFC v3 19/19] vfio-user: migration support

2021-11-08 Thread John Johnson
bug fix: only set qemu file error if there is a file Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 18 + hw/vfio/migration.c | 34 +++ hw/vfio/pci.c | 7

[RFC v3 15/19] vfio-user: proxy container connect/disconnect

2021-11-08 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user.h| 1 + include/hw/vfio/vfio-common.h | 3 ++ hw/vfio/common.c | 98 +++ hw/vfio/pci.c | 24 +

[RFC v4 02/21] vfio-user: add VFIO base abstract class

2022-01-11 Thread John Johnson
Add an abstract base class both the kernel driver and user socket implementations can use to share code. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 16 +++-- hw/vfio/pci.c | 106 +++-

[RFC v4 09/21] vfio-user: define socket send functions

2022-01-11 Thread John Johnson
Also negotiate protocol version with remote server Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson --- hw/vfio/pci.h | 1 + hw/vfio/user-protocol.h | 41 + hw/vfio/user.h | 2 + hw/vfio/pci.c | 16 ++ hw/vfio/

[RFC v4 12/21] vfio-user: region read/write

2022-01-11 Thread John Johnson
Add support for posted writes on remote devices Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 1 + hw/vfio/user-protocol.h | 12 + hw/vfio/user.h| 1 + include/hw/vfio/vfio-common

[RFC v4 06/21] vfio-user: Define type vfio_user_pci_dev_info

2022-01-11 Thread John Johnson
New class for vfio-user with its class and instance constructors and destructors, and its pci ops. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h| 8 + hw/vfio/common.c | 5 hw/vfio/pci.c| 90 ++

[RFC v4 05/21] vfio-user: add device IO ops vector

2022-01-11 Thread John Johnson
Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 27 hw/vfio/common.c | 107 +++- hw/vfio/pci.c | 140 ++

[RFC v4 04/21] vfio-user: add region cache

2022-01-11 Thread John Johnson
cache VFIO_DEVICE_GET_REGION_INFO results to reduce memory alloc/free cycles and as prep work for vfio-user Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/ccw.c | 5 - hw/vfio

[RFC v4 11/21] vfio-user: get region info

2022-01-11 Thread John Johnson
Add per-region FD to support mmap() of remote device regions Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 14 ++ include/hw/vfio/vfio-common.h | 8 +++--- hw/vfio/common.c | 32 ++

[RFC v4 00/21] vfio-user client

2022-01-11 Thread John Johnson
the file exists New patch with just this fix found during vfio-user development Removed from v4: Add validation ops vector Generic checking moved to the corresponding vfio-user function Changes from v2->v3: John Johnson (18): vfio-user: add VFIO base abstract class Moved common v

[RFC v4 13/21] vfio-user: pci_user_realize PCI setup

2022-01-11 Thread John Johnson
PCI BARs read from remote device PCI config reads/writes sent to remote server Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.c | 275 -- 1 file changed, 172 insertions(+), 10

[RFC v4 01/21] vfio-user: introduce vfio-user protocol specification

2022-01-11 Thread John Johnson
From: Thanos Makatos This patch introduces the vfio-user protocol specification (formerly known as VFIO-over-socket), which is designed to allow devices to be emulated outside QEMU, in a separate process. vfio-user reuses the existing VFIO defines, structs and concepts. It has been earlier discu

[RFC v4 18/21] vfio-user: dma read/write operations

2022-01-11 Thread John Johnson
Messages from server to client that peform device DMA. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 11 + hw/vfio/user.h | 4 ++ hw/vfio/pci.c | 105

[RFC v4 07/21] vfio-user: connect vfio proxy to remote server

2022-01-11 Thread John Johnson
add user.c & user.h files for vfio-user code add proxy struct to handle comms with remote server Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user.h| 78 +++ include/hw/vfio/vfio-common.h | 2 + hw/

[RFC v4 21/21] Only set qemu file error if saving state so the file exists

2022-01-11 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/migration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index df63f5c..e72241d 100644 --- a/hw/vfio/migration.c +++ b/hw

[RFC v4 19/21] vfio-user: pci reset

2022-01-11 Thread John Johnson
Message to tell the server to reset the device. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user.h | 1 + hw/vfio/pci.c | 15 +++ hw/vfio/user.c | 12 3 files changed, 28 insertions(+) diff --git a/hw/vfi

[RFC v4 17/21] vfio-user: secure DMA support

2022-01-11 Thread John Johnson
Secure DMA forces the remote process to use DMA r/w messages instead of directly mapping guest memeory. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 1 + hw/vfio/user.h | 1 + hw/vfio/pci.c | 4 hw/vfio/user.c | 2 +-

[RFC v4 03/21] vfio-user: add container IO ops vector

2022-01-11 Thread John Johnson
Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 33 +++ hw/vfio/common.c | 126 -- 2 files changed, 117 insertio

[RFC v4 08/21] vfio-user: define socket receive functions

2022-01-11 Thread John Johnson
Add infrastructure needed to receive incoming messages Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 54 hw/vfio/user.h | 6 + hw/vfio/pci.c | 6 + hw/vfio/user.c | 327 +

[RFC v4 15/21] vfio-user: proxy container connect/disconnect

2022-01-11 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user.h| 1 + include/hw/vfio/vfio-common.h | 3 ++ hw/vfio/common.c | 105 ++ hw/vfio/pci.c | 25 ++

[RFC v4 10/21] vfio-user: get device info

2022-01-11 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 14 ++ hw/vfio/user.h | 2 ++ hw/vfio/pci.c | 26 ++ hw/vfio/user.c | 44 +

[RFC v4 14/21] vfio-user: get and set IRQs

2022-01-11 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 25 + hw/vfio/pci.c | 9 +++- hw/vfio/user.c | 131 3 files changed, 163 insertions(+), 2 de

[RFC v4 20/21] vfio-user: migration support

2022-01-11 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 18 + hw/vfio/migration.c | 30 +-- hw/vfio/pci.c | 7 +++ hw/vfio/user.c | 54

[RFC v4 16/21] vfio-user: dma map/unmap operations

2022-01-11 Thread John Johnson
Add ability to do async operations during memory transactions Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson --- hw/vfio/user-protocol.h | 32 +++ include/hw/vfio/vfio-common.h | 9 +- hw/vfio/common.c | 63 +---

Re: [RFC v4 20/21] vfio-user: migration support

2022-02-14 Thread John Johnson
> On Feb 11, 2022, at 5:31 AM, Thanos Makatos > wrote: > > >> -Original Message- >> From: Qemu-devel > bounces+thanos.makatos=nutanix....@nongnu.org> On Behalf Of John >> Johnson >> Sent: 12 January 2022 00:44 >> To: qemu-devel

Re: [RFC v4 08/21] vfio-user: define socket receive functions

2022-02-15 Thread John Johnson
> On Feb 15, 2022, at 6:50 AM, Thanos Makatos > wrote: > >>> > > On second thought, should we dump the entire header in case of such errors? > If not by default then at least in debug builds? I was thinking of adding qemu tracepoints in the recv and send paths for your other debug

[RFC v5 01/23] vfio-user: introduce vfio-user protocol specification

2022-05-05 Thread John Johnson
From: Thanos Makatos This patch introduces the vfio-user protocol specification (formerly known as VFIO-over-socket), which is designed to allow devices to be emulated outside QEMU, in a separate process. vfio-user reuses the existing VFIO defines, structs and concepts. It has been earlier discu

[RFC v5 18/23] vfio-user: secure DMA support

2022-05-05 Thread John Johnson
Secure DMA forces the remote process to use DMA r/w messages instead of directly mapping guest memeory. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 1 + hw/vfio/user.h | 1 + hw/vfio/pci.c | 4 hw/vfio/user.c | 2 +-

[RFC v5 09/23] vfio-user: define socket send functions

2022-05-05 Thread John Johnson
Also negotiate protocol version with remote server Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson --- hw/vfio/pci.h | 1 + hw/vfio/user-protocol.h | 41 + hw/vfio/user.h | 2 + hw/vfio/pci.c | 16 ++ hw/vfio/

[RFC v5 08/23] vfio-user: define socket receive functions

2022-05-05 Thread John Johnson
Add infrastructure needed to receive incoming messages Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 54 +++ hw/vfio/user.h | 8 + hw/vfio/pci.c | 6 + hw/vfio/user.c | 404 ++

[RFC v5 15/23] vfio-user: get and set IRQs

2022-05-05 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 25 + hw/vfio/pci.c | 9 +++- hw/vfio/user.c | 131 3 files changed, 163 insertions(+), 2 de

[RFC v5 07/23] vfio-user: connect vfio proxy to remote server

2022-05-05 Thread John Johnson
add user.c & user.h files for vfio-user code add proxy struct to handle comms with remote server Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user.h| 78 +++ include/hw/vfio/vfio-common.h | 2 + hw/

[RFC v5 04/23] vfio-user: add region cache

2022-05-05 Thread John Johnson
cache VFIO_DEVICE_GET_REGION_INFO results to reduce memory alloc/free cycles and as prep work for vfio-user Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/ccw.c | 5 - hw/vfio

[RFC v5 12/23] vfio-user: region read/write

2022-05-05 Thread John Johnson
Add support for posted writes on remote devices Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 1 + hw/vfio/user-protocol.h | 12 + hw/vfio/user.h| 1 + include/hw/vfio/vfio-common

[RFC v5 05/23] vfio-user: add device IO ops vector

2022-05-05 Thread John Johnson
Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 27 hw/vfio/common.c | 107 +++- hw/vfio/pci.c | 140 ++

[RFC v5 13/23] vfio-user: pci_user_realize PCI setup

2022-05-05 Thread John Johnson
PCI BARs read from remote device PCI config reads/writes sent to remote server Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.c | 275 -- 1 file changed, 172 insertions(+), 10

[RFC v5 14/23] vfio-user: forward msix BAR accesses to server

2022-05-05 Thread John Johnson
Server holds device current device pending state Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 1 + hw/vfio/pci.c | 112 ++ 2 files changed, 113 insertions(+) diff --g

[RFC v5 11/23] vfio-user: get region info

2022-05-05 Thread John Johnson
Add per-region FD to support mmap() of remote device regions Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 14 ++ include/hw/vfio/vfio-common.h | 8 +++--- hw/vfio/common.c | 32 ++

[RFC v5 21/23] vfio-user: add 'x-msg-timeout' option that specifies msg wait times

2022-05-05 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 1 + hw/vfio/user.h | 1 + hw/vfio/pci.c | 4 hw/vfio/user.c | 7 --- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index

[RFC v5 03/23] vfio-user: add container IO ops vector

2022-05-05 Thread John Johnson
Used for communication with VFIO driver (prep work for vfio-user, which will communicate over a socket) Signed-off-by: John G Johnson --- include/hw/vfio/vfio-common.h | 33 +++ hw/vfio/common.c | 126 -- 2 files changed, 117 insertio

[RFC v5 10/23] vfio-user: get device info

2022-05-05 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 14 + hw/vfio/user.h | 2 ++ hw/vfio/pci.c | 26 hw/vfio/user.c | 54

[RFC v5 22/23] vfio-user: add tracing to send/recv paths

2022-05-05 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user.c | 8 hw/vfio/trace-events | 5 + 2 files changed, 13 insertions(+) diff --git a/hw/vfio/user.c b/hw/vfio/user.c index ec2d89b..a3e4dc8 100644 --- a/hw/vfio/user.c

[RFC v5 00/23] vfio-user client

2022-05-05 Thread John Johnson
Hello, This is the 5th revision of the vfio-user client implementation. First of all, thank you for your time reviewing the previous versions. The vfio-user framework consists of 3 parts: 1) The VFIO user protocol specification. 2) A client - the VFIO device in QEMU that encapsulates VFIO mess

[RFC v5 17/23] vfio-user: dma map/unmap operations

2022-05-05 Thread John Johnson
Add ability to do async operations during memory transactions Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson --- hw/vfio/user-protocol.h | 32 +++ include/hw/vfio/vfio-common.h | 9 +- hw/vfio/common.c | 63 +---

[RFC v5 23/23] vfio-user: add dirty_bitmap stub until it support migration

2022-05-05 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/vfio/user.c b/hw/vfio/user.c index a3e4dc8..eb79785 100644 --- a/hw/vfio/user.c +++ b/hw/vfio/user.c @@ -1626,6 +16

[RFC v5 02/23] vfio-user: add VFIO base abstract class

2022-05-05 Thread John Johnson
Add an abstract base class both the kernel driver and user socket implementations can use to share code. Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h | 16 +++-- hw/vfio/pci.c | 106 +++-

[RFC v5 19/23] vfio-user: dma read/write operations

2022-05-05 Thread John Johnson
Messages from server to client that peform device DMA. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 11 ++ hw/vfio/user.h | 4 ++ hw/vfio/pci.c | 100 +++

[RFC v5 20/23] vfio-user: pci reset

2022-05-05 Thread John Johnson
Message to tell the server to reset the device. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user.h | 1 + hw/vfio/pci.c | 15 +++ hw/vfio/user.c | 12 3 files changed, 28 insertions(+) diff --git a/hw/vfi

[RFC v5 16/23] vfio-user: proxy container connect/disconnect

2022-05-05 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/user.h| 1 + include/hw/vfio/vfio-common.h | 3 ++ hw/vfio/common.c | 105 ++ hw/vfio/pci.c | 25 ++

[RFC v5 06/23] vfio-user: Define type vfio_user_pci_dev_info

2022-05-05 Thread John Johnson
New class for vfio-user with its class and instance constructors and destructors, and its pci ops. Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.h| 8 + hw/vfio/common.c | 5 hw/vfio/pci.c| 90 ++

[PATCH v1 22/24] vfio-user: add 'x-msg-timeout' option that specifies msg wait times

2022-11-08 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/pci.c | 4 hw/vfio/pci.h | 1 + hw/vfio/user.c | 7 +-- hw/vfio/user.h | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index

  1   2   >