Re: [PATCH] vfio/pci: vfio_pci_put_device on failure

2025-05-27 Thread John Levon
a/hw/vfio/pci.c > +++ b/hw/vfio/pci.c > @@ -3296,6 +3296,7 @@ out_teardown: > vfio_bars_exit(vdev); > error: > error_prepend(errp, VFIO_MSG_PREFIX, vbasedev->name); > +vfio_pci_put_device(vdev); > } > > static void vfio_instance_finalize(Object *obj) Reviewed-by: John Levon

Re: [PULL 0/6] Python patches

2025-05-27 Thread John Snow
On Fri, May 23, 2025 at 3:45 PM Stefan Hajnoczi wrote: > On Mon, May 19, 2025 at 1:03 PM John Snow wrote: > > > > The following changes since commit > 757a34115e7491744a63dfc3d291fd1de5297ee2: > > > > Merge tag 'pull-nvme-20250515' of https://gitlab.co

Re: [PATCH v2 00/29] vfio-user client

2025-05-27 Thread John Levon
On Tue, May 27, 2025 at 11:39:48AM +0200, Cédric Le Goater wrote: > On 5/20/25 17:03, John Levon wrote: > > The series contains an implement of a vfio-user client in QEMU, along with > > a few > > more preparatory patches. > > I am planning to take first patches 2

Re: [PATCH v2 07/29] vfio: add per-region fd support

2025-05-27 Thread John Levon
*always* correct, and there is less chance of a bug > > where > > somebody incorrectly uses vbasedev fd instead. IMO "region->fd" is much > > cleaner/clearer. > > maybe. It's only used in one place : vfio_region_mmap(). I think caching the > fd value under VFIORegion is overkill. OK, will do. thanks john

[PATCH v3 3/4] qapi: remove trivial "Returns:" sections

2025-05-23 Thread John Snow
ome information (potentially helpful, potentially not) but repeats the type information to remove that type. Signed-off-by: John Snow --- qapi/audio.json | 2 -- qapi/block-core.json | 8 qapi/char.json | 8 qapi/cryptodev.json | 2 -- qapi/machine-t

[PATCH v3 4/4] qapi: rephrase return docs to avoid type name

2025-05-23 Thread John Snow
Well, I tried. Maybe not very hard. Sorry! Signed-off-by: John Snow --- qapi/block-core.json | 6 +++--- qapi/block-export.json | 2 +- qapi/block.json | 2 +- qapi/control.json| 5 ++--- qapi/dump.json | 5 ++--- qapi/introspect.json | 6 +++--- qapi

[PATCH v3 2/4] docs, qapi: generate undocumented return sections

2025-05-23 Thread John Snow
This patch changes the qapidoc transmogrifier to generate Return value documentation for any command that has a return value but hasn't explicitly documented that return value. Signed-off-by: John Snow --- docs/sphinx/qapidoc.py | 14 -- scripts/qapi/parser.py

[PATCH v3 1/4] docs/qapi-domain: add return-nodesc

2025-05-23 Thread John Snow
because Sphinx always expects both a type and a description for the prior form and will format it accordingly. To have a reasonable rendering when the body is missing, we need to use a different info field list entirely. Signed-off-by: John Snow --- docs/devel/qapi-

[PATCH v3 0/4] qapi: add auto-generated return docs

