Re: [PATCH] vfio, migration: save device parent pci config

2025-07-16 Thread Huaitong Han
Cédric Le Goater 于2025年7月15日周二 14:25写道: > > On 7/14/25 04:37, Huaitong Han wrote: > > Hi, mst, clg > > > > Any comments? > > > Since this seems to be a GIC issue on the aarch64 virt platform, you > should cc: the virt-arm people for more insights. > > Also, the vfio-user devices have been merged v

[PULL 7/7] vfio/migration: Max in-flight VFIO device state buffers size limit

2025-07-15 Thread Cédric Le Goater
nk: https://lore.kernel.org/qemu-devel/4f7cad490988288f58e36b162d7a888ed7e7fd17.1752589295.git.maciej.szmigi...@oracle.com Signed-off-by: Cédric Le Goater --- docs/devel/migration/vfio.rst | 13 + include/hw/vfio/vfio-device.h | 1 + hw/vfio/migration-multifd.c | 21 +++-- hw/

[PULL 6/7] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-15 Thread Cédric Le Goater
com Signed-off-by: Cédric Le Goater --- docs/devel/migration/vfio.rst | 6 +++ hw/vfio/migration-multifd.h | 3 ++ hw/vfio/vfio-helpers.h| 2 + hw/vfio/vfio-migration-internal.h | 1 + include/hw/vfio/vfio-device.h | 1 + hw/core/machine.c | 1

[PATCH v2 2/2] vfio/migration: Max in-flight VFIO device state buffers size limit

2025-07-15 Thread Maciej S. Szmigiero
/migration/vfio.rst | 13 + hw/vfio/migration-multifd.c | 21 +++-- hw/vfio/pci.c | 9 + include/hw/vfio/vfio-device.h | 1 + 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/docs/devel/migration/vfio.rst b/docs/devel/migration/vfio

[PATCH v2 1/2] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-15 Thread Maciej S. Szmigiero
| 17 +++ hw/vfio/migration-multifd.c | 79 +++ hw/vfio/migration-multifd.h | 3 ++ hw/vfio/migration.c | 10 +++- hw/vfio/pci.c | 10 hw/vfio/vfio-helpers.h| 2 + hw/vfio/vfio-migration-inter

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-15 Thread Cédric Le Goater
Using 'strcmp(target_name(), "aarch64")' is quite unique in the QEMU code base, and to be honest, I’m not too keen on adding it unless there’s really no other option. The previous versions simply tested the TARGET_ARM macro but commit 5731baee6c3c ("hw/vfio: Compile some common objects once") ma

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-15 Thread Avihai Horon
On 15/07/2025 12:08, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 7/8/25 10:34, Avihai Horon wrote: On 24/06/2025 20:51, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" This property

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-15 Thread Cédric Le Goater
On 7/8/25 10:34, Avihai Horon wrote: On 24/06/2025 20:51, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" This property allows configuring whether to start the config load only after all iterables were loaded. Nit: maybe, to

Re: [PATCH 1/3] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-07-15 Thread Cédric Le Goater
But do we really need both x-migration-max-queued-buffers and x-migration-max-queued-buffers-size? I think one is sufficient. I vote for x-migration-max-queued-buffers-size as the actual memory limit won't change depending on VFIO migration buffer size. If just one of these limits were

Re: [PATCH] vfio, migration: save device parent pci config

2025-07-14 Thread Cédric Le Goater
On 7/14/25 04:37, Huaitong Han wrote: Hi, mst, clg Any comments? Since this seems to be a GIC issue on the aarch64 virt platform, you should cc: the virt-arm people for more insights. Also, the vfio-user devices have been merged very recently, ~1w ago, and, AFAICT, migration is not supported

Re: [PATCH v2 2/3] hw/vfio/vfio-migration: Remove unnecessary 'qemu/typedefs.h' include

2025-07-14 Thread Cédric Le Goater
On 7/8/25 10:58, Philippe Mathieu-Daudé wrote: "qemu/typedefs.h" is already included by "qemu/osdep.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/vfio-migration-internal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/vfio/vfio-migration-internal.h b/hw

Re: [PATCH] vfio, migration: save device parent pci config

2025-07-13 Thread Huaitong Han
Hi, mst, clg Any comments? Thanks. Huaitong Han Michael Tokarev 于2025年7月13日周日 17:12写道: > > Ping? Has this been forgotten? > > Thanks, > > /mjt > > On 05.06.2025 11:33, oen...@gmail.com wrote: > > From: Huguanshen Chen > > > > On arm64 virtualization platform, vfio-user devices lose their int

