Modify net_init_tap so every return branches to a common label, for
common cleanup in a subsequent patch. No functional change.
Signed-off-by: Steve Sistare
---
net/tap.c | 54 --
1 file changed, 36 insertions(+), 18 deletions(-)
diff --git
Add the cpr_delete_fd_all function to delete all fds associated with a
device.
Signed-off-by: Steve Sistare
---
include/migration/cpr.h | 1 +
migration/cpr.c | 13 +
2 files changed, 14 insertions(+)
diff --git a/include/migration/cpr.h b/include/migration/cpr.h
index
d the file descriptors to new QEMU,
with no special management actions required. The user enables
this behavior by specifing '-netdev tap,cpr=on'. The default
is cpr=off.
Steve Sistare (8):
migration: stop vm earlier for cpr
migration: cpr setup notifier
vhost: reset vhost devices for cpr
When preserving a vhost fd using CPR, call VHOST_RESET_OWNER prior to CPR
in old QEMU. Otherwise, new QEMU will fail when it calls VHOST_SET_OWNER
during vhost_dev_init.
Signed-off-by: Mark Kanda
Signed-off-by: Steve Sistare
---
include/hw/virtio/vhost.h | 1 +
hw/virtio/vhost.c | 32
the queue is already detached. Define tap_disable_postload to
avoid IFF_DETACH_QUEUE.
Signed-off-by: Steve Sistare
---
include/net/tap.h | 1 +
hw/net/virtio-net.c | 20
net/tap-win32.c | 5 +
net/tap.c | 17 +
4 files changed, 43
Stop the vm earlier for cpr, before cpr_save_state which causes new QEMU
to proceed and initialize devices. We must guarantee devices are stopped
in old QEMU, and all source notifiers called, before they are initialized
in new QEMU.
Signed-off-by: Steve Sistare
---
migration/migration.c | 26
This reverts commit e6383293eb01928692047e617665a742cca87e23.
The reset function is needed for CPR.
Signed-off-by: Steve Sistare
---
hw/virtio/vhost-backend.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
index 833804d..9b75141
Call MIG_EVENT_PRECOPY_SETUP earlier, before CPR starts. An early notifier
is needed for resetting vhost devices, as explained in the next patch.
Signed-off-by: Steve Sistare
---
migration/migration.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/migration
search for a saved value. Example:
-netdev tap,id=hostnet2,fds=-1:-1,vhostfds=-1:-1,cpr=on
Signed-off-by: Steve Sistare
---
qapi/net.json | 5 +++-
include/migration/cpr.h | 2 +-
hw/vfio/device.c| 2 +-
migration/cpr.c | 11
net
instance is created.
Signed-off-by: Steve Sistare
---
hw/intc/arm_gicv3_kvm.c| 18 +-
include/hw/intc/arm_gicv3_common.h | 3 +++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
index 3be3bf6c28..3d12c846ce
Close a race condition that causes cpr-transfer to lose VFIO
interrupts. See commit messages for details.
Steve Sistare (2):
vfio/pci: augment set_handler
vfio/pci: preserve pending interrupts
hw/vfio/cpr.c | 93 +-
hw/vfio/pci.c
etion of
kvm_irqchip_remove_irqfd_notifier_gsi, it will be recovered by the
subsequent call to cpu_synchronize_all_states, which pulls KVM interrupt
state to userland prior to saving it in vmstate.
Signed-off-by: Steve Sistare
---
hw/vfio/cpr.c | 91 ++
hw/vfio/pci.c
Extend vfio_pci_msi_set_handler() so it can set or clear the handler.
Add a similar accessor for INTx. No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/cpr.c | 2 +-
hw/vfio/pci.c | 13 +++--
hw/vfio/pci.h | 3 ++-
3 files changed, 14
rns
false, ret=0 is returned, and net_client_init1 will use a broken interface.
Fix it to be future proof.
Signed-off-by: Steve Sistare
---
net/tap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index ae1c7e3..35552c4 100644
--- a/net/tap.c
+++ b/
()
However, after CPR, the guest does not reconfigure the device and the
code path above is not taken. To fix, in vfio_cpr_pci_post_load, call
vfio_sub_page_bar_update_mapping for each sub-page BAR with a valid
address.
Fixes: 7e9f21411302 ("vfio/container: restore DMA vaddr")
Signed-off
()
However, after CPR, the guest does not reconfigure the device and the
code path above is not taken. To fix, in vfio_cpr_pci_post_load, call
vfio_sub_page_bar_update_mapping for each sub-page BAR with a valid
address.
Fixes: 7e9f21411302 ("vfio/container: restore DMA vaddr")
Signed-off
Extract a subroutine for KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES.
No functional change.
Signed-off-by: Steve Sistare
---
hw/intc/arm_gicv3_kvm.c | 24 +++-
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
index
is created.
Signed-off-by: Steve Sistare
---
hw/intc/arm_gicv3_kvm.c| 16 +++-
include/hw/intc/arm_gicv3_common.h | 3 +++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
index 43cba6e3f1..15245af2fd 100644
Extend vfio_pci_msi_set_handler() so it can set or clear the handler.
Add a similar accessor for INTx. No functional change.
Signed-off-by: Steve Sistare
---
hw/vfio/cpr.c | 2 +-
hw/vfio/pci.c | 13 +++--
hw/vfio/pci.h | 3 ++-
3 files changed, 14 insertions(+), 4 deletions(-)
diff
Close a race condition that causes cpr-transfer to lose VFIO
interrupts. See commit messages for details.
Steve Sistare (2):
vfio/pci: augment set_handler
vfio/pci: preserve pending interrupts
hw/vfio/cpr.c | 92 +-
hw/vfio/pci.c
Close a race condition that causes cpr-transfer to lose VFIO
interrupts on ARM. See commit messages for details.
Steve Sistare (2):
hw/intc/arm_gicv3_kvm: subroutine for save pending
hw/intc/arm_gicv3_kvm: preserve pending interrupts during cpr
hw/intc/arm_gicv3_kvm.c| 40
fier_gsi, it will be recovered by the
subsequent call to cpu_synchronize_all_states, which pulls KVM interrupt
state to userland prior to saving it in vmstate.
Signed-off-by: Steve Sistare
---
hw/vfio/cpr.c | 90 ++
hw/vfio/pci.c |
Use qom-list-get to speed up the qom-tree command.
Signed-off-by: Steve Sistare
Acked-by: Markus Armbruster
---
python/qemu/utils/qom.py| 43 +++--
python/qemu/utils/qom_common.py | 53 +
2 files changed, 78 insertions
v
* cosmetic changes in the docs and code.
Changes in V2:
* removed "qom: qom_resolve_path", which was pulled separately
* dropped the error member
* fixed missing _list_tree in qom.py
* updated 10.0 to 10.1
Steve Sistare (3):
qom: qom-list-get
python: use qom-list-get
test
start up time.
Define the qom-list-get command, which fetches all the properties and
values for a list of paths. This can be much faster than qom-list
plus qom-get. When getting an entire QOM tree, I measured a 10x
speedup in elapsed time.
Signed-off-by: Steve Sistare
Tested-by: Philippe Mathieu-
Add a unit test for qom-list-get.
Signed-off-by: Steve Sistare
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Markus Armbruster
---
tests/qtest/qom-test.c | 116 -
1 file changed, 115 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/qom
Use qom-list-get to speed up the qom-tree command.
Signed-off-by: Steve Sistare
---
python/qemu/utils/qom.py| 43 +++--
python/qemu/utils/qom_common.py | 53 +
2 files changed, 78 insertions(+), 18 deletions(-)
diff
Add a unit test for qom-list-getv.
Signed-off-by: Steve Sistare
Reviewed-by: Philippe Mathieu-Daudé
---
tests/qtest/qom-test.c | 116 -
1 file changed, 115 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
: qom_resolve_path", which was pulled separately
* dropped the error member
* fixed missing _list_tree in qom.py
* updated 10.0 to 10.1
Steve Sistare (3):
qom: qom-list-get
python: use qom-list-get
tests/qtest/qom-test: unit test for qom-list-getv
python/qemu/utils/qom.py| 43
-up time.
Signed-off-by: Steve Sistare
Reviewed-by: Philippe Mathieu-Daudé
---
qapi/qom.json | 50 ++
qom/qom-qmp-cmds.c | 53 +
2 files changed, 103 insertions(+)
diff --git a/qapi/qom.json b
tree script to use qom-list-getv
* cosmetic changes in the docs and code.
Changes in V2:
* removed "qom: qom_resolve_path", which was pulled separately
* dropped the error member
* fixed missing _list_tree in qom.py
* updated 10.0 to 10.1
Steve Sistare (3):
qom: qom-list-
Add a unit test for qom-list-getv.
Signed-off-by: Steve Sistare
---
tests/qtest/qom-test.c | 64 ++
1 file changed, 64 insertions(+)
diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
index 27d70bc..4defff1 100644
--- a/tests/qtest/qom
Define the qom-list-getv command, which fetches all the properties and
values for a list of paths. This is faster than qom-tree-get when
fetching a subset of the QOM tree. See qom.json for details.
Signed-off-by: Steve Sistare
---
qapi/qom.json | 50
Use qom-list-getv to speed up the qom-tree command.
Signed-off-by: Steve Sistare
---
python/qemu/utils/qom.py| 43 +++--
python/qemu/utils/qom_common.py | 53 +
2 files changed, 78 insertions(+), 18 deletions(-)
diff
Define vfio_device_free_name to free the name created by
vfio_device_get_name. A subsequent patch will do more there.
No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
Reviewed-by: Zhenzhong Duan
---
include/hw/vfio/vfio-device.h | 1 +
hw/vfio/ap.c
Skip allocation of, and attachment to, hwpt_id. Recover it from CPR state.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
hw/vfio/iommufd.c | 30 ++
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
subsequent patches.
Signed-off-by: Steve Sistare
---
include/hw/vfio/vfio-cpr.h | 12 +++
include/system/iommufd.h | 1 +
backends/iommufd.c | 10 ++
hw/vfio/cpr-iommufd.c | 86 ++
hw/vfio/iommufd.c | 6 ++--
hw/vfio
a matching container, if any, before creating a
new one.
This reconstruction is not complete. hwpt_id is handled in a subsequent
patch.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
hw/vfio/iommufd.c | 30 --
1 file changed, 28 insertions(+), 2
tance.
Signed-off-by: Steve Sistare
---
hw/vfio/pci.h | 2 +
include/hw/vfio/vfio-cpr.h | 8
hw/vfio/cpr.c | 97 ++
hw/vfio/pci.c | 52 -
4 files changed, 157 insertions(+), 2 dele
anges in V6:
* dropped already-pulled patches
* converted remaining g_free in "add vfio_device_free_name"
* fixed iommufd_backend_disconnect in "preserve descriptors"
* tweaked vfio_cpr_load_device in "preserve descriptors"
* added trace_vfio_cpr_find_device i
Update documentation to say that cpr-transfer supports vfio and iommufd.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
Reviewed-by: Fabiano Rosas
---
docs/devel/migration/CPR.rst | 5 ++---
qapi/migration.json | 6 --
2 files changed, 6 insertions(+), 5 deletions
initialization, but still perform
kvm initialization.
Signed-off-by: Steve Sistare
---
hw/vfio/cpr.c | 27 ++-
hw/vfio/pci.c | 55 +--
2 files changed, 79 insertions(+), 3 deletions(-)
diff --git a/hw/vfio/cpr.c b/hw
Use IOMMU_IOAS_MAP_FILE when the mapped region is backed by a file.
Such a mapping can be preserved without modification during CPR,
because it depends on the file's address space, which does not change,
rather than on the process's address space, which does change.
Signed-off-by: Ste
changes when sent to new QEMU via SCM_RIGHTS. Hence the
user cannot send getfd to new QEMU, but when the user sends a
hotplug command that references the fd, cpr_get_fd_param finds
its value in CPR state.
Signed-off-by: Steve Sistare
Reviewed-by: Fabiano Rosas
---
include/migration/cpr.h | 2
QEMU must know the fd
number to construct a name to find the fd number.
To fix, create an invariant name based on the id command-line parameter,
if id is defined. The user will need to provide such an id to use CPR.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
Reviewed-by: Zhenzhong
Define the change process ioctl
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
Reviewed-by: Zhenzhong Duan
---
include/system/iommufd.h | 3 +++
backends/iommufd.c | 24
backends/trace-events| 1 +
3 files changed, 28 insertions(+)
diff --git
-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
include/hw/vfio/vfio-cpr.h | 3 ++
hw/vfio/cpr-iommufd.c | 98 +-
hw/vfio/iommufd.c | 2 +
hw/vfio/trace-events | 3 ++
4 files changed, 105 insertions(+), 1 deletion(-)
diff
device object will be defined by the vfio subsystem
in a subsequent patch.
Signed-off-by: Steve Sistare
---
include/hw/vfio/vfio-cpr.h | 1 +
include/migration/cpr.h| 12
hw/vfio/cpr-iommufd.c | 2 ++
hw/vfio/iommufd-stubs.c| 18 ++
migration/cpr.c
If an invariant device name cannot be created, block CPR.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
include/hw/vfio/vfio-cpr.h | 1 +
hw/vfio/device.c | 11 +++
2 files changed, 12 insertions(+)
diff --git a/include/hw/vfio/vfio-cpr.h b/include/hw/vfio
Signed-off-by: Steve Sistare
Reviewed-by: Fabiano Rosas
---
include/hw/vfio/vfio-cpr.h| 2 ++
include/hw/vfio/vfio-device.h | 2 ++
include/system/kvm.h | 1 +
accel/kvm/kvm-all.c | 32
hw/vfio/cpr-legacy.c | 2 ++
hw/vfio/cpr.c
vfio_cpr_[un]register_container is no longer used since they were
subsumed by container type-specific registration. Delete them.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-cpr.h | 4
hw/vfio/cpr.c | 13
Define qemu_ram_get_fd_offset, so CPR can map a memory region using
IOMMU_IOAS_MAP_FILE in a subsequent patch.
Signed-off-by: Steve Sistare
Reviewed-by: Peter Xu
Reviewed-by: Zhenzhong Duan
---
include/exec/cpu-common.h | 1 +
system/physmem.c | 5 +
2 files changed, 6 insertions
.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
backends/iommufd.c | 8
1 file changed, 8 insertions(+)
diff --git a/backends/iommufd.c b/backends/iommufd.c
index e091792..2a33c7a 100644
--- a/backends/iommufd.c
+++ b/backends/iommufd.c
@@ -245,6 +245,10 @@ int
Define iommufd_backend_map_file_dma to implement IOMMU_IOAS_MAP_FILE.
This will be called as a substitute for iommufd_backend_map_dma, so
the error conditions for BARs are copied as-is from that function.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
include/system/iommufd.h
Finish CPR by change the owning process of the iommufd device in
post load.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
hw/vfio/cpr-iommufd.c | 30 ++
1 file changed, 30 insertions(+)
diff --git a/hw/vfio/cpr-iommufd.c b/hw/vfio/cpr-iommufd.c
index
Save the iommu and vfio device fd in CPR state when it is created.
After CPR, the fd number is found in CPR state and reused.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
backends/iommufd.c| 35 +--
hw/vfio/cpr-iommufd.c | 10 ++
hw
Do not reset a vfio-pci device during CPR.
Signed-off-by: Steve Sistare
---
hw/pci/pci.c | 5 +
hw/vfio/pci.c| 7 +++
include/hw/pci/pci.h | 2 ++
3 files changed, 14 insertions(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 9b4bf48..c70b5ce 100644
--- a/hw/pci/pci.c
Export various MSI functions, renamed with a vfio_pci prefix, for use by
CPR in subsequent patches. No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/pci.h | 8
hw/vfio/pci.c | 29 +
2 files changed, 25
in subsequent patches.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-container.h | 2 ++
include/hw/vfio/vfio-cpr.h | 15 +
hw/vfio/container.c | 7 ++---
hw/vfio/cpr-legacy.c | 68
changes when sent to new QEMU via SCM_RIGHTS. Hence the
user cannot send getfd to new QEMU, but when the user sends a
hotplug command that references the fd, cpr_get_fd_param finds
its value in CPR state.
Signed-off-by: Steve Sistare
Reviewed-by: Fabiano Rosas
---
include/migration/cpr.h | 2
Save the iommu and vfio device fd in CPR state when it is created.
After CPR, the fd number is found in CPR state and reused.
Signed-off-by: Steve Sistare
---
backends/iommufd.c| 25 -
hw/vfio/cpr-iommufd.c | 10 ++
hw/vfio/device.c | 9 +
3
tance.
Signed-off-by: Steve Sistare
---
hw/vfio/pci.h | 2 +
include/hw/vfio/vfio-cpr.h | 8
hw/vfio/cpr.c | 97 ++
hw/vfio/pci.c | 54 --
4 files changed, 158 insertions(+), 3 dele
If an invariant device name cannot be created, block CPR.
Signed-off-by: Steve Sistare
---
include/hw/vfio/vfio-cpr.h | 1 +
hw/vfio/device.c | 11 +++
2 files changed, 12 insertions(+)
diff --git a/include/hw/vfio/vfio-cpr.h b/include/hw/vfio/vfio-cpr.h
index 25e74ee
QEMU must know the fd
number to construct a name to find the fd number.
To fix, create an invariant name based on the id command-line parameter,
if id is defined. The user will need to provide such an id to use CPR.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/device.c
Use IOMMU_IOAS_MAP_FILE when the mapped region is backed by a file.
Such a mapping can be preserved without modification during CPR,
because it depends on the file's address space, which does not change,
rather than on the process's address space, which does change.
Signed-off-by: Ste
Export msix_is_pending for use by cpr. No functional change.
Signed-off-by: Steve Sistare
Acked-by: Michael S. Tsirkin
---
include/hw/pci/msix.h | 1 +
hw/pci/msix.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h
Pass the vector number to vfio_connect_kvm_msi_virq and
vfio_remove_kvm_msi_virq, so it can be passed to their subroutines in
a subsequent patch. No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/pci.c | 13 +++--
1 file changed, 7 insertions
subsequent patches.
Signed-off-by: Steve Sistare
---
include/hw/vfio/vfio-cpr.h | 12 +++
include/system/iommufd.h | 1 +
backends/iommufd.c | 10 ++
hw/vfio/cpr-iommufd.c | 84 ++
hw/vfio/iommufd.c | 6 ++--
hw/vfio
Move event_notifier_init calls to a helper vfio_notifier_init.
This version is trivial, but it will be expanded to support CPR
in subsequent patches. No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/pci.c | 40
.
Signed-off-by: Steve Sistare
---
backends/iommufd.c | 8
1 file changed, 8 insertions(+)
diff --git a/backends/iommufd.c b/backends/iommufd.c
index e02f06e..6a5566c 100644
--- a/backends/iommufd.c
+++ b/backends/iommufd.c
@@ -245,6 +245,10 @@ int iommufd_backend_map_file_dma
section, and the calls will match the mappings remembered by the
kernel.
The listener calls a special dma_map handler that passes the new VA of each
section to the kernel using VFIO_DMA_MAP_FLAG_VADDR. Restore the normal
handler at the end.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le
Do not reset a vfio-pci device during CPR.
Signed-off-by: Steve Sistare
---
include/hw/pci/pci_device.h | 3 +++
hw/pci/pci.c| 5 +
hw/vfio/pci.c | 7 +++
3 files changed, 15 insertions(+)
diff --git a/include/hw/pci/pci_device.h b/include/hw/pci
initialization, but still perform
kvm initialization.
Signed-off-by: Steve Sistare
---
hw/vfio/cpr.c | 27 ++-
hw/vfio/pci.c | 32
2 files changed, 54 insertions(+), 5 deletions(-)
diff --git a/hw/vfio/cpr.c b/hw/vfio/cpr.c
index e467373
Extract a subroutine vfio_pci_vector_init. No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/pci.c | 24 +---
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 67edf80..03630bb
a new
"remap" flag that tells it to restore a mapping without re-allocating new
userland data structures.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-container-base.h | 3 ++
include/hw/vfio/vfio-cpr.h| 10
hw/vfio/cp
a matching container, if any, before creating a
new one.
This reconstruction is not complete. hwpt_id is handled in a subsequent
patch.
Signed-off-by: Steve Sistare
---
hw/vfio/iommufd.c | 30 --
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/hw/vfio
Move event_notifier_cleanup calls to a helper vfio_notifier_cleanup.
This version is trivial, and does not yet use the vdev and nr parameters.
No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/pci.c | 28 +---
1 file changed
Define the change process ioctl
Signed-off-by: Steve Sistare
---
include/system/iommufd.h | 3 +++
backends/iommufd.c | 24
backends/trace-events| 1 +
3 files changed, 28 insertions(+)
diff --git a/include/system/iommufd.h b/include/system/iommufd.h
index
Finish CPR by change the owning process of the iommufd device in
post load.
Signed-off-by: Steve Sistare
---
hw/vfio/cpr-iommufd.c | 30 ++
1 file changed, 30 insertions(+)
diff --git a/hw/vfio/cpr-iommufd.c b/hw/vfio/cpr-iommufd.c
index 152a661..a9e3f68 100644
, such as vfio ioctl's,
are skipped. The result is that vfio_realize constructs qemu data
structures that reflect the current state of the device.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
Reviewed-by: Zhenzhong Duan
---
include/hw/vfio/vfio-cpr.h | 6 +
hw
Signed-off-by: Steve Sistare
---
include/hw/vfio/vfio-device.h | 2 ++
include/migration/cpr.h | 2 ++
include/system/kvm.h | 1 +
accel/kvm/kvm-all.c | 32
accel/stubs/kvm-stub.c| 5 +
hw/vfio/helpers.c | 10
vfio_cpr_[un]register_container is no longer used since they were
subsumed by container type-specific registration. Delete them.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-cpr.h | 4
hw/vfio/cpr.c | 13 -
2 files changed
Update documentation to say that cpr-transfer supports vfio and iommufd.
Signed-off-by: Steve Sistare
---
docs/devel/migration/CPR.rst | 5 ++---
qapi/migration.json | 6 --
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/docs/devel/migration/CPR.rst b/docs/devel
Add the cpr_incoming_needed, cpr_open_fd, and cpr_resave_fd helpers,
for use when adding cpr support for vfio and iommufd.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
include/migration/cpr.h | 5 +
migration/cpr.c | 36
2
Skip allocation of, and attachment to, hwpt_id. Recover it from CPR state.
Signed-off-by: Steve Sistare
---
hw/vfio/iommufd.c | 30 ++
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index a650517..48c590b 100644
Pass vdev and nr to vfio_notifier_init, for use by CPR in a subsequent
patch. No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/pci.c | 31 +++
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/hw/vfio/pci.c
Define vfio_device_free_name to free the name created by
vfio_device_get_name. A subsequent patch will do more there.
No functional change.
Signed-off-by: Steve Sistare
---
include/hw/vfio/vfio-device.h | 1 +
hw/vfio/ap.c | 2 +-
hw/vfio/ccw.c | 2 +-
hw/vfio
y attach to multiple containers per iommufd using ioas_id
* simplified "reconstruct hwpt" by matching against hwpt_id.
* added patch "add vfio_device_free_name"
Changes in V5:
* dropped: vfio/pci: vfio_pci_put_device on failure
* added: "vfio: doc changes for
device object will be defined by the vfio subsystem
in a subsequent patch.
Signed-off-by: Steve Sistare
---
include/hw/vfio/vfio-cpr.h | 1 +
include/migration/cpr.h| 12
hw/vfio/cpr-iommufd.c | 2 ++
hw/vfio/iommufd-stubs.c| 18 ++
migration/cpr.c
During CPR, after VFIO_DMA_UNMAP_FLAG_VADDR, the vaddr is temporarily
invalid, so mediated devices cannot be supported. Add a blocker for them.
This restriction will not apply to iommufd containers when CPR is added
for them in a future patch.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le
In the container pre_save handler, discard the virtual addresses in DMA
mappings with VFIO_DMA_UNMAP_FLAG_VADDR, because guest RAM will be
remapped at a different VA after in new QEMU. DMA to already-mapped
pages continues.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw
-off-by: Steve Sistare
---
include/hw/vfio/vfio-cpr.h | 3 ++
hw/vfio/cpr-iommufd.c | 96 +-
hw/vfio/iommufd.c | 2 +
3 files changed, 100 insertions(+), 1 deletion(-)
diff --git a/include/hw/vfio/vfio-cpr.h b/include/hw/vfio/vfio-cpr.h
handlers for the devices that they contain.
Signed-off-by: Steve Sistare
Reviewed-by: Fabiano Rosas
Reviewed-by: Peter Xu
---
include/migration/vmstate.h | 6 +-
migration/savevm.c | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/include/migration/vmstate.h
Define iommufd_backend_map_file_dma to implement IOMMU_IOAS_MAP_FILE.
This will be called as a substitute for iommufd_backend_map_dma, so
the error conditions for BARs are copied as-is from that function.
Signed-off-by: Steve Sistare
Reviewed-by: Zhenzhong Duan
---
include/system/iommufd.h
Define qemu_ram_get_fd_offset, so CPR can map a memory region using
IOMMU_IOAS_MAP_FILE in a subsequent patch.
Signed-off-by: Steve Sistare
Reviewed-by: Peter Xu
Reviewed-by: Zhenzhong Duan
---
include/exec/cpu-common.h | 1 +
system/physmem.c | 5 +
2 files changed, 6 insertions
Do not reset a vfio-pci device during CPR, and do not complain if the
kernel's PCI config space changes for non-emulated bits between the
vmstate save and load, which can happen due to ongoing interrupt activity.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
include/hw
Do not reset a vfio-pci device during CPR, and do not complain if the
kernel's PCI config space changes for non-emulated bits between the
vmstate save and load, which can happen due to ongoing interrupt activity.
Signed-off-by: Steve Sistare
---
include/hw/vfio/vfio-cpr.h | 2 ++
hw/vfio/
changes when sent to new QEMU via SCM_RIGHTS. Hence the
user cannot send getfd to new QEMU, but when the user sends a
hotplug command that references the fd, cpr_get_fd_param finds
its value in CPR state.
Signed-off-by: Steve Sistare
Reviewed-by: Fabiano Rosas
---
include/migration/cpr.h | 2
Move event_notifier_init calls to a helper vfio_notifier_init.
This version is trivial, but it will be expanded to support CPR
in subsequent patches. No functional change.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le Goater
---
hw/vfio/pci.c | 40
During CPR, after VFIO_DMA_UNMAP_FLAG_VADDR, the vaddr is temporarily
invalid, so mediated devices cannot be supported. Add a blocker for them.
This restriction will not apply to iommufd containers when CPR is added
for them in a future patch.
Signed-off-by: Steve Sistare
Reviewed-by: Cédric Le
1 - 100 of 1180 matches
Mail list logo