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

2023-02-09 Thread John Johnson
> On Feb 8, 2023, at 12:33 PM, Alex Williamson > wrote: > > On Wed, 8 Feb 2023 06:38:27 + > John Johnson wrote: > >>> On Feb 6, 2023, at 11:07 AM, Alex Williamson >>> wrote: >>> >>> On Wed, 1 Feb 2023 21:55:48 -0800 >>&g

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

2023-02-09 Thread John Johnson
> On Feb 8, 2023, at 1:30 PM, Alex Williamson > wrote: > > On Wed, 8 Feb 2023 06:38:30 + > John Johnson wrote: > >>> On Feb 6, 2023, at 12:33 PM, Alex Williamson >>> wrote: >>> >>> On Wed, 1 Feb 2023 21:55:51 -0800 >>

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

2023-02-07 Thread John Johnson
> On Feb 6, 2023, at 11:07 AM, Alex Williamson > wrote: > > On Wed, 1 Feb 2023 21:55:48 -0800 > John Johnson wrote: > >> Add support for posted writes on remote devices >> >> Signed-off-by: Elena Ufimtseva >> Signed-off-by: John G Jo

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

2023-02-07 Thread John Johnson
> On Feb 6, 2023, at 12:33 PM, Alex Williamson > wrote: > > On Wed, 1 Feb 2023 21:55:51 -0800 > John Johnson wrote: > >> Server holds device current device pending state >> Use irq masking commands in socket case >> >> Signed-off-by: John G