Re: [PATCH] vfio, migration: save device parent pci config

2025-07-13 Thread Michael Tokarev
Ping? Has this been forgotten? Thanks, /mjt On 05.06.2025 11:33, oen...@gmail.com wrote: From: Huguanshen Chen On arm64 virtualization platform, vfio-user devices lose their interrupts after migration to the destination. This issue occurs because qemu fails to deliver the msi device id to t

[PATCH v2 2/3] hw/vfio/vfio-migration: Remove unnecessary 'qemu/typedefs.h' include

2025-07-08 Thread Philippe Mathieu-Daudé
"qemu/typedefs.h" is already included by "qemu/osdep.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/vfio/vfio-migration-internal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/vfio/vfio-migration-internal.h b/hw/vfio/vfio-migration-internal.h index a8b456b239d

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-08 Thread Avihai Horon
| 1 + hw/vfio/migration-multifd.c | 88 +++ hw/vfio/migration-multifd.h | 3 ++ hw/vfio/migration.c | 10 +++- hw/vfio/pci.c | 9 hw/vfio/vfio-migration-internal.h | 1 + include/hw/vfio/vfio-device.h

Re: [PATCH 1/3] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-07-07 Thread Maciej S. Szmigiero
ual memory limit won't change depending on VFIO migration buffer size. If just one of these limits were to be implemented my vote would be also for the size limit rather than the count limit. However, if you pick x-migration-max-queued-buffers, maybe it's worth mentioning in the docs w

Re: [PATCH 3/3] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-07-07 Thread Avihai Horon
On 24/06/2025 20:51, Maciej S. Szmigiero wrote: External email: Use caution opening links or attachments From: "Maciej S. Szmigiero" There's already a max in-flight VFIO device state buffers *count* limit, add also max queued buffers *size* limit. Signed-off-by: Maciej S. Szmigiero Revi

Re: [PATCH 1/3] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-07-07 Thread Avihai Horon
ned-off-by: Maciej S. Szmigiero Reviewed-by: Avihai Horon But do we really need both x-migration-max-queued-buffers and x-migration-max-queued-buffers-size? I think one is sufficient. I vote for x-migration-max-queued-buffers-size as the actual memory limit won't change depending on

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-02 Thread Maciej S. Szmigiero
d ppc also deal with complex interrupt controllers, and those cases have been handled cleanly AFAICT. So what’s the fundamental issue here that makes it necessary to add more complexity to an already complex feature (multif VFIO migration) for what seems to be a corner case on a single architecture ?

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-01 Thread Cédric Le Goater
ndamental issue here that makes it necessary to add more complexity to an already complex feature (multif VFIO migration) for what seems to be a corner case on a single architecture ? d329f5032e17 is the turning point. Using 'strcmp(target_name(), "aarch64")' is quite unique in t

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-01 Thread Cédric Le Goater
nt way we could address this ? Other virt machines like x86 and ppc also deal with complex interrupt controllers, and those cases have been handled cleanly AFAICT. So what’s the fundamental issue here that makes it necessary to add more complexity to an already complex feature (multif VFIO migration)