2025-05-23 Thread John Snow
v3: rebased on top of python-qapi-linting (v4) pull request; removed commits that are no longer needed. Markus: I forget where we left off... shall we refresh? v2: fix multi-return-sections bug :( John Snow (4): docs/qapi-domain: add return-nodesc docs, qapi: generate undocumented

[PATCH 1/1] docs/qapi-domain: Improve QAPI indices

2025-05-23 Thread John Snow
ase insensitive manner for all categories, now. Lastly, the "main" QAPI Index (qapi-index.html) is altered to index *everything* from all namespaces, adding disambiguation where necessary to do so. Signed-off-by: John Snow --- docs/sphinx/qapi_domain.py | 51 +++--

[PATCH 0/1] Sphinx: refactor QAPI indices

2025-05-23 Thread John Snow
RFC quality - what do we think about this style of index vs the one we currently have? John Snow (1): docs/qapi-domain: Improve QAPI indices docs/sphinx/qapi_domain.py | 51 +++--- 1 file changed, 37 insertions(+), 14 deletions(-) -- 2.48.1

Re: [PULL 0/6] Python patches

2025-05-23 Thread John Snow
On Tue, May 20, 2025 at 9:38 AM Stefan Hajnoczi wrote: > Applied, thanks. > > Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for > any user-visible changes. > Did these get dropped? I don't see them in origin/master. --js

Re: [PATCH 5/8] python: convert remaining deprecated type hints for 3.9+

2025-05-22 Thread John Snow
On Tue, May 20, 2025 at 5:31 AM Markus Armbruster wrote: > John Snow writes: > > > In this patch, we don't have a builtin type to use for a type hint, but > > we do have collections.abc and other standard library types. Replace > > deprecated type hints with their

Re: [PATCH 4/8] python: use 3.9+ builtin type hints

2025-05-22 Thread John Snow
On Tue, May 20, 2025 at 5:26 AM Markus Armbruster wrote: > John Snow writes: > > > This patch changes type hints that have built-in equivalents as of > > Python 3.9. The versions we currently use, imported from the typing > > module, have been deprecated since 3.9 and ma

Re: [PATCH 2/8] python: update pylint ignores

2025-05-22 Thread John Snow
On Tue, May 20, 2025 at 3:42 AM Markus Armbruster wrote: > John Snow writes: > > > The next patch will synchronize the qemu.qmp library with the external, > > standalone version. That synchronization will require a few extra > > ignores for pylint, so do that now. > &

[PATCH 2/3] docs: remove legacy QAPI manual generator

2025-05-22 Thread John Snow
Thanks for your service! Remove the old qapidoc and the option to enable the transmogrifier, leaving the transmogrifier as the ONLY qapi doc generator. This has the side effect of converting the tests to use the new system, too. Signed-off-by: John Snow --- docs/interop/qemu-ga-ref.rst

[PATCH 0/3] docs: remove legacy qapidoc

2025-05-22 Thread John Snow
This series is RFC-ish and based on python-qapi-linting-v4, which I think ... should show up in origin/master soon(?). John Snow (3): docs: fix errors formatting in test-good docs: remove legacy QAPI manual generator docs: remove special parsing for freeform sections docs/devel/qapi-code

[PATCH 3/3] docs: remove special parsing for freeform sections

2025-05-22 Thread John Snow
dvise! Signed-off-by: John Snow --- docs/devel/qapi-code-gen.rst | 28 ++--- docs/interop/firmware.json | 4 ++- docs/interop/vhost-user.json | 4 ++- docs/sphinx/qapidoc.py | 37 +--- qapi/acpi.json

[PATCH 1/3] docs: fix errors formatting in test-good

2025-05-22 Thread John Snow
ll want to. Signed-off-by: John Snow --- tests/qapi-schema/doc-good.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json index 14b808f9090..6dcde8fd7e8 100644 --- a/tests/qapi-schema/doc-good.json +++ b/tests/q

Re: [PATCH] vfio/container: pass MemoryRegion to DMA operations

2025-05-21 Thread John Levon
On Wed, May 21, 2025 at 10:55:34PM +0100, John Levon wrote: > Pass through the MemoryRegion to DMA operation handlers of vfio > containers. The vfio-user container will need this later, to translate > the vaddr into an offset for the dma map vfio-user message; CPR will > also wi

[PATCH] vfio/container: pass MemoryRegion to DMA operations

2025-05-21 Thread John Levon
Pass through the MemoryRegion to DMA operation handlers of vfio containers. The vfio-user container will need this later, to translate the vaddr into an offset for the dma map vfio-user message; CPR will also will need this. Originally-by: John Johnson Signed-off-by: Jagannathan Raman Signed

Re: [PATCH v2 10/29] vfio/container: pass MemoryRegion to DMA operations

2025-05-21 Thread John Levon
gt; so the "p" is understood. Sure. > This comment for @dma_map needs polishing for clarity: > > + * Map an address range into the container. Note that @mrp will within an > + * RCU read lock region across this call. Will fix thanks john

Re: [PATCH v2 05/29] vfio: export PCI helpers needed for vfio-user

2025-05-21 Thread John Levon
fio-user support migration ? Not yet: we dropped support during the v2 changeover. Happy to drop the save/load config in the meantime. regards john

Re: [PATCH v2 10/29] vfio/container: pass MemoryRegion to DMA operations

2025-05-21 Thread John Levon
On Wed, May 21, 2025 at 09:43:11AM +0200, Cédric Le Goater wrote: > !---| > CAUTION: External Email > > |---! > > +Steven, > > On 5/20/25

Re: [PATCH v2 07/29] vfio: add per-region fd support

2025-05-21 Thread John Levon
uses vbasedev fd instead. IMO "region->fd" is much cleaner/clearer. But, if you don't like that, yes, I can drop region->fd in favour of the above. thanks john

[PATCH] vfio: add more VFIOIOMMUClass docs

2025-05-20 Thread John Levon
Add some additional doc comments for these class methods. Signed-off-by: John Levon --- include/hw/vfio/vfio-container-base.h | 75 +-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/include/hw/vfio/vfio-container-base.h b/include/hw/vfio/vfio-container

[PATCH v2 06/29] vfio: enable per-IRQ MSI-X masking

2025-05-20 Thread John Levon
If VFIO_IRQ_INFO_MASKABLE is set for VFIO_PCI_MSIX_IRQ_INDEX, record this in ->can_mask_msix, and use it to individually mask MSI-X interrupts as needed. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio/pc

[PATCH v2 29/29] docs: add vfio-user documentation

2025-05-20 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 v2 01/29] vfio: add more VFIOIOMMUClass docs