[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

[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 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 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 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 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 +++-

[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

[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

[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

[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 +++---

[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 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 ++---

[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,

[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 |

[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 +++-

[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 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 |

[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 -

[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 +

[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

[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

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

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 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 22/24] vfio-user: add 'x-msg-timeout' option that specifies msg wait times

2022-12-15 Thread John Johnson
> On Dec 15, 2022, at 4:56 AM, Cédric Le Goater wrote: > > On 11/9/22 00:13, John Johnson wrote: >> >> +DEFINE_PROP_UINT32("x-msg-timeout", VFIOUserPCIDevice, wait_time, 0), > > I see that patch 9 introduced : > > +static int wait_time = 5

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

2022-12-13 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: >> >> + >> +/* must send all valid FDs or all invalid FDs in single msg */ > > why is that ? > This has to do with how VFIO sends FDs

Re: [PATCH v1 06/24] vfio-user: Define type vfio_user_pci_dev_info

2022-12-12 Thread John Johnson
> On Dec 12, 2022, at 1:01 AM, Cédric Le Goater wrote: > > On 11/9/22 00:13, John Johnson wrote: >> >> + >> +static Property vfio_user_pci_dev_properties[] = { >> +DEFINE_PROP_STRING("socket", VFIOUserPCIDevice, sock_name), > > Thi

Re: [PATCH v1 06/24] vfio-user: Define type vfio_user_pci_dev_info

2022-12-12 Thread John Johnson
> On Dec 12, 2022, at 3:46 AM, Philippe Mathieu-Daudé wrote: > > On 12/12/22 12:03, John Levon wrote: >> On Mon, Dec 12, 2022 at 10:01:33AM +0100, Cédric Le Goater wrote: diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 80b03a2..dc19869 100644 --- a/hw/vfio/pci.c +++

Re: [PATCH v1 19/24] vfio-user: secure DMA support

2022-12-12 Thread John Johnson
> On Dec 9, 2022, at 10:01 AM, John Levon wrote: > > On Tue, Nov 08, 2022 at 03:13:41PM -0800, John Johnson wrote: > >> Secure DMA forces the remote process to use DMA r/w messages >> instead of directly mapping guest memeory. > > I don't really get why this

Re: [PATCH v1 02/24] vfio-user: add VFIO base abstract class

2022-12-12 Thread John Johnson
I can look into using orderfile JJ > On Dec 9, 2022, at 8:04 AM, Cédric Le Goater wrote: > > Hello John, > > On 11/9/22 00:13, John Johnson wrote: >> Add an abstract base class both the kernel driver >> and user socket imple

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

2022-12-12 Thread John Johnson
> On Dec 9, 2022, at 9:29 AM, John Levon wrote: > > On Tue, Nov 08, 2022 at 03:13:36PM -0800, John Johnson wrote: > >> +static int vfio_user_io_get_irq_info(VFIODevice *vbasedev, >> + struct vfio_irq_info *irq) >> +{ >

Re: [PATCH v1 10/24] vfio-user: get device info

2022-12-12 Thread John Johnson
> On Dec 9, 2022, at 7:57 AM, John Levon wrote: > > On Tue, Nov 08, 2022 at 03:13:32PM -0800, John Johnson wrote: > >> +/* >> + * VFIO_USER_DEVICE_GET_INFO >> + * imported from struct_device_info >> + */ >> +typedef struct { >> +VFIOUserH

[PATCH v1 05/24] vfio-user: add device IO ops vector

2022-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 --- hw/vfio/ap.c | 1 + hw/vfio/ccw.c | 1 + hw/vfio/common.c | 107 +++-

[PATCH v1 10/24] vfio-user: get device info

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

[PATCH v1 11/24] vfio-user: get region info

2022-11-08 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/common.c | 32 --- hw/vfio/user-protocol.h | 14 ++ hw/vfio/user.c

[PATCH v1 20/24] vfio-user: dma read/write operations

2022-11-08 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/pci.c | 110 hw/vfio/user-protocol.h | 11 + hw/vfio/user.c

[PATCH v1 21/24] vfio-user: pci reset

2022-11-08 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.c | 15 +++ hw/vfio/user.c | 12 hw/vfio/user.h | 1 + 3 files changed, 28 insertions(+) diff --git

[PATCH v1 15/24] vfio-user: forward msix BAR accesses to server

2022-11-08 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/ccw.c | 1 + hw/vfio/common.c | 26 + hw/vfio/pci.c

[PATCH v1 17/24] vfio-user: dma map/unmap operations

2022-11-08 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/common.c | 63 +--- hw/vfio/user-protocol.h | 32 ++ hw/vfio/user.c| 220

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

2022-11-08 Thread John Johnson
Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- hw/vfio/pci.c | 7 ++- hw/vfio/user-protocol.h | 25 + hw/vfio/user.c | 135 3 files changed, 166 insertions(+), 1

[PATCH v1 13/24] vfio-user: pci_user_realize PCI setup

2022-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 | 277 -- 1 file changed, 174 insertions(+),

[PATCH v1 24/24] vfio-user: add trace points

2022-11-08 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/trace-events | 15 +++ hw/vfio/user.c | 26 ++ 2 files changed, 41 insertions(+) diff --git a/hw/vfio/trace-events b/hw/vfio/trace-events index

[PATCH v1 03/24] vfio-user: add container IO ops vector

2022-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 --- hw/vfio/common.c | 126 -- include/hw/vfio/vfio-common.h | 33 +++ 2 files changed, 117

[PATCH v1 01/24] vfio-user: introduce vfio-user protocol specification

2022-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. It has been earlier

[PATCH v1 18/24] vfio-user: add dma_unmap_all

2022-11-08 Thread John Johnson
Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/common.c | 45 ++- hw/vfio/user.c| 24 +++ include/hw/vfio/vfio-common.h | 3 +++ 3 files changed,

[PATCH v1 07/24] vfio-user: connect vfio proxy to remote server

2022-11-08 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 --- MAINTAINERS | 4 + hw/vfio/meson.build | 1 + hw/vfio/pci.c

[PATCH v1 16/24] vfio-user: proxy container connect/disconnect

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

[PATCH v1 08/24] vfio-user: define socket receive functions

2022-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 --- MAINTAINERS | 1 + hw/vfio/pci.c | 11 ++ hw/vfio/user-protocol.h | 54 +++ hw/vfio/user.c | 399

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

2022-11-08 Thread John Johnson
Add new message to send multiple writes to server Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman --- hw/vfio/user-protocol.h | 21 hw/vfio/user.c | 128 +++- hw/vfio/user.h |

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

2022-11-08 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 --- hw/vfio/ccw.c | 5 - hw/vfio/common.c | 41

[PATCH v1 06/24] vfio-user: Define type vfio_user_pci_dev_info

2022-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/Kconfig | 10 +++ hw/vfio/common.c | 5 hw/vfio/pci.c| 89

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

2022-11-08 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.c | 15 ++ hw/vfio/pci.h | 1 + hw/vfio/user-protocol.h | 62 ++ hw/vfio/user.c | 508

[PATCH v1 00/24] vfio-user client

2022-11-08 Thread John Johnson
to handle the protocol to implement the third part. 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 John Johnson (23): vfio-user: add VFIO base abstract class vfio-user

[PATCH v1 02/24] vfio-user: add VFIO base abstract class

2022-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.c | 106 +++---

[PATCH v1 12/24] vfio-user: region read/write

2022-11-08 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/common.c | 10 +++- hw/vfio/pci.c | 9 +++- hw/vfio/pci.h | 1 + hw/vfio/user-protocol.h

[PATCH v1 19/24] vfio-user: secure DMA support

2022-11-08 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.c | 4 hw/vfio/pci.h | 1 + hw/vfio/user.c | 2 +- hw/vfio/user.h | 1 +

[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

megasa regression in 7.1?

2022-10-27 Thread John Johnson
I pulled 7.1, and the megasas driver stopped being able to do reads from a disk. It looks to be related to this commit: https://github.com/qemu/qemu/commit/fe9d8927e265fd723a6dc87cd6d220f4677dbe1f#diffe3f5f30efc54747e0624dca63e5f55f0012736c1875b6e85526b3514e6911be3 which added some

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

2022-07-22 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 v10 13/14] vfio-user: handle device interrupts

2022-06-03 Thread John Johnson
> On Jun 1, 2022, at 1:26 PM, Alex Williamson > wrote: > > On Wed, 1 Jun 2022 17:00:54 + > Jag Raman wrote: >> >> Hi Alex, >> >> Just to add some more detail, the emulated PCI device in QEMU presently >> maintains a MSIx table (PCIDevice->msix_table) and Pending Bit Array. In the >>

Re: [PATCH v10 13/14] vfio-user: handle device interrupts

2022-06-01 Thread John Johnson
> On May 31, 2022, at 2:45 PM, Alex Williamson > wrote: > > On Tue, 31 May 2022 22:03:14 +0100 > Stefan Hajnoczi wrote: > >> On Tue, 31 May 2022 at 21:11, Alex Williamson >> wrote: >>> >>> On Tue, 31 May 2022 15:01:57 + >>> Jag Raman wrote: >>> > On May 25, 2022, at 10:53 AM,

[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

[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 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

[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 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 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

[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

[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 ---

[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 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

[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 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 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

[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(+),

[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 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 +

[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 -

[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 +

[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

[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 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 ++

[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 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

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

2022-03-14 Thread John Johnson
> On Mar 9, 2022, at 2:34 PM, Alex Williamson > wrote: > >> >> + >> +VFIO region info type cap >> +" >> + >> +The VFIO region info type is defined in >> +(``struct vfio_region_info_cap_type``). >> + >> ++-++--+ >> +| Name| Offset | Size |

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

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-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

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

[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 +---

[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

  1   2   >