Re: [PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-07-01 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > This property allows configuring whether to start the config load only > after all iterables were loaded. > Such interlocking is required for ARM64 due to this platform VFIO > dependency on interrupt controller being loaded first. >

Re: [PATCH 3/3] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-07-01 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > There's already a max in-flight VFIO device state buffers *count* limit, > add also max queued buffers *size* limit. > > Signed-off-by: Maciej S. Szmigiero Reviewed-by: Fabiano Rosas

Re: [PATCH 1/3] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-07-01 Thread Fabiano Rosas
"Maciej S. Szmigiero" writes: > From: "Maciej S. Szmigiero" > > Allow capping the maximum count of in-flight VFIO device state buffers > queued at the destination, otherwise a malicious QEMU source could > theoretically cause the target QEMU to allocate unlimited amounts of memory > for buffers-

[PATCH 1/3] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-06-24 Thread Maciej S. Szmigiero
xpected to be a realistic threat in most of VFIO live migration use cases and the right value depends on the particular setup disable the limit by default by setting it to UINT64_MAX. Signed-off-by: Maciej S. Szmigiero --- docs/devel/migration/vfio.rst | 13 + hw/vfio/migration-multif

[PATCH 3/3] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-06-24 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" There's already a max in-flight VFIO device state buffers *count* limit, add also max queued buffers *size* limit. Signed-off-by: Maciej S. Szmigiero --- docs/devel/migration/vfio.rst | 8 +++++--- hw/vfio/migration-multifd.c | 21 +++

[PATCH 2/3] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-06-24 Thread Maciej S. Szmigiero
hich means ON for ARM, OFF for other platforms. Signed-off-by: Maciej S. Szmigiero --- docs/devel/migration/vfio.rst | 6 +++ hw/core/machine.c | 1 + hw/vfio/migration-multifd.c | 88 +++ hw/vfio/migration-multifd.h | 3 ++ hw/vfio/m

[PATCH] vfio, migration: save device parent pci config

2025-06-05 Thread oenhan
From: Huguanshen Chen On arm64 virtualization platform, vfio-user devices lose their interrupts after migration to the destination. This issue occurs because qemu fails to deliver the msi device id to the vGIC. The error device id is calculated based on the device's parent bus, so it is essential

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-04-02 Thread Maciej S. Szmigiero
tness fix while the later are just additional functionalities. ok. I have kept both patches in my tree with the doc updates. I don't see the x-migration-load-config-after-iter patch in upstream QEMU anywhere. That's a bit concerning since it's a correctness fix - without it the

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-04-02 Thread Cédric Le Goater
x27;s a correctness fix - without it the multifd VFIO migration on ARM64 can fail. The existing patch still applies, but requires changing "#if defined(TARGET_ARM)" to "strcmp(target_name(), "aarch64") == 0" due to recent commit 5731baee6c3c ("hw/vfio: Compile s

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-04-02 Thread Cédric Le Goater
functionalities. ok. I have kept both patches in my tree with the doc updates. I don't see the x-migration-load-config-after-iter patch in upstream QEMU anywhere. That's a bit concerning since it's a correctness fix - without it the multifd VFIO migration on ARM64 can fail. The ex

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-04-01 Thread Maciej S. Szmigiero
ith the doc updates. I don't see the x-migration-load-config-after-iter patch in upstream QEMU anywhere. That's a bit concerning since it's a correctness fix - without it the multifd VFIO migration on ARM64 can fail. The existing patch still applies, but requires changing "#i

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-12 Thread Avihai Horon
On 11/03/2025 18:05, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/11/25 17:01, Avihai Horon wrote: On 11/03/2025 17:45, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/11/25 15:57, Avihai Horon wrote: On 11/

Re: [PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-11 Thread Maciej S. Szmigiero
have it now for completeness. Maciej, Could you please send a v2 with this change ?  and I've sent v2 now as a standalone patch. Fixes: 3228d311ab18 ("vfio/migration: Multifd device state transfer support - received buffers queuing") Fixes: 6d644baef203 ("vfio/migra

[PULL 11/21] vfio/migration: Use BE byte order for device state wire packets

2025-03-11 Thread Cédric Le Goater
o such use case, it's good to have it now for completeness. Reviewed-by: Avihai Horon Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/qemu-devel/dcfc04cc1a50655650dbac8398e2742ada84ee39.1741611079.git.maciej.szmigi...@oracle.com Signed-off-by: Cédric Le Goater --- hw

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-11 Thread Avihai Horon
g the data transfer in the new handler and doing it in the old save_state handler depending if VFIO multifd transfer is enabled or not. Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multifd.c | 142 ++ hw/vfio/migration-multifd.h | 6 ++

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-11 Thread Cédric Le Goater
On 3/11/25 17:01, Avihai Horon wrote: On 11/03/2025 17:45, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/11/25 15:57, Avihai Horon wrote: On 11/03/2025 15:04, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/7/2

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-11 Thread Avihai Horon
On 11/03/2025 17:45, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/11/25 15:57, Avihai Horon wrote: On 11/03/2025 15:04, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/7/25 14:45, Maciej S. Szmigiero wrote: O

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-11 Thread Cédric Le Goater
On 3/11/25 15:57, Avihai Horon wrote: On 11/03/2025 15:04, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 3/7/25 14:45, Maciej S. Szmigiero wrote: On 7.03.2025 13:03, Cédric Le Goater wrote: On 3/7/25 11:57, Maciej S. Szmigiero wrote: From: "Maciej S. S

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-11 Thread Avihai Horon
ffects the bit stream. add also max queued buffers *size* limit. Signed-off-by: Maciej S. Szmigiero ---   docs/devel/migration/vfio.rst |  8 +---   hw/vfio/migration-multifd.c   | 21 +++--   hw/vfio/pci.c |  9 +   include/hw/vfio/vfio-common.h |  1 +   4

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-11 Thread Cédric Le Goater
--   docs/devel/migration/vfio.rst |  8 +++++---   hw/vfio/migration-multifd.c   | 21 +++--   hw/vfio/pci.c |  9 +   include/hw/vfio/vfio-common.h |  1 +   4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/docs/devel/migration/vfio.rst b/docs

Re: [PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Cédric Le Goater
here is no such use case, it's good to have it now for completeness. Maciej, Could you please send a v2 with this change ?  and I've sent v2 now as a standalone patch. Fixes: 3228d311ab18 ("vfio/migration: Multifd device state transfer support - received buffers queuing&quo

Re: [PATCH v2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Cédric Le Goater
different endianness. Although currently there is no such use case, it's good to have it now for completeness. Reviewed-by: Avihai Horon Signed-off-by: Maciej S. Szmigiero ---> hw/vfio/migration-multifd.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) Applied to

[PATCH v2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Maciej S. Szmigiero
o such use case, it's good to have it now for completeness. Reviewed-by: Avihai Horon Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multifd.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/vfio/migration-multifd.c b/hw/vfio/migration-

Re: [PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Maciej S. Szmigiero
aragraph to the commit message in v2. Fixes: 3228d311ab18 ("vfio/migration: Multifd device state transfer support - received buffers queuing") Fixes: 6d644baef203 ("vfio/migration: Multifd device state transfer support - send side") Signed-off-by: Maciej S. Szmigiero

Re: [PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Cédric Le Goater
you please send a v2 with this change ? and Fixes: 3228d311ab18 ("vfio/migration: Multifd device state transfer support - received buffers queuing") Fixes: 6d644baef203 ("vfio/migration: Multifd device state transfer support - send side") we don't need these Fixes

Re: [PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Avihai Horon
d we add a sentence about the motivation? Something like: This will allow VFIO multifd device state transfer between hosts with different endianness. Although currently there is no such use case, it's good to have it now for completeness. Fixes: 3228d311ab18 ("vfio/migration: Multifd d

Re: [PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Cédric Le Goater
On 3/7/25 11:57, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Wire data commonly use BE byte order (including in the existing migration protocol), use it also for for VFIO device state packets. Fixes: 3228d311ab18 ("vfio/migration: Multifd device state transfer supp

Re: [PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-10 Thread Cédric Le Goater
b18 ("vfio/migration: Multifd device state transfer support - received buffers queuing") Fixes: 6d644baef203 ("vfio/migration: Multifd device state transfer support - send side") Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multifd.c | 15 ++- 1 fil

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-09 Thread Avihai Horon
ead inside save_live_complete_precopy_thread handler. Switch between doing the data transfer in the new handler and doing it in the old save_state handler depending if VFIO multifd transfer is enabled or not. Signed-off-by: Maciej S. Szmigiero ---   hw/vfio/migration-multifd.c   | 142 ++++++

[PULL 29/42] vfio/migration: Add vfio_add_bytes_transferred()

2025-03-07 Thread Cédric Le Goater
From: "Maciej S. Szmigiero" This way bytes_transferred can also be incremented in other translation units than migration.c. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/qemu-devel/d1fbc27ac2417b49892f354ba20f6c6b3f7209f8.1741124640.git.maciej.

[PULL 39/42] vfio/migration: Multifd device state transfer support - send side

2025-03-07 Thread Cédric Le Goater
te_precopy* documentation ] Signed-off-by: Cédric Le Goater --- docs/devel/migration/vfio.rst | 19 - hw/vfio/migration-multifd.h | 6 ++ include/hw/vfio/vfio-common.h | 6 ++ hw/vfio/migration-multifd.c | 142 ++ hw/vfio/migration.c | 22 -- hw/

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-07 Thread Maciej S. Szmigiero
er hand, the network endianess patch is urgent since it affects the bit stream. add also max queued buffers *size* limit. Signed-off-by: Maciej S. Szmigiero ---   docs/devel/migration/vfio.rst |  8 +---   hw/vfio/migration-multifd.c   | 21 +++--   hw/vfio/pci.c 

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-07 Thread Maciej S. Szmigiero
opy_thread handler. Switch between doing the data transfer in the new handler and doing it in the old save_state handler depending if VFIO multifd transfer is enabled or not. Signed-off-by: Maciej S. Szmigiero ---   hw/vfio/migration-multifd.c   | 142 ++   hw/vfio

Re: [PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-07 Thread Cédric Le Goater
docs/devel/migration/vfio.rst | 8 +--- hw/vfio/migration-multifd.c | 21 +++-- hw/vfio/pci.c | 9 + include/hw/vfio/vfio-common.h | 1 + 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/docs/devel/migration/vfio.rst b/docs/devel/migr

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-07 Thread Maciej S. Szmigiero
  hw/vfio/migration-multifd.c   | 142 ++   hw/vfio/migration-multifd.h   |   6 ++   hw/vfio/migration.c   |  22 --   hw/vfio/trace-events  |   2 +   include/hw/vfio/vfio-common.h |   6 ++   5 files changed, 172 insertions(+), 6 deletions(-) diff

[PATCH 2/2] vfio/migration: Use BE byte order for device state wire packets

2025-03-07 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Wire data commonly use BE byte order (including in the existing migration protocol), use it also for for VFIO device state packets. Fixes: 3228d311ab18 ("vfio/migration: Multifd device state transfer support - received buffers queuing") Fixes:

[PATCH 1/2] vfio/migration: Add also max in-flight VFIO device state buffers size limit

2025-03-07 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" There's already a max in-flight VFIO device state buffers *count* limit, add also max queued buffers *size* limit. Signed-off-by: Maciej S. Szmigiero --- docs/devel/migration/vfio.rst | 8 +++++--- hw/vfio/migration-multifd.c | 21 +++

[PULL 41/42] vfio/migration: Make x-migration-multifd-transfer VFIO property mutable

2025-03-06 Thread Cédric Le Goater
ej S. Szmigiero Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/qemu-devel/f2f2d66bda477da3e6cb8c0311006cff36e8651d.1741124640.git.maciej.szmigi...@oracle.com Signed-off-by: Cédric Le Goater --- hw/vfio/migration-multifd.c | 4 hw/vfio/pci.c | 20 ++

[PULL 31/42] vfio/migration: Multifd device state transfer support - basic types

2025-03-06 Thread Cédric Le Goater
From: "Maciej S. Szmigiero" Add basic types and flags used by VFIO multifd device state transfer support. Since we'll be introducing a lot of multifd transfer specific code, add a new file migration-multifd.c to home it, wired into main VFIO migration code (migration.c) via migr

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-06 Thread Cédric Le Goater
ice thread inside save_live_complete_precopy_thread handler. Switch between doing the data transfer in the new handler and doing it in the old save_state handler depending if VFIO multifd transfer is enabled or not. Signed-off-by: Maciej S. Szmigiero ---   hw/vfio/migration-multifd

[PULL 34/42] vfio/migration: Setup and cleanup multifd transfer in these general methods

2025-03-06 Thread Cédric Le Goater
From: "Maciej S. Szmigiero" Wire VFIO multifd transfer specific setup and cleanup functions into general VFIO load/save setup and cleanup methods. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/qemu-devel/b1f864a65fafd4fdab1f89230df52e46ae41f2ac

[PULL 28/42] vfio/migration: Convert bytes_transferred counter to atomic

2025-03-06 Thread Cédric Le Goater
From: "Maciej S. Szmigiero" So it can be safety accessed from multiple threads. This variable type needs to be changed to unsigned long since 32-bit host platforms lack the necessary addition atomics on 64-bit variables. Using 32-bit counters on 32-bit host platforms should not be a problem in

[PULL 33/42] vfio/migration: Multifd setup/cleanup functions and associated VFIOMultifd

2025-03-06 Thread Cédric Le Goater
kernel.org/qemu-devel/c0520523053b1087787152ddf2163257d3030be0.1741124640.git.maciej.szmigi...@oracle.com Signed-off-by: Cédric Le Goater --- hw/vfio/migration-multifd.h | 4 include/hw/vfio/vfio-common.h | 3 +++ hw/vfio/migration-multifd.c | 44 ++

[PULL 38/42] vfio/migration: Multifd device state transfer support - config loading support

2025-03-06 Thread Cédric Le Goater
nk: https://lore.kernel.org/qemu-devel/5dbd3f3703ec1097da2cf82a7262233452146fee.1741124640.git.maciej.szmigi...@oracle.com Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/migration-multifd.c | 49 +-- hw/vfio/migration.c | 9

[PULL 35/42] vfio/migration: Multifd device state transfer support - received buffers queuing

2025-03-06 Thread Cédric Le Goater
l.org/qemu-devel/e3bff515a8d61c582b94b409eb12a45b1a143a69.1741124640.git.maciej.szmigi...@oracle.com [ clg: - Reordered savevm_vfio_handlers - Added load_state_buffer documentation ] Signed-off-by: Cédric Le Goater --- docs/devel/migration/vfio.rst | 7 ++ hw/vfio/migration-multifd.h |

[PULL 36/42] vfio/migration: Multifd device state transfer support - load thread

2025-03-06 Thread Cédric Le Goater
édric Le Goater --- docs/devel/migration/vfio.rst | 4 + hw/vfio/migration-multifd.h | 2 + hw/vfio/migration-multifd.c | 226 ++ hw/vfio/migration.c | 12 ++ hw/vfio/trace-events | 7 ++ 5 files changed, 251 insertions(+) diff --git a/docs/

[PULL 40/42] vfio/migration: Add x-migration-multifd-transfer VFIO property

2025-03-06 Thread Cédric Le Goater
/migration/vfio.rst | 15 +++ include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/migration-multifd.c | 18 +- hw/vfio/pci.c | 7 +++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/devel/migration/vfio.rst b/docs/devel/migration/vfio

[PULL 30/42] vfio/migration: Move migration channel flags to vfio-common.h header file

2025-03-06 Thread Cédric Le Goater
From: "Maciej S. Szmigiero" This way they can also be referenced in other translation units than migration.c. Reviewed-by: Cédric Le Goater Signed-off-by: Maciej S. Szmigiero Link: https://lore.kernel.org/qemu-devel/26a940f6b22c1b685818251b7a3ddbbca601b1d6.1741124640.git.maciej.szmigi...@orac

[PULL 32/42] vfio/migration: Multifd device state transfer - add support checking function

2025-03-06 Thread Cédric Le Goater
qemu-devel/8ce50256f341b3d47342bb217cb5fbb2deb14639.1741124640.git.maciej.szmigi...@oracle.com Signed-off-by: Cédric Le Goater --- hw/vfio/migration-multifd.h | 2 ++ hw/vfio/migration-multifd.c | 6 ++ 2 files changed, 8 insertions(+) diff --git a/hw/vfio/migration-multifd.h b/hw/vfio/migration-multi

[PULL 27/42] vfio/migration: Add load_device_config_state_start trace event

2025-03-06 Thread Cédric Le Goater
From: "Maciej S. Szmigiero" And rename existing load_device_config_state trace event to load_device_config_state_end for consistency since it is triggered at the end of loading of the VFIO device config state. This way both the start and end points of particular device config loading operation (

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-06 Thread Avihai Horon
ransfer is enabled or not. Signed-off-by: Maciej S. Szmigiero ---   hw/vfio/migration-multifd.c   | 142 ++++++   hw/vfio/migration-multifd.h   |   6 ++   hw/vfio/migration.c   |  22 --   hw/vfio/trace-events  |   2 +   include/hw/vfio/vfio-comm

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-06 Thread Maciej S. Szmigiero
save_state handler depending if VFIO multifd transfer is enabled or not. Signed-off-by: Maciej S. Szmigiero ---   hw/vfio/migration-multifd.c   | 142 ++   hw/vfio/migration-multifd.h   |   6 ++   hw/vfio/migration.c   |  22 --   hw/vfio/trace-events 

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-06 Thread Cédric Le Goater
per-device thread inside save_live_complete_precopy_thread handler. Switch between doing the data transfer in the new handler and doing it in the old save_state handler depending if VFIO multifd transfer is enabled or not. Signed-off-by: Maciej S. Szmigiero ---   hw/vfio/migration-multifd

Re: [PATCH v6 34/36] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-03-05 Thread Maciej S. Szmigiero
On 5.03.2025 17:39, Cédric Le Goater wrote: On 3/5/25 16:11, Maciej S. Szmigiero wrote: On 5.03.2025 10:19, Cédric Le Goater wrote: On 3/4/25 23:04, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Allow capping the maximum count of in-flight VFIO device state buffers queued at the des

Re: [PATCH v6 25/36] vfio/migration: Setup and cleanup multifd transfer in these general methods

2025-03-05 Thread Cédric Le Goater
On 3/5/25 17:39, Peter Xu wrote: On Wed, Mar 05, 2025 at 05:27:19PM +0100, Maciej S. Szmigiero wrote: On 5.03.2025 17:22, Peter Xu wrote: On Tue, Mar 04, 2025 at 11:03:52PM +0100, Maciej S. Szmigiero wrote: @@ -509,6 +513,9 @@ static void vfio_save_cleanup(void *opaque) Error *local_err

Re: [PATCH v6 25/36] vfio/migration: Setup and cleanup multifd transfer in these general methods

2025-03-05 Thread Peter Xu
On Wed, Mar 05, 2025 at 11:39:23AM -0500, Peter Xu wrote: > On Wed, Mar 05, 2025 at 05:27:19PM +0100, Maciej S. Szmigiero wrote: > > On 5.03.2025 17:22, Peter Xu wrote: > > > On Tue, Mar 04, 2025 at 11:03:52PM +0100, Maciej S. Szmigiero wrote: > > > > @@ -509,6 +513,9 @@ static void vfio_save_clean

Re: [PATCH v6 34/36] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-03-05 Thread Cédric Le Goater
On 3/5/25 16:11, Maciej S. Szmigiero wrote: On 5.03.2025 10:19, Cédric Le Goater wrote: On 3/4/25 23:04, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Allow capping the maximum count of in-flight VFIO device state buffers queued at the destination, otherwise a malicious QEMU source c

Re: [PATCH v6 25/36] vfio/migration: Setup and cleanup multifd transfer in these general methods

2025-03-05 Thread Peter Xu
On Wed, Mar 05, 2025 at 05:27:19PM +0100, Maciej S. Szmigiero wrote: > On 5.03.2025 17:22, Peter Xu wrote: > > On Tue, Mar 04, 2025 at 11:03:52PM +0100, Maciej S. Szmigiero wrote: > > > @@ -509,6 +513,9 @@ static void vfio_save_cleanup(void *opaque) > > > Error *local_err = NULL; > > >

Re: [PATCH v6 25/36] vfio/migration: Setup and cleanup multifd transfer in these general methods

2025-03-05 Thread Maciej S. Szmigiero
On 5.03.2025 17:22, Peter Xu wrote: On Tue, Mar 04, 2025 at 11:03:52PM +0100, Maciej S. Szmigiero wrote: @@ -509,6 +513,9 @@ static void vfio_save_cleanup(void *opaque) Error *local_err = NULL; int ret; +/* Currently a NOP, done for symmetry with load_cleanup() */ +vfio_m

Re: [PATCH v6 25/36] vfio/migration: Setup and cleanup multifd transfer in these general methods

2025-03-05 Thread Peter Xu
On Tue, Mar 04, 2025 at 11:03:52PM +0100, Maciej S. Szmigiero wrote: > @@ -509,6 +513,9 @@ static void vfio_save_cleanup(void *opaque) > Error *local_err = NULL; > int ret; > > +/* Currently a NOP, done for symmetry with load_cleanup() */ > +vfio_multifd_cleanup(vbasedev); So I

Re: [PATCH v6 34/36] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-03-05 Thread Maciej S. Szmigiero
On 5.03.2025 10:19, Cédric Le Goater wrote: On 3/4/25 23:04, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Allow capping the maximum count of in-flight VFIO device state buffers queued at the destination, otherwise a malicious QEMU source could theoretically cause the target QEMU to a

Re: [PATCH v6 36/36] vfio/migration: Update VFIO migration documentation

2025-03-05 Thread Cédric Le Goater
On 3/4/25 23:04, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Update the VFIO documentation at docs/devel/migration describing the changes brought by the multifd device state transfer. Signed-off-by: Maciej S. Szmigiero --- docs/devel/migration/vfio.rst | 79 ++

Re: [PATCH v4 00/15] vfio: VFIO migration support with vIOMMU

2025-03-05 Thread Joao Martins
On 08/02/2025 02:07, Zhangfei Gao wrote: > On Wed, Jan 22, 2025 at 12:43 AM Joao Martins > wrote: >> >> On 07/01/2025 06:55, Zhangfei Gao wrote: >>> Hi, Joao >>> >>> On Fri, Jun 23, 2023 at 5:51 AM Joao Martins >>> wrote: Hey, This series introduces support for vIOMMU with V

Re: [PATCH v6 31/36] vfio/migration: Add x-migration-multifd-transfer VFIO property

2025-03-05 Thread Cédric Le Goater
d channels is attempted in configurations that otherwise support it. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/migration-multifd.c | 18 +- hw/vfio/pci.c | 8 include/hw/vfio/vfio-common.h | 2 ++

Re: [PATCH v6 34/36] vfio/migration: Max in-flight VFIO device state buffer count limit

2025-03-05 Thread Cédric Le Goater
MB and 1GB, did not show a performance improvement. */ #define VFIO_MIG_DEFAULT_DATA_BUFFER_SIZE (1 * MiB) Thanks, C. Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multifd.c | 16 hw/vfio/pci.c | 9 + include/hw/vfio/vfi

Re: [PATCH v6 32/36] vfio/migration: Make x-migration-multifd-transfer VFIO property mutable

2025-03-05 Thread Cédric Le Goater
adjusted at the run time. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/migration-multifd.c | 4 hw/vfio/pci.c | 20 +--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/hw/vfio/migration-mult

Re: [PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-05 Thread Cédric Le Goater
save_state handler depending if VFIO multifd transfer is enabled or not. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/migration-multifd.c | 142 ++ hw/vfio/migration-multifd.h | 6 ++ hw/vfio/m

Re: [PATCH v6 29/36] vfio/migration: Multifd device state transfer support - config loading support

2025-03-05 Thread Cédric Le Goater
Szmigiero Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/migration-multifd.c | 49 +-- hw/vfio/migration.c | 9 ++- include/hw/vfio/vfio-common.h | 2 ++ 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/hw/vfio/migration

Re: [PATCH v6 27/36] vfio/migration: Multifd device state transfer support - load thread

2025-03-05 Thread Cédric Le Goater
eding data must have already been loaded. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/migration-multifd.c | 226 ++++ hw/vfio/migration-multifd.h | 2 + hw/vfio/migration.c | 12 ++ hw/vf

Re: [PATCH v6 26/36] vfio/migration: Multifd device state transfer support - received buffers queuing

2025-03-05 Thread Cédric Le Goater
eviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/migration-multifd.c | 163 hw/vfio/migration-multifd.h | 3 + hw/vfio/migration.c | 1 + hw/vfio/trace-events| 1 + 4 files changed, 168 insertions(+) diff --git a/hw/vfio/migration

Re: [PATCH v6 25/36] vfio/migration: Setup and cleanup multifd transfer in these general methods

2025-03-05 Thread Cédric Le Goater
On 3/4/25 23:03, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" Wire VFIO multifd transfer specific setup and cleanup functions into general VFIO load/save setup and cleanup methods. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/mig

Re: [PATCH v6 24/36] vfio/migration: Multifd setup/cleanup functions and associated VFIOMultifd

2025-03-05 Thread Cédric Le Goater
eviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/migration-multifd.c | 44 +++ hw/vfio/migration-multifd.h | 4 include/hw/vfio/vfio-common.h | 3 +++ 3 files changed, 51 insertions(+) diff --git a/hw/vfio/migration-multifd.c b/hw/vfio

Re: [PATCH v6 22/36] vfio/migration: Multifd device state transfer support - basic types

2025-03-05 Thread Cédric Le Goater
into main VFIO migration code (migration.c) via migration-multifd.h header file. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/meson.build | 1 + hw/vfio/migration-multifd.c | 33 + hw/vfio/migration

Re: [PATCH v6 20/36] vfio/migration: Add vfio_add_bytes_transferred()

2025-03-04 Thread Cédric Le Goater
On 3/4/25 23:03, Maciej S. Szmigiero wrote: From: "Maciej S. Szmigiero" This way bytes_transferred can also be incremented in other translation units than migration.c. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/migration.c | 7

[PATCH v6 23/36] vfio/migration: Multifd device state transfer - add support checking function

2025-03-04 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Add vfio_multifd_transfer_supported() function that tells whether the multifd device state transfer is supported. Reviewed-by: Cédric Le Goater Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multifd.c | 6 ++ hw/vfio/migration-multifd.h

[PATCH v6 26/36] vfio/migration: Multifd device state transfer support - received buffers queuing

2025-03-04 Thread Maciej S. Szmigiero
te data is saved into a VFIOStateBuffer for later in-order loading into the device. The last such VFIO device state packet should have VFIO_DEVICE_STATE_CONFIG_STATE flag set and carry the device config state. Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multi

[PATCH v6 30/36] vfio/migration: Multifd device state transfer support - send side

2025-03-04 Thread Maciej S. Szmigiero
ransfer is enabled or not. Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multifd.c | 142 ++ hw/vfio/migration-multifd.h | 6 ++ hw/vfio/migration.c | 22 -- hw/vfio/trace-events | 2 + include/hw/vfio/vfio-common.h | 6 +

[PATCH v6 27/36] vfio/migration: Multifd device state transfer support - load thread

2025-03-04 Thread Maciej S. Szmigiero
Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multifd.c | 226 ++++ hw/vfio/migration-multifd.h | 2 + hw/vfio/migration.c | 12 ++ hw/vfio/trace-events| 7 ++ 4 files changed, 247 insertions(+) diff --git a/hw/vfio/migration-mult

[PATCH v6 35/36] vfio/migration: Add x-migration-load-config-after-iter VFIO property

2025-03-04 Thread Maciej S. Szmigiero
hich means ON for ARM, OFF for other platforms. Signed-off-by: Maciej S. Szmigiero --- hw/vfio/migration-multifd.c | 91 +++ hw/vfio/migration-multifd.h | 3 ++ hw/vfio/migration.c | 10 +++- hw/vfio/pci.c | 9 include/hw

  1   2   3   4   5   6   7   8   9   10   >