2025-05-20 Thread John Levon
Add some additional doc comments for these class methods. Signed-off-by: John Levon --- include/hw/vfio/vfio-container-base.h | 64 ++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/include/hw/vfio/vfio-container-base.h b/include/hw/vfio/vfio-container

[PATCH v2 22/29] vfio-user: set up container access to the proxy

2025-05-20 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 v2 18/29] vfio-user: implement VFIO_USER_REGION_READ/WRITE

2025-05-20 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 v2 16/29] vfio-user: implement VFIO_USER_DEVICE_GET_INFO

2025-05-20 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 | 23 ++ hw/vfio-user/protocol.h | 12 ++ hw/vfio-user/proxy.h

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

2025-05-20 Thread John Levon
Add new message to send multiple writes to server in a single message. Prevents the outgoing queue from overflowing when a long latency operation is followed by a series of posted writes. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by

[PATCH v2 27/29] vfio-user: support posted writes

2025-05-20 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 v2 10/29] vfio/container: pass MemoryRegion to DMA operations

2025-05-20 Thread John Levon
Pass through the MemoryRegion to DMA operation handlers of vfio containers. The vfio-user container will need this later, to translate the vaddr into an offset for the dma map vfio-user message. Originally-by: John Johnson Signed-off-by: Jagannathan Raman Signed-off-by: Elena Ufimtseva Signed

[PATCH v2 12/29] vfio-user: add vfio-user class and container

2025-05-20 Thread John Levon
c. Add hw/vfio-user/pci.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 | 2 + hw/v

[PATCH v2 26/29] vfio-user: add 'x-msg-timeout' option

2025-05-20 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 v2 20/29] vfio-user: implement VFIO_USER_DEVICE_GET/SET_IRQ*

2025-05-20 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 v2 11/29] vfio-user: introduce vfio-user protocol specification

2025-05-20 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|8 +- docs/devel/index-internals.rst |1 + docs/devel/vfio-user.rst

[PATCH v2 21/29] vfio-user: forward MSI-X PBA BAR accesses to server

2025-05-20 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 v2 15/29] vfio-user: implement message send infrastructure

2025-05-20 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 v2 17/29] vfio-user: implement VFIO_USER_DEVICE_GET_REGION_INFO

2025-05-20 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 v2 03/29] vfio: move config space read into vfio_pci_config_setup()

2025-05-20 Thread John Levon
Small cleanup that reduces duplicate code for vfio-user and reduces the size of vfio_realize(); while we're here, correct that name to vfio_pci_realize(). Signed-off-by: John Levon Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 31 --- 1 file change

[PATCH v2 13/29] vfio-user: connect vfio proxy to remote server

2025-05-20 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 | 82 + include/hw/vfio/vfio-device.h | 2 + hw/vfio-user/pci.c| 17 hw/vfio-us

[PATCH v2 25/29] vfio-user: implement VFIO_USER_DMA_READ/WRITE

2025-05-20 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

Re: [PATCH 00/27] vfio-user client

2025-05-20 Thread John Levon
st do basic testing (although no DMA). > > Can't we update the asset and use newer images ? It's also possible > to use a custom build, buildroot images for instance. Mark is going to help me out with this, stay tuned. In the meantime I sent out a v2 of the series, as there's a couple of additional generic vfio patches you might want to review. thanks john

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

2025-05-20 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 | 28 1 file changed, 28 insertions

[PATCH v2 14/29] vfio-user: implement message receive infrastructure

2025-05-20 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 | 56 ++ hw/vfio

[PATCH v2 04/29] vfio: refactor out IRQ signalling setup

2025-05-20 Thread John Levon
This makes for a slightly more readable vfio_msix_vector_do_use() implementation, and we will rely on this shortly. Signed-off-by: John Levon Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git

[PATCH v2 08/29] vfio: mark posted writes in region write callbacks

2025-05-20 Thread John Levon
For vfio-user, the region write implementation needs to know if the write is posted; add the necessary plumbing to support this. Signed-off-by: John Levon --- include/hw/vfio/vfio-device.h | 4 ++-- include/hw/vfio/vfio-region.h | 1 + hw/vfio/device.c | 3 ++- hw/vfio/pci.c

[PATCH v2 00/29] vfio-user client

2025-05-20 Thread John Levon
- separated out vfio pci exports and renamed to vfio_pci namespace John Levon (27): vfio: add more VFIOIOMMUClass docs vfio: move more cleanup into vfio_pci_put_device() vfio: move config space read into vfio_pci_config_setup() vfio: refactor out IRQ signalling setup vfio: export PCI helpers

[PATCH v2 09/29] vfio: return mr from vfio_get_xlat_addr

2025-05-20 Thread John Levon
From: Steve Sistare Modify memory_get_xlat_addr and vfio_get_xlat_addr to return the memory region that the translated address is found in. This will be needed by CPR in a subsequent patch to map blocks using IOMMU_IOAS_MAP_FILE. Also return the xlat offset, so we can simplify the interface by

[PATCH v2 24/29] vfio-user: implement VFIO_USER_DMA_MAP/UNMAP

2025-05-20 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 v2 23/29] vfio-user: implement VFIO_USER_DEVICE_RESET

2025-05-20 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 v2 07/29] vfio: add per-region fd support

2025-05-20 Thread John Levon
For vfio-user, each region has its own fd rather than sharing vbasedev's. Add the necessary plumbing to support this. For vfio backends with a shared fd, initialize region->fd to the shared one. Signed-off-by: John Levon --- include/hw/vfio/vfio-device.h | 7 +-- include/hw/v

[PATCH v2 02/29] vfio: move more cleanup into vfio_pci_put_device()

2025-05-20 Thread John Levon
All of the cleanup can be done in the same place, and vfio-user will want to do the same. Signed-off-by: John Levon Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index

[PATCH v2 05/29] vfio: export PCI helpers needed for vfio-user

2025-05-20 Thread John Levon
The vfio-user code will need to re-use various parts of the vfio PCI code. Export them in hw/vfio/pci.h, and rename them to the vfio_pci_* namespace. Signed-off-by: John Levon --- hw/vfio/pci.h| 14 hw/vfio/pci.c| 54 ++-- hw

[PATCH 5/8] python: convert remaining deprecated type hints for 3.9+

2025-05-19 Thread John Snow
nd will be dropped from a Python release in the future, so I am just getting ahead of it before it causes a problem. (Granted, yes, in practice this just means we're usually importing from collections.abc instead of typing, but... ah well. What are you gonna do.)

[PATCH 6/8] python: clean up requirements for 3.9+

2025-05-19 Thread John Snow
We don't need these requirements anymore, so remove them. Signed-off-by: John Snow --- python/setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/python/setup.cfg b/python/setup.cfg index 02cc076eaea..1afdcf1c3cd 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -41,7

[PATCH 8/8] python: remove version restriction for mypy

2025-05-19 Thread John Snow
. Signed-off-by: John Snow --- python/setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/python/setup.cfg b/python/setup.cfg index 1afdcf1c3cd..7d50909b4ec 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -77,7 +77,6 @@ exclude = __pycache__, [mypy] strict = True -python_version

[PATCH 3/8] python: sync changes from external qemu.qmp package

2025-05-19 Thread John Snow
for now, it is. NB: A few changes are not synchronized; mostly license and documentation strings. Everything functional is fully copied verbatim. The license strings are not sync'd only because they point to different LICENSE filenames for the different repositories. Signed-off-by: John

[PATCH 4/8] python: use 3.9+ builtin type hints

2025-05-19 Thread John Snow
-ci' | xargs sed -i -e 's/Type\[/type\[/g' I then used "git add -p" and excluded changes by hand that weren't appropriate. I then reviewed all of the changed files by hand to review the imports and update them accordingly. Signed-off-by: John Snow --- docs/sphinx/c

[PATCH 7/8] python: update mkvenv to type-check under different python versions

2025-05-19 Thread John Snow
import logic in mkvenv.py to make it type check under a wider range of python versions. Signed-off-by: John Snow --- python/scripts/mkvenv.py | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/scripts/mkvenv.py b/python/scripts/mkvenv.py index b626903fa8d

[PATCH 1/8] python: convert packages to PEP517/pyproject.toml

2025-05-19 Thread John Snow
that change as a result of the different build/packaging/installation pathways. This change has the effect of fixing "make check-dev", which has been broken on newer versions of Fedora for a while, now. Signed-off-by: John Snow --- python/README.rst| 33 --

[PATCH 2/8] python: update pylint ignores

2025-05-19 Thread John Snow
The next patch will synchronize the qemu.qmp library with the external, standalone version. That synchronization will require a few extra ignores for pylint, so do that now. Signed-off-by: John Snow --- python/setup.cfg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a

[PATCH 0/8] Python: Fix 'make check-dev' and modernize to 3.9+

2025-05-19 Thread John Snow
D) Update the mypy configuration to check under multiple Python versions more effectively and thoroughly. Whew. --js John Snow (8): python: convert packages to PEP517/pyproject.toml python: update pylint ignores python: sync changes from external qemu.qmp package python: use 3.9+ b

Re: [PATCH v4 0/6] python: add QAPI and qapidoc et al to python tests

2025-05-19 Thread John Snow
On Thu, May 15, 2025 at 4:38 AM Markus Armbruster wrote: > John Snow writes: > > > Hiya, this series turns on automated linting for scripts/qapi, > > docs/sphinx/qapidoc.py and docs/sphinx/qapi_domain.py. > > > > This includes flake8/isort/pylint/mypy for scripts

Re: [PATCH 0/3] docs: Bump sphinx to 6.2.1

2025-05-19 Thread John Snow
gt; > Bump sphinx to 6.2.1 and also sphinx_rtd_theme as required for the new > sphinx version. > > Signed-off-by: Akihiko Odaki > Reviewed-by: John Snow I figure if this causes issues, this early in the development cycle we can roll it back or pursue alternate solutions if nece

[PULL 5/6] python: Drop redundant warn_unused_configs = True

2025-05-19 Thread John Snow
From: Markus Armbruster strict = True implies warn_unused_configs = True. Signed-off-by: Markus Armbruster Signed-off-by: John Snow Reviewed-by: Markus Armbruster Message-id: 20250512193357.3388514-6-js...@redhat.com Signed-off-by: John Snow --- python/setup.cfg | 1 - 1 file changed, 1

[PULL 0/6] Python patches

2025-05-19 Thread John Snow
hon static analysis checks John Snow (5): qapi: Add some pylint ignores docs/qapidoc: linting fixes python: update missing dependencies from minreqs python: add qapi static analysis tests qapi: delete un-needed python static analys

[PULL 3/6] python: update missing dependencies from minreqs

2025-05-19 Thread John Snow
le by accident; as a result, pip's dependency solver can pull in newer dependencies, which we don't want. This patch corrects the previous oversight and pins the missing dependencies. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Message-id: 20250512193357.3388514-4-js...@redha

[PULL 6/6] qapi: delete un-needed python static analysis configs

2025-05-19 Thread John Snow
the python/ directory settings that we need a chit-chat on how to merge them O:-) Signed-off-by: John Snow Reviewed-by: Markus Armbruster Message-id: 20250512193357.3388514-7-js...@redhat.com Signed-off-by: John Snow --- scripts/qapi/.flake8| 3 --- scripts/qapi/.isort.cfg | 7

[PULL 1/6] qapi: Add some pylint ignores

2025-05-19 Thread John Snow
This restores the linting baseline in QAPI. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Message-id: 20250512193357.3388514-2-js...@redhat.com Signed-off-by: John Snow --- scripts/qapi/backend.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/qapi/backend.py b

[PULL 4/6] python: add qapi static analysis tests

2025-05-19 Thread John Snow
that QAPI tooling will be linted and type-checked from the GitLab pipelines. Signed-off-by: John Snow Reviewed-by: Markus Armbruster Message-id: 20250512193357.3388514-5-js...@redhat.com Signed-off-by: John Snow --- python/setup.cfg| 1 + python/tests/minreqs.txt| 21

[PULL 2/6] docs/qapidoc: linting fixes

2025-05-19 Thread John Snow
ot;isn't a python package". Configuring this manually, isort chooses a different import ordering, which _is_ intentional here. Also: extra ignores are added for pylint. The most recent versions of pylint don't require these ignores, but the oldest versions we support do, so in the extra ignores

Re: [PATCH V5] vfio: return mr from vfio_get_xlat_addr

2025-05-19 Thread John Levon
can be trivially derived from mr and xlat. > > Lastly, rename the functions to to memory_translate_iotlb() and > vfio_translate_iotlb(). > > Signed-off-by: Steve Sistare > Acked-by: David Hildenbrand Reviewed-by: John Levon regards john

Re: [PATCH 00/27] vfio-user client

2025-05-19 Thread John Levon
.fc31.x86_64 If somebody can help with how to get a suitable test initrd with this module available, we could at least do basic testing (although no DMA). regards john diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index 7a03d24805..80599454d4 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -1

Re: [PATCH 02/27] vfio/container: pass MemoryRegion to DMA operations

2025-05-18 Thread John Levon
ll send a separate patch for those (and also add a dma_map comment). regards john

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

2025-05-15 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 11/27] vfio-user: connect vfio proxy to remote server

2025-05-15 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 | 82 + include/hw/vfio/vfio-device.h | 2 + hw/vfio-user/pci.c| 17 hw/vfio-us

[PATCH 16/27] vfio-user: implement VFIO_USER_REGION_READ/WRITE

2025-05-15 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 18/27] vfio-user: implement VFIO_USER_DEVICE_GET/SET_IRQ*

2025-05-15 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 06/27] vfio: enable per-IRQ MSI-X masking

2025-05-15 Thread John Levon
If VFIO_IRQ_INFO_MASKABLE is set for VFIO_PCI_MSIX_IRQ_INDEX, record this in ->can_mask_msix, and use it to individually mask MSI-X interrupts as needed. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by: John Levon --- hw/vfio/pc

[PATCH 05/27] vfio: refactor out IRQ signalling setup

2025-05-15 Thread John Levon
This makes for a slightly more readable vfio_msix_vector_do_use() implementation, and we will rely on this shortly. Signed-off-by: John Levon --- hw/vfio/pci.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c

[PATCH 12/27] vfio-user: implement message receive infrastructure

2025-05-15 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 | 56 ++ hw/vfio

[PATCH 09/27] vfio-user: introduce vfio-user protocol specification

2025-05-15 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|8 +- docs/devel/index-internals.rst |1 + docs/devel/vfio-user.rst

[PATCH 04/27] vfio: move config space read into vfio_pci_config_setup()

2025-05-15 Thread John Levon
Small cleanup that reduces duplicate code for vfio-user. Signed-off-by: John Levon --- hw/vfio/pci.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index d96b55f80c..7912c17dd2 100644 --- a/hw/vfio/pci.c +++ b/hw

[PATCH 24/27] vfio-user: add 'x-msg-timeout' option

2025-05-15 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 14/27] vfio-user: implement VFIO_USER_DEVICE_GET_INFO

2025-05-15 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 | 23 ++ hw/vfio-user/protocol.h | 12 ++ hw/vfio-user/proxy.h

[PATCH 23/27] vfio-user: implement VFIO_USER_DMA_READ/WRITE

2025-05-15 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 03/27] vfio: move more cleanup into vfio_pci_put_device()

2025-05-15 Thread John Levon
All of the cleanup can be done in the same place, and vfio-user will want to do the same. Signed-off-by: John Levon --- hw/vfio/pci.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index a1bfdfe375..d96b55f80c 100644

[PATCH 10/27] vfio-user: add vfio-user class and container

2025-05-15 Thread John Levon
c. Add hw/vfio-user/pci.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 | 2 + hw/v

[PATCH 27/27] docs: add vfio-user documentation

2025-05-15 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

Re: [PATCH 01/27] vfio: return mr from vfio_get_xlat_addr

2025-05-15 Thread John Levon
On Thu, May 15, 2025 at 04:43:46PM +0100, John Levon wrote: > From: Steve Sistare > > Modify memory_get_xlat_addr and vfio_get_xlat_addr to return the memory > region that the translated address is found in. This will be needed by > CPR in a subsequent patch to m

[PATCH 20/27] vfio-user: set up container access to the proxy

2025-05-15 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 25/27] vfio-user: support posted writes

2025-05-15 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 22/27] vfio-user: implement VFIO_USER_DMA_MAP/UNMAP

2025-05-15 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 26/27] vfio-user: add coalesced posted writes

2025-05-15 Thread John Levon
Add new message to send multiple writes to server in a single message. Prevents the outgoing queue from overflowing when a long latency operation is followed by a series of posted writes. Originally-by: John Johnson Signed-off-by: Elena Ufimtseva Signed-off-by: Jagannathan Raman Signed-off-by

[PATCH 01/27] vfio: return mr from vfio_get_xlat_addr

2025-05-15 Thread John Levon
From: Steve Sistare Modify memory_get_xlat_addr and vfio_get_xlat_addr to return the memory region that the translated address is found in. This will be needed by CPR in a subsequent patch to map blocks using IOMMU_IOAS_MAP_FILE. Also return the xlat offset, so we can simplify the interface by

[PATCH 17/27] vfio-user: set up PCI in vfio_user_pci_realize()

2025-05-15 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/pci.h | 8 hw/vfio-user/pci.c | 28

  1   2   3   4   5   6   7   8   9   10   >