* [RFC HCI-8.1 PATCH 0/5] qemu: allow qemu-update with VFIO hostdevs on shared memfd RAM #VSTOR-103860
@ 2026-10-09 14:04 Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 1/5] qemu update: allow qemu-update for VMs with PCI and USB hostdevs #VSTOR-103860 #VSTOR-137800 Andrey Drobyshev
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Andrey Drobyshev @ 2026-10-09 14:04 UTC (permalink / raw)
To: svt-core; +Cc: andrey.drobyshev, efim.shevrin, den
qemu-update (cpr-exec) keeps anonymous guest RAM across exec with
MADV_DOEXEC, which shares the pages with the new process copy-on-write.
For a VM with a VFIO device that breaks the device: VFIO pins all guest
RAM for DMA, so the first guest write after exec copies the page, while
the device keeps doing DMA to the old pinned one. Shared memfd RAM is
handed over to the new QEMU as is and has no such problem.
This series lifts the blanket hostdev restriction for qemu-update and
makes it safe:
- only PCI (VFIO) and USB hostdevs are allowed, mdev/scsi/scsi_host as
well as NVMe disks and vDPA interfaces are still refused;
- new VMs with devices pinning guest RAM (PCI/mdev hostdevs, NVMe disks,
vDPA) get shared memfd RAM, unless memory backing is set explicitly;
- their auxiliary RAM (VRAM, ROMs) is shared too via aux-ram-share=on;
- qemu-update is refused for a PCI hostdev on non-shared RAM, e.g. a VM
started by an older libvirt; a cold restart switches it to memfd.
KSM is not lost: it never merges pinned pages anyway. THP works for memfd
RAM with the QEMU fix aligning fd-backed RAM to 2M and
/sys/kernel/mm/transparent_hugepage/shmem_enabled set to "advise".
Tested on whole GPU passthrough (RTX 6000 Ada): 32 qemu-updates in a
row, the GPU keeps working and all 16G of guest RAM stays on 2M pages.
With the QEMU VFIO CPR fixes also on an NVIDIA vGPU: qemu-update keeps
the vGPU working, a GPU<->guest RAM DMA checker shows no mismatches.
This is an alternative to the vzkernel series moving MADV_DOEXEC memory
into the new mm, which needs no libvirt changes.
Andrey Drobyshev (5):
qemu update: allow qemu-update for VMs with PCI and USB hostdevs
#VSTOR-103860 #VSTOR-137800
qemu: capabilities: probe aux-ram-share machine property #VSTOR-103860
qemu: back guest RAM with shared memfd for VMs with DMA-pinning
devices #VSTOR-103860
qemu: share auxiliary RAM of VMs with DMA-pinning devices
#VSTOR-103860
qemu update: refuse PCI hostdevs on non-shared guest RAM #VSTOR-103860
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 3 +
src/qemu/qemu_domain.c | 36 ++++++++
src/qemu/qemu_domain.h | 6 ++
src/qemu/qemu_driver.c | 44 ++++++++-
src/qemu/qemu_process.c | 91 +++++++++++++++++++
.../caps_10.0.0_aarch64.xml | 1 +
.../caps_10.0.0_ppc64.xml | 1 +
.../caps_10.0.0_s390x.xml | 1 +
.../caps_10.0.0_x86_64+amdsev.xml | 1 +
.../caps_10.0.0_x86_64.xml | 1 +
.../caps_10.1.0_x86_64+inteltdx.xml | 1 +
tests/qemustatusxml2xmldata/modern-in.xml | 1 +
.../disk-nvme.x86_64-latest.args | 4 +-
.../disk-slices.x86_64-latest.args | 4 +-
...tdev-mdev-display-ramfb.x86_64-latest.args | 4 +-
...play-spice-egl-headless.x86_64-latest.args | 4 +-
...ev-display-spice-opengl.x86_64-latest.args | 4 +-
...isplay-vnc-egl-headless.x86_64-latest.args | 4 +-
...ostdev-mdev-display-vnc.x86_64-latest.args | 4 +-
.../hostdev-mdev-display.x86_64-latest.args | 4 +-
...hostdev-mdev-precreated.x86_64-latest.args | 4 +-
...tdev-pci-address-device.x86_64-latest.args | 4 +-
...-pci-address-unassigned.x86_64-latest.args | 4 +-
.../hostdev-pci-address.x86_64-latest.args | 4 +-
...stdev-pci-display-ramfb.x86_64-latest.args | 4 +-
...stdev-pci-multifunction.x86_64-latest.args | 4 +-
...tdev-subsys-mdev-vfio-ap.s390x-latest.args | 4 +-
...ubsys-mdev-vfio-ccw-boot.s390x-latest.args | 4 +-
...dev-subsys-mdev-vfio-ccw.s390x-latest.args | 4 +-
...ostdev-vfio-multidomain.x86_64-latest.args | 4 +-
...o-zpci-autogenerate-fids.s390x-latest.args | 4 +-
...o-zpci-autogenerate-uids.s390x-latest.args | 4 +-
...v-vfio-zpci-autogenerate.s390x-latest.args | 4 +-
...dev-vfio-zpci-boundaries.s390x-latest.args | 4 +-
...vfio-zpci-ccw-memballoon.s390x-latest.args | 4 +-
...io-zpci-multidomain-many.s390x-latest.args | 4 +-
.../hostdev-vfio-zpci.s390x-latest.args | 4 +-
.../hostdev-vfio.x86_64-latest.args | 4 +-
.../machine-loadparm-hostdev.s390x-9.1.0.args | 2 +-
...machine-loadparm-hostdev.s390x-latest.args | 4 +-
.../net-hostdev-bootorder.x86_64-latest.args | 4 +-
...net-hostdev-multidomain.x86_64-latest.args | 4 +-
...ostdev-vfio-multidomain.x86_64-latest.args | 4 +-
.../net-hostdev-vfio.x86_64-latest.args | 4 +-
.../net-hostdev.x86_64-latest.args | 4 +-
.../net-vdpa-multiqueue.x86_64-latest.args | 4 +-
.../net-vdpa.x86_64-latest.args | 4 +-
...-virtio-teaming-hostdev.x86_64-latest.args | 4 +-
...-virtio-teaming-network.x86_64-latest.args | 4 +-
.../net-virtio-teaming.x86_64-latest.args | 4 +-
.../pci-rom.x86_64-latest.args | 4 +-
.../pseries-hostdevs-1.ppc64-latest.args | 4 +-
.../pseries-hostdevs-2.ppc64-latest.args | 4 +-
.../pseries-hostdevs-3.ppc64-latest.args | 4 +-
56 files changed, 271 insertions(+), 85 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC HCI-8.1 PATCH 1/5] qemu update: allow qemu-update for VMs with PCI and USB hostdevs #VSTOR-103860 #VSTOR-137800
2026-10-09 14:04 [RFC HCI-8.1 PATCH 0/5] qemu: allow qemu-update with VFIO hostdevs on shared memfd RAM #VSTOR-103860 Andrey Drobyshev
@ 2026-10-09 14:04 ` Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 2/5] qemu: capabilities: probe aux-ram-share machine property #VSTOR-103860 Andrey Drobyshev
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Andrey Drobyshev @ 2026-10-09 14:04 UTC (permalink / raw)
To: svt-core; +Cc: andrey.drobyshev, efim.shevrin, den
Previous commit 23ba7842b6 ("qemu update: disable update if hostdev
device is added to VM #VSTOR-97345") refused qemu-update for any domain
carrying a <hostdev>, because QEMU of that time could not preserve
passthrough devices across cpr-exec. QEMU now does: VFIO devices
survive the update via the CPR FD preservation machinery, and USB
hostdevs are covered by QEMU as well.
Replace the blanket check with an allowlist. PCI hostdevs (VFIO; this
also covers <interface type='hostdev'> SR-IOV VFs, which libvirt keeps
in the hostdevs array too) and USB hostdevs pass. Other hostdev types
(mdev, scsi, scsi_host) haven't been validated with cpr-exec and are
still refused, now naming the offending type in the error.
NVMe disks (QEMU's userspace NVMe driver on top of VFIO) and vDPA
interfaces pin guest memory for device DMA just like VFIO devices, but
they are not hostdevs and thus never went through the hostdev check.
Refuse them explicitly, each with its own error.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
src/qemu/qemu_driver.c | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 911690e3909..b3902f10c65 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -25158,6 +25158,7 @@ qemuDomainGuestQemuUpdatePrechecks(virDomainObj *vm)
qemuDomainObjPrivate *priv = vm->privateData;
g_autoptr(GHashTable) blockjobstats = NULL;
g_autoptr(virJSONValue) array = NULL;
+ size_t i;
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
virReportError(VIR_ERR_OPERATION_INVALID,
@@ -25172,9 +25173,38 @@ qemuDomainGuestQemuUpdatePrechecks(virDomainObj *vm)
return -1;
}
- if (vm->def->nhostdevs > 0) {
+ /* Only PCI (VFIO) and USB hostdevs are known to survive cpr-exec */
+ for (i = 0; i < vm->def->nhostdevs; i++) {
+ virDomainHostdevDef *hostdev = vm->def->hostdevs[i];
+ const char *type;
+
+ if (virHostdevIsPCIDevice(hostdev) ||
+ (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
+ hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB))
+ continue;
+
+ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
+ type = virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type);
+ else
+ type = virDomainHostdevModeTypeToString(hostdev->mode);
+
virReportError(VIR_ERR_OPERATION_INVALID,
- _("VM '%1$s' has hostdevs, qemu-update cancelled"), vm->def->name);
+ _("VM '%1$s' has hostdev of unsupported type '%2$s', qemu-update cancelled"),
+ vm->def->name, type);
+ return -1;
+ }
+
+ if (virDomainDefHasNVMeDisk(vm->def)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("VM '%1$s' has NVMe disk, qemu-update cancelled"),
+ vm->def->name);
+ return -1;
+ }
+
+ if (virDomainDefHasVDPANet(vm->def)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("VM '%1$s' has vDPA interface, qemu-update cancelled"),
+ vm->def->name);
return -1;
}
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC HCI-8.1 PATCH 2/5] qemu: capabilities: probe aux-ram-share machine property #VSTOR-103860
2026-10-09 14:04 [RFC HCI-8.1 PATCH 0/5] qemu: allow qemu-update with VFIO hostdevs on shared memfd RAM #VSTOR-103860 Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 1/5] qemu update: allow qemu-update for VMs with PCI and USB hostdevs #VSTOR-103860 #VSTOR-137800 Andrey Drobyshev
@ 2026-10-09 14:04 ` Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 3/5] qemu: back guest RAM with shared memfd for VMs with DMA-pinning devices #VSTOR-103860 Andrey Drobyshev
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Andrey Drobyshev @ 2026-10-09 14:04 UTC (permalink / raw)
To: svt-core; +Cc: andrey.drobyshev, efim.shevrin, den
QEMU 10.0 added the 'aux-ram-share' machine property: with it set,
auxiliary RAM blocks that don't come from a memory-backend object
(VGA VRAM, firmware and option ROMs, ACPI tables) are allocated as
shared memfd instead of anonymous private memory.
It is a property of the base machine class, so probe it on the 'none'
machine together with the other generic machine properties. Used by
the next commits to share auxiliary RAM of VMs that pin guest memory
for device DMA.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml | 1 +
tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml | 1 +
8 files changed, 9 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 4071f93c865..6546a0bdf42 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -749,6 +749,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
"max-workers", /* QEMU_CAPS_BLOCKSTREAM_MAX_WORKERS */
"cpr-exec-command", /* QEMU_CAPS_MIGRATION_PARAM_CPR_EXEC_COMMAND */
"win-dmp.guest-aware", /* QEMU_CAPS_WIN_DMP_GUEST_AWARE */
+ "machine.aux-ram-share", /* QEMU_CAPS_MACHINE_AUX_RAM_SHARE */
);
@@ -1808,6 +1809,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] = {
static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsGeneric[] = {
{ "confidential-guest-support", QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT },
{ "shim", QEMU_CAPS_MACHINE_SHIM },
+ { "aux-ram-share", QEMU_CAPS_MACHINE_AUX_RAM_SHARE },
};
static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsGenericPC[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e5f22323551..18e89cf8458 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -730,6 +730,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
QEMU_CAPS_BLOCKSTREAM_MAX_WORKERS, /* 'max-workers' block-stream opt is supported */
QEMU_CAPS_MIGRATION_PARAM_CPR_EXEC_COMMAND, /* 'cpr-exec-command' migrate-set-parameters member is supported */
QEMU_CAPS_WIN_DMP_GUEST_AWARE, /* 'win-dmp' is offered only to a guest that can use it */
+ QEMU_CAPS_MACHINE_AUX_RAM_SHARE, /* -machine aux-ram-share */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
index 94e73db2fb3..cd43e84d43b 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
@@ -165,6 +165,7 @@
<flag name='nvme-ns'/>
<flag name='usb-bot'/>
<flag name='drive-mirror-copy-mode'/>
+ <flag name='machine.aux-ram-share'/>
<version>10000000</version>
<microcodeVersion>61700285</microcodeVersion>
<package>v10.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
index ffdd9a71ca8..da71b876293 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
@@ -173,6 +173,7 @@
<flag name='nvme-ns'/>
<flag name='usb-bot'/>
<flag name='drive-mirror-copy-mode'/>
+ <flag name='machine.aux-ram-share'/>
<version>10000000</version>
<microcodeVersion>42900285</microcodeVersion>
<package>v10.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
index e4a6e82d74f..12f9886250a 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
@@ -139,6 +139,7 @@
<flag name='nvme-ns'/>
<flag name='usb-bot'/>
<flag name='drive-mirror-copy-mode'/>
+ <flag name='machine.aux-ram-share'/>
<version>10000000</version>
<microcodeVersion>39100285</microcodeVersion>
<package>v10.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml
index 6ac39b20915..471c8d70aa5 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml
@@ -211,6 +211,7 @@
<flag name='amd-iommu'/>
<flag name='usb-bot'/>
<flag name='drive-mirror-copy-mode'/>
+ <flag name='machine.aux-ram-share'/>
<version>10000000</version>
<microcodeVersion>43100285</microcodeVersion>
<package>v10.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
index d45f6492596..406358efb15 100644
--- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
@@ -212,6 +212,7 @@
<flag name='usb-bot'/>
<flag name='drive-mirror-copy-mode'/>
<flag name='max-workers'/>
+ <flag name='machine.aux-ram-share'/>
<version>10000000</version>
<microcodeVersion>43100285</microcodeVersion>
<package>v10.0.0</package>
diff --git a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml b/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml
index bd1c7cec7fd..368d5566bc7 100644
--- a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml
+++ b/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml
@@ -193,6 +193,7 @@
<flag name='usb-bot'/>
<flag name='tdx-guest'/>
<flag name='drive-mirror-copy-mode'/>
+ <flag name='machine.aux-ram-share'/>
<version>10000050</version>
<microcodeVersion>43100286</microcodeVersion>
<package>v10.0.0-1724-gf9a3def17b</package>
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC HCI-8.1 PATCH 3/5] qemu: back guest RAM with shared memfd for VMs with DMA-pinning devices #VSTOR-103860
2026-10-09 14:04 [RFC HCI-8.1 PATCH 0/5] qemu: allow qemu-update with VFIO hostdevs on shared memfd RAM #VSTOR-103860 Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 1/5] qemu update: allow qemu-update for VMs with PCI and USB hostdevs #VSTOR-103860 #VSTOR-137800 Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 2/5] qemu: capabilities: probe aux-ram-share machine property #VSTOR-103860 Andrey Drobyshev
@ 2026-10-09 14:04 ` Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 4/5] qemu: share auxiliary RAM of " Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 5/5] qemu update: refuse PCI hostdevs on non-shared guest RAM #VSTOR-103860 Andrey Drobyshev
4 siblings, 0 replies; 6+ messages in thread
From: Andrey Drobyshev @ 2026-10-09 14:04 UTC (permalink / raw)
To: svt-core; +Cc: andrey.drobyshev, efim.shevrin, den
VFIO hostdevs and mdevs, NVMe disks (QEMU's userspace driver on top of
VFIO) and vDPA interfaces make the guest RAM pinned for the IOMMU, so
the device can DMA into it. libvirt starts such VMs with anonymous
private RAM (memory-backend-ram) unless told otherwise.
qemu-update preserves anonymous RAM across exec with MADV_DOEXEC. The
first guest write to a page after the exec copies it, while the IOMMU
keeps pointing to the old pinned page: the device and the guest stop
seeing each other's data, and the passed-through device silently dies
(e.g. GPU GSP RPC timeouts, a NIC that neither sends nor receives).
Shared memfd RAM is handed over to the new QEMU as is and has no such
problem. Such VMs get no benefit from KSM anyway, since KSM never
merges pinned pages.
So when a new domain with any of these devices starts, back its guest
RAM with shared memfd, i.e. as if
<memoryBacking><source type='memfd'/><access mode='shared'/></memoryBacking>
was configured. Only the live definition is changed, and only if the
memory backing wasn't configured explicitly (no source, access mode or
hugepages, also per guest NUMA node) and QEMU supports memfd.
This is not done for incoming migration, restore or qemu-update: there
the live definition must stay as the running or saved QEMU has it. An
incoming migration still ends up with memfd if the source had it, as it
is part of the migrated definition.
The XML-to-argv outputs of all hostdev, mdev, NVMe and vDPA tests change
accordingly: memory-backend-ram becomes memory-backend-memfd with
share=true.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
src/qemu/qemu_process.c | 57 +++++++++++++++++++
.../disk-nvme.x86_64-latest.args | 2 +-
.../disk-slices.x86_64-latest.args | 2 +-
...tdev-mdev-display-ramfb.x86_64-latest.args | 2 +-
...play-spice-egl-headless.x86_64-latest.args | 2 +-
...ev-display-spice-opengl.x86_64-latest.args | 2 +-
...isplay-vnc-egl-headless.x86_64-latest.args | 2 +-
...ostdev-mdev-display-vnc.x86_64-latest.args | 2 +-
.../hostdev-mdev-display.x86_64-latest.args | 2 +-
...hostdev-mdev-precreated.x86_64-latest.args | 2 +-
...tdev-pci-address-device.x86_64-latest.args | 2 +-
...-pci-address-unassigned.x86_64-latest.args | 2 +-
.../hostdev-pci-address.x86_64-latest.args | 2 +-
...stdev-pci-display-ramfb.x86_64-latest.args | 2 +-
...stdev-pci-multifunction.x86_64-latest.args | 2 +-
...tdev-subsys-mdev-vfio-ap.s390x-latest.args | 2 +-
...ubsys-mdev-vfio-ccw-boot.s390x-latest.args | 2 +-
...dev-subsys-mdev-vfio-ccw.s390x-latest.args | 2 +-
...ostdev-vfio-multidomain.x86_64-latest.args | 2 +-
...o-zpci-autogenerate-fids.s390x-latest.args | 2 +-
...o-zpci-autogenerate-uids.s390x-latest.args | 2 +-
...v-vfio-zpci-autogenerate.s390x-latest.args | 2 +-
...dev-vfio-zpci-boundaries.s390x-latest.args | 2 +-
...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +-
...io-zpci-multidomain-many.s390x-latest.args | 2 +-
.../hostdev-vfio-zpci.s390x-latest.args | 2 +-
.../hostdev-vfio.x86_64-latest.args | 2 +-
.../machine-loadparm-hostdev.s390x-9.1.0.args | 2 +-
...machine-loadparm-hostdev.s390x-latest.args | 2 +-
.../net-hostdev-bootorder.x86_64-latest.args | 2 +-
...net-hostdev-multidomain.x86_64-latest.args | 2 +-
...ostdev-vfio-multidomain.x86_64-latest.args | 2 +-
.../net-hostdev-vfio.x86_64-latest.args | 2 +-
.../net-hostdev.x86_64-latest.args | 2 +-
.../net-vdpa-multiqueue.x86_64-latest.args | 2 +-
.../net-vdpa.x86_64-latest.args | 2 +-
...-virtio-teaming-hostdev.x86_64-latest.args | 2 +-
...-virtio-teaming-network.x86_64-latest.args | 2 +-
.../net-virtio-teaming.x86_64-latest.args | 2 +-
.../pci-rom.x86_64-latest.args | 2 +-
.../pseries-hostdevs-1.ppc64-latest.args | 2 +-
.../pseries-hostdevs-2.ppc64-latest.args | 2 +-
.../pseries-hostdevs-3.ppc64-latest.args | 2 +-
43 files changed, 99 insertions(+), 42 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index df79349c9fb..cea6957ad1a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7972,6 +7972,59 @@ qemuProcessPrepareDomainStorage(virQEMUDriver *driver,
}
+/**
+ * qemuProcessPrepareDomainMemoryBacking:
+ * @vm: domain object
+ *
+ * Devices that DMA into guest RAM (VFIO hostdevs and mdevs, NVMe disks,
+ * vDPA interfaces) get the guest RAM pinned for the IOMMU. If that RAM
+ * is anonymous private memory, qemu-update preserves it across exec with
+ * MADV_DOEXEC, the first guest write after the exec copies the page, and
+ * the device keeps doing DMA to the old pinned page the guest no longer
+ * sees. Shared memfd RAM is handed over to the new QEMU as is and does
+ * not have this problem.
+ *
+ * So back guest RAM of such domains with shared memfd, unless the memory
+ * backing was configured explicitly. Only the live definition changes.
+ */
+static void
+qemuProcessPrepareDomainMemoryBacking(virDomainObj *vm)
+{
+ virDomainDef *def = vm->def;
+ qemuDomainObjPrivate *priv = vm->privateData;
+ size_t nnodes = virDomainNumaGetNodeCount(def->numa);
+ size_t i;
+
+ if (!qemuDomainNeedsVFIO(def) && !virDomainDefHasVDPANet(def))
+ return;
+
+ if (def->mem.source != VIR_DOMAIN_MEMORY_SOURCE_NONE ||
+ def->mem.access != VIR_DOMAIN_MEMORY_ACCESS_DEFAULT ||
+ def->mem.nhugepages > 0)
+ return;
+
+ for (i = 0; i < nnodes; i++) {
+ if (virDomainNumaGetNodeMemoryAccessMode(def->numa, i) !=
+ VIR_DOMAIN_MEMORY_ACCESS_DEFAULT)
+ return;
+ }
+
+ if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_MEMFD))
+ return;
+
+ /* Without guest NUMA nodes, RAM comes from a memory-backend object only
+ * if QEMU exposes the ID of the default RAM. */
+ if (nnodes == 0 &&
+ !virQEMUCapsGetMachineDefaultRAMid(priv->qemuCaps, def->virtType,
+ def->os.machine))
+ return;
+
+ VIR_DEBUG("Backing guest RAM with shared memfd: DMA-pinning devices present");
+ def->mem.source = VIR_DOMAIN_MEMORY_SOURCE_MEMFD;
+ def->mem.access = VIR_DOMAIN_MEMORY_ACCESS_SHARED;
+}
+
+
static int
qemuProcessPrepareDomainHostdevs(virDomainObj *vm,
qemuDomainObjPrivate *priv)
@@ -8185,6 +8238,10 @@ qemuProcessPrepareDomain(virQEMUDriver *driver,
VIR_DEBUG("Aligning guest memory");
if (qemuDomainAlignMemorySizes(vm->def) < 0)
return -1;
+
+ /* Never on qemu-update: the new QEMU must match the running one. */
+ if (!(flags & VIR_QEMU_PROCESS_START_X_QEMU_UPDATE))
+ qemuProcessPrepareDomainMemoryBacking(vm);
}
for (i = 0; i < vm->def->nchannels; i++) {
diff --git a/tests/qemuxmlconfdata/disk-nvme.x86_64-latest.args b/tests/qemuxmlconfdata/disk-nvme.x86_64-latest.args
index 4bb7d67dc98..31fc6d517bf 100644
--- a/tests/qemuxmlconfdata/disk-nvme.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/disk-nvme.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/disk-slices.x86_64-latest.args b/tests/qemuxmlconfdata/disk-slices.x86_64-latest.args
index 658391c4778..2124e6b129e 100644
--- a/tests/qemuxmlconfdata/disk-slices.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/disk-slices.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-ramfb.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-ramfb.x86_64-latest.args
index d881c56af01..ffcc5562b6d 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-ramfb.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-ramfb.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
index cd74de7b73e..ef8c0121ff6 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
index 1b8b48b7428..4a863af3abd 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
index be678cb85b8..a5ffde5a48e 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-vnc.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-vnc.x86_64-latest.args
index b3e9d12f4e3..c4b59a37c1a 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-vnc.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-vnc.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display.x86_64-latest.args
index b3e9d12f4e3..c4b59a37c1a 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-precreated.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-precreated.x86_64-latest.args
index 18e59f7520d..9c8064c7d3b 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-precreated.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-precreated.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-address-device.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-address-device.x86_64-latest.args
index 2a00147ae4b..80970358b9c 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-address-device.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-address-device.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-address-unassigned.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-address-unassigned.x86_64-latest.args
index 1247ff547b1..0328d441dce 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-address-unassigned.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-address-unassigned.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-delete/.config \
-accel kvm \
-cpu qemu64 \
-m size=262144k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":268435456}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":268435456}' \
-overcommit mem-lock=off \
-smp 4,sockets=4,cores=1,threads=1 \
-uuid 583a8e8e-f0ce-4f53-89ab-092862148b25 \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-address.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-address.x86_64-latest.args
index f84904db82d..18dfa2d17d5 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-address.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-address.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
index a681504c3dd..332fff8b84a 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-multifunction.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-multifunction.x86_64-latest.args
index f3bcec09837..12d10aed715 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-multifunction.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-multifunction.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-delete/.config \
-accel kvm \
-cpu qemu64 \
-m size=262144k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":268435456}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":268435456}' \
-overcommit mem-lock=off \
-smp 4,sockets=4,cores=1,threads=1 \
-uuid 583a8e8e-f0ce-4f53-89ab-092862148b25 \
diff --git a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args
index 880265bb032..7c923d99f10 100644
--- a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=524288k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":536870912}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":536870912}' \
-overcommit mem-lock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args
index aeb07a9bcbd..6ed62006e3a 100644
--- a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=524288k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":536870912}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":536870912}' \
-overcommit mem-lock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw.s390x-latest.args
index 01b182d44ef..dc225816355 100644
--- a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=524288k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":536870912}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":536870912}' \
-overcommit mem-lock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-multidomain.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-multidomain.x86_64-latest.args
index fa3fd3aa997..ad08f942abe 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-multidomain.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-multidomain.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-fids.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-fids.s390x-latest.args
index d0355d04b87..d6c1855a015 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-fids.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-fids.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-uids.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-uids.s390x-latest.args
index 6754899fe40..c71df6ab57f 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-uids.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-uids.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate.s390x-latest.args
index 2c142c1e5a6..75bfe10700f 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-boundaries.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-boundaries.s390x-latest.args
index 3bf6534c362..93f15c430b6 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-boundaries.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-boundaries.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args
index d69ebfc8fdb..37635a3e25c 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-KVMGuest1/.config \
-accel kvm \
-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-multidomain-many.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-multidomain-many.s390x-latest.args
index 43b861b65ca..948bb876fed 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-multidomain-many.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-multidomain-many.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci.s390x-latest.args
index 852fe0206a4..1e923207ca5 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-vfio.x86_64-latest.args
index 658fc2559eb..7054582818e 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args
index 0a025e6335b..fa0666550e2 100644
--- a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args
+++ b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=524288k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":536870912}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":536870912}' \
-overcommit mem-lock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args
index 39f77c14e7e..fa4084739ed 100644
--- a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args
+++ b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu \
-m size=524288k \
--object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":536870912}' \
+-object '{"qom-type":"memory-backend-memfd","id":"s390.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":536870912}' \
-overcommit mem-lock=off \
-smp 2,sockets=2,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-hostdev-bootorder.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev-bootorder.x86_64-latest.args
index 26c61e29e23..432627f037f 100644
--- a/tests/qemuxmlconfdata/net-hostdev-bootorder.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev-bootorder.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-hostdev-multidomain.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev-multidomain.x86_64-latest.args
index 2e94db50a1e..f9c46a9df79 100644
--- a/tests/qemuxmlconfdata/net-hostdev-multidomain.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev-multidomain.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-hostdev-vfio-multidomain.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev-vfio-multidomain.x86_64-latest.args
index c0e17fb91ca..bd59a926816 100644
--- a/tests/qemuxmlconfdata/net-hostdev-vfio-multidomain.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev-vfio-multidomain.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-hostdev-vfio.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev-vfio.x86_64-latest.args
index 051afb53ac9..1f8d5357d95 100644
--- a/tests/qemuxmlconfdata/net-hostdev-vfio.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev-vfio.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-hostdev.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev.x86_64-latest.args
index 8ee253826e2..263811a3486 100644
--- a/tests/qemuxmlconfdata/net-hostdev.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-vdpa-multiqueue.x86_64-latest.args b/tests/qemuxmlconfdata/net-vdpa-multiqueue.x86_64-latest.args
index e3aee785bfe..c4f618c1c06 100644
--- a/tests/qemuxmlconfdata/net-vdpa-multiqueue.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-vdpa-multiqueue.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-vdpa.x86_64-latest.args b/tests/qemuxmlconfdata/net-vdpa.x86_64-latest.args
index 1fccd80199c..15e9cf0a341 100644
--- a/tests/qemuxmlconfdata/net-vdpa.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-vdpa.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-virtio-teaming-hostdev.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-teaming-hostdev.x86_64-latest.args
index a5cce0e27cb..fe6521e61b1 100644
--- a/tests/qemuxmlconfdata/net-virtio-teaming-hostdev.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-virtio-teaming-hostdev.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args
index 0c07ec4c702..0255d1b586d 100644
--- a/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/net-virtio-teaming.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-teaming.x86_64-latest.args
index 090bf2979dd..a4cf2b9db94 100644
--- a/tests/qemuxmlconfdata/net-virtio-teaming.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-virtio-teaming.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/pci-rom.x86_64-latest.args b/tests/qemuxmlconfdata/pci-rom.x86_64-latest.args
index a4a1c573191..70556423ac5 100644
--- a/tests/qemuxmlconfdata/pci-rom.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/pci-rom.x86_64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-object '{"qom-type":"memory-backend-memfd","id":"pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":224395264}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9466-926a-d65c16db1809 \
diff --git a/tests/qemuxmlconfdata/pseries-hostdevs-1.ppc64-latest.args b/tests/qemuxmlconfdata/pseries-hostdevs-1.ppc64-latest.args
index 30d97d291c3..57fb8128b39 100644
--- a/tests/qemuxmlconfdata/pseries-hostdevs-1.ppc64-latest.args
+++ b/tests/qemuxmlconfdata/pseries-hostdevs-1.ppc64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-accel tcg \
-cpu POWER10 \
-m size=524288k \
--object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":536870912}' \
+-object '{"qom-type":"memory-backend-memfd","id":"ppc_spapr.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":536870912}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
diff --git a/tests/qemuxmlconfdata/pseries-hostdevs-2.ppc64-latest.args b/tests/qemuxmlconfdata/pseries-hostdevs-2.ppc64-latest.args
index 4674158fd18..d7c97f4dae8 100644
--- a/tests/qemuxmlconfdata/pseries-hostdevs-2.ppc64-latest.args
+++ b/tests/qemuxmlconfdata/pseries-hostdevs-2.ppc64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-accel tcg \
-cpu POWER10 \
-m size=524288k \
--object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":536870912}' \
+-object '{"qom-type":"memory-backend-memfd","id":"ppc_spapr.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":536870912}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
diff --git a/tests/qemuxmlconfdata/pseries-hostdevs-3.ppc64-latest.args b/tests/qemuxmlconfdata/pseries-hostdevs-3.ppc64-latest.args
index e85227a9517..90157f61c25 100644
--- a/tests/qemuxmlconfdata/pseries-hostdevs-3.ppc64-latest.args
+++ b/tests/qemuxmlconfdata/pseries-hostdevs-3.ppc64-latest.args
@@ -14,7 +14,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-accel tcg \
-cpu POWER10 \
-m size=524288k \
--object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":536870912}' \
+-object '{"qom-type":"memory-backend-memfd","id":"ppc_spapr.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"size":536870912}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC HCI-8.1 PATCH 4/5] qemu: share auxiliary RAM of VMs with DMA-pinning devices #VSTOR-103860
2026-10-09 14:04 [RFC HCI-8.1 PATCH 0/5] qemu: allow qemu-update with VFIO hostdevs on shared memfd RAM #VSTOR-103860 Andrey Drobyshev
` (2 preceding siblings ...)
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 3/5] qemu: back guest RAM with shared memfd for VMs with DMA-pinning devices #VSTOR-103860 Andrey Drobyshev
@ 2026-10-09 14:04 ` Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 5/5] qemu update: refuse PCI hostdevs on non-shared guest RAM #VSTOR-103860 Andrey Drobyshev
4 siblings, 0 replies; 6+ messages in thread
From: Andrey Drobyshev @ 2026-10-09 14:04 UTC (permalink / raw)
To: svt-core; +Cc: andrey.drobyshev, efim.shevrin, den
Besides guest RAM, VFIO also maps and pins auxiliary RAM that is visible
in the guest address space: VGA VRAM, firmware and option ROMs. QEMU
allocates it as anonymous private memory unless the machine property
'aux-ram-share' is on, so with shared memfd guest RAM from the previous
commit it is the only memory left that qemu-update preserves with
MADV_DOEXEC and that can thus diverge between the device and the guest.
ROMs are never written after boot, so in practice only VRAM is at risk,
and only if the device does DMA to it; still, close the gap.
When a new domain starts with DMA-pinning devices and all of its guest
RAM shared, and QEMU knows 'aux-ram-share', add aux-ram-share=on to
-machine.
The decision is taken once at start and kept in the domain private data
(<auxRamShare/> in the status XML). The qemu-update command line is
built from it rather than recomputed, because it must match the running
QEMU even after a libvirt upgrade changed the rules. Incoming migration
and restore don't share auxiliary RAM, as the source may not have.
XML-to-argv outputs of the hostdev, mdev, NVMe and vDPA tests with QEMU
10.0 capabilities gain aux-ram-share=on; the status XML round-trip test
covers the new element.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
src/qemu/qemu_command.c | 3 ++
src/qemu/qemu_domain.c | 36 +++++++++++++++++++
src/qemu/qemu_domain.h | 6 ++++
src/qemu/qemu_process.c | 36 ++++++++++++++++++-
tests/qemustatusxml2xmldata/modern-in.xml | 1 +
.../disk-nvme.x86_64-latest.args | 2 +-
.../disk-slices.x86_64-latest.args | 2 +-
...tdev-mdev-display-ramfb.x86_64-latest.args | 2 +-
...play-spice-egl-headless.x86_64-latest.args | 2 +-
...ev-display-spice-opengl.x86_64-latest.args | 2 +-
...isplay-vnc-egl-headless.x86_64-latest.args | 2 +-
...ostdev-mdev-display-vnc.x86_64-latest.args | 2 +-
.../hostdev-mdev-display.x86_64-latest.args | 2 +-
...hostdev-mdev-precreated.x86_64-latest.args | 2 +-
...tdev-pci-address-device.x86_64-latest.args | 2 +-
...-pci-address-unassigned.x86_64-latest.args | 2 +-
.../hostdev-pci-address.x86_64-latest.args | 2 +-
...stdev-pci-display-ramfb.x86_64-latest.args | 2 +-
...stdev-pci-multifunction.x86_64-latest.args | 2 +-
...tdev-subsys-mdev-vfio-ap.s390x-latest.args | 2 +-
...ubsys-mdev-vfio-ccw-boot.s390x-latest.args | 2 +-
...dev-subsys-mdev-vfio-ccw.s390x-latest.args | 2 +-
...ostdev-vfio-multidomain.x86_64-latest.args | 2 +-
...o-zpci-autogenerate-fids.s390x-latest.args | 2 +-
...o-zpci-autogenerate-uids.s390x-latest.args | 2 +-
...v-vfio-zpci-autogenerate.s390x-latest.args | 2 +-
...dev-vfio-zpci-boundaries.s390x-latest.args | 2 +-
...vfio-zpci-ccw-memballoon.s390x-latest.args | 2 +-
...io-zpci-multidomain-many.s390x-latest.args | 2 +-
.../hostdev-vfio-zpci.s390x-latest.args | 2 +-
.../hostdev-vfio.x86_64-latest.args | 2 +-
...machine-loadparm-hostdev.s390x-latest.args | 2 +-
.../net-hostdev-bootorder.x86_64-latest.args | 2 +-
...net-hostdev-multidomain.x86_64-latest.args | 2 +-
...ostdev-vfio-multidomain.x86_64-latest.args | 2 +-
.../net-hostdev-vfio.x86_64-latest.args | 2 +-
.../net-hostdev.x86_64-latest.args | 2 +-
.../net-vdpa-multiqueue.x86_64-latest.args | 2 +-
.../net-vdpa.x86_64-latest.args | 2 +-
...-virtio-teaming-hostdev.x86_64-latest.args | 2 +-
...-virtio-teaming-network.x86_64-latest.args | 2 +-
.../net-virtio-teaming.x86_64-latest.args | 2 +-
.../pci-rom.x86_64-latest.args | 2 +-
.../pseries-hostdevs-1.ppc64-latest.args | 2 +-
.../pseries-hostdevs-2.ppc64-latest.args | 2 +-
.../pseries-hostdevs-3.ppc64-latest.args | 2 +-
46 files changed, 122 insertions(+), 42 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index fcc0a64ed0d..7c995a58b88 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7399,6 +7399,9 @@ qemuBuildMachineCommandLine(virCommand *cmd,
if (qemuAppendDomainMemoryMachineParams(&buf, cfg, def, qemuCaps) < 0)
return -1;
+ if (priv && priv->auxRamShare)
+ virBufferAddLit(&buf, ",aux-ram-share=on");
+
if (cpu && cpu->model &&
cpu->mode == VIR_CPU_MODE_HOST_MODEL &&
qemuDomainIsPSeries(def)) {
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 551c214c774..791c833fc13 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1933,6 +1933,7 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *priv)
g_clear_pointer(&priv->namespaces, virBitmapFree);
priv->rememberOwner = false;
+ priv->auxRamShare = false;
priv->reconnectBlockjobs = VIR_TRISTATE_BOOL_ABSENT;
priv->allowReboot = VIR_TRISTATE_BOOL_ABSENT;
@@ -2881,6 +2882,9 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf,
if (priv->rememberOwner)
virBufferAddLit(buf, "<rememberOwner/>\n");
+ if (priv->auxRamShare)
+ virBufferAddLit(buf, "<auxRamShare/>\n");
+
qemuDomainObjPrivateXMLFormatAllowReboot(buf, priv->allowReboot);
qemuDomainObjPrivateXMLFormatPR(buf, priv);
@@ -3605,6 +3609,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
}
priv->rememberOwner = virXPathBoolean("count(./rememberOwner) > 0", ctxt);
+ priv->auxRamShare = virXPathBoolean("count(./auxRamShare) > 0", ctxt);
if ((n = virXPathNodeSet("./vcpus/vcpu", ctxt, &nodes)) < 0)
return -1;
@@ -9421,6 +9426,37 @@ qemuDomainNeedsVFIO(const virDomainDef *def)
}
+/**
+ * qemuDomainDefGuestRAMIsShared:
+ * @def: domain definition
+ *
+ * Returns true if all guest RAM is shared, i.e. its memory access mode is
+ * 'shared' globally or for every guest NUMA node. Shared RAM is backed by
+ * a file or memfd mapped with MAP_SHARED.
+ */
+bool
+qemuDomainDefGuestRAMIsShared(const virDomainDef *def)
+{
+ size_t nnodes = virDomainNumaGetNodeCount(def->numa);
+ size_t i;
+
+ if (nnodes == 0)
+ return def->mem.access == VIR_DOMAIN_MEMORY_ACCESS_SHARED;
+
+ for (i = 0; i < nnodes; i++) {
+ virDomainMemoryAccess access =
+ virDomainNumaGetNodeMemoryAccessMode(def->numa, i);
+
+ if (access == VIR_DOMAIN_MEMORY_ACCESS_DEFAULT)
+ access = def->mem.access;
+ if (access != VIR_DOMAIN_MEMORY_ACCESS_SHARED)
+ return false;
+ }
+
+ return true;
+}
+
+
/**
* qemuDomainGetHostdevPath:
* @dev: host device definition
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index c28ce473152..87b458ece38 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -293,6 +293,10 @@ struct _qemuDomainObjPrivate {
/* true if libvirt remembers the original owner for files */
bool rememberOwner;
+ /* true if QEMU runs with -machine aux-ram-share=on; decided once when
+ * the domain starts and kept for qemu-update */
+ bool auxRamShare;
+
/* true if global -mem-prealloc appears on cmd line */
bool memPrealloc;
@@ -1103,6 +1107,8 @@ bool qemuDomainSupportsVideoVga(const virDomainVideoDef *video,
bool qemuDomainNeedsVFIO(const virDomainDef *def);
+bool qemuDomainDefGuestRAMIsShared(const virDomainDef *def);
+
int qemuDomainGetHostdevPath(virDomainHostdevDef *dev,
char **path,
int *perms);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index cea6957ad1a..b4859a5dba5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8025,6 +8025,34 @@ qemuProcessPrepareDomainMemoryBacking(virDomainObj *vm)
}
+/**
+ * qemuProcessPrepareDomainAuxRamShare:
+ * @vm: domain object
+ *
+ * Besides guest RAM, VFIO also maps and pins auxiliary RAM visible in the
+ * guest address space: VGA VRAM, firmware and option ROMs. QEMU allocates
+ * it as anonymous private memory unless -machine aux-ram-share=on is set,
+ * so it would keep the qemu-update problem described at
+ * qemuProcessPrepareDomainMemoryBacking() even with shared guest RAM.
+ *
+ * Decide whether to share it. The decision is kept in the status XML and
+ * reused for qemu-update, whose QEMU command line must match the running
+ * one regardless of what a newer libvirt would decide.
+ */
+static void
+qemuProcessPrepareDomainAuxRamShare(virDomainObj *vm)
+{
+ virDomainDef *def = vm->def;
+ qemuDomainObjPrivate *priv = vm->privateData;
+
+ priv->auxRamShare = (qemuDomainNeedsVFIO(def) ||
+ virDomainDefHasVDPANet(def)) &&
+ qemuDomainDefGuestRAMIsShared(def) &&
+ virQEMUCapsGet(priv->qemuCaps,
+ QEMU_CAPS_MACHINE_AUX_RAM_SHARE);
+}
+
+
static int
qemuProcessPrepareDomainHostdevs(virDomainObj *vm,
qemuDomainObjPrivate *priv)
@@ -8240,8 +8268,14 @@ qemuProcessPrepareDomain(virQEMUDriver *driver,
return -1;
/* Never on qemu-update: the new QEMU must match the running one. */
- if (!(flags & VIR_QEMU_PROCESS_START_X_QEMU_UPDATE))
+ if (!(flags & VIR_QEMU_PROCESS_START_X_QEMU_UPDATE)) {
qemuProcessPrepareDomainMemoryBacking(vm);
+ qemuProcessPrepareDomainAuxRamShare(vm);
+ }
+ } else if (!(flags & VIR_QEMU_PROCESS_START_X_QEMU_UPDATE)) {
+ /* Incoming migration or restore: keep QEMU's default, the source
+ * didn't necessarily share its auxiliary RAM either. */
+ priv->auxRamShare = false;
}
for (i = 0; i < vm->def->nchannels; i++) {
diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxml2xmldata/modern-in.xml
index 3b3e8317599..7fae6e82a14 100644
--- a/tests/qemustatusxml2xmldata/modern-in.xml
+++ b/tests/qemustatusxml2xmldata/modern-in.xml
@@ -260,6 +260,7 @@
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-1-upstream'/>
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/1-upstream'/>
<chardevStdioLogd/>
+ <auxRamShare/>
<allowReboot value='yes'/>
<nodename index='123'/>
<fdset index='321'/>
diff --git a/tests/qemuxmlconfdata/disk-nvme.x86_64-latest.args b/tests/qemuxmlconfdata/disk-nvme.x86_64-latest.args
index 31fc6d517bf..a47609d454b 100644
--- a/tests/qemuxmlconfdata/disk-nvme.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/disk-nvme.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/disk-slices.x86_64-latest.args b/tests/qemuxmlconfdata/disk-slices.x86_64-latest.args
index 2124e6b129e..8db12aac833 100644
--- a/tests/qemuxmlconfdata/disk-slices.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/disk-slices.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-ramfb.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-ramfb.x86_64-latest.args
index ffcc5562b6d..23ac8d00dba 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-ramfb.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-ramfb.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
index ef8c0121ff6..2a011750637 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
index 4a863af3abd..fcd3a0ed3e4 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
index a5ffde5a48e..4be783e8e02 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display-vnc.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display-vnc.x86_64-latest.args
index c4b59a37c1a..f3305762ad3 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display-vnc.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display-vnc.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-display.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-display.x86_64-latest.args
index c4b59a37c1a..f3305762ad3 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-display.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-display.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-mdev-precreated.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-mdev-precreated.x86_64-latest.args
index 9c8064c7d3b..afcecdbd5f8 100644
--- a/tests/qemuxmlconfdata/hostdev-mdev-precreated.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-mdev-precreated.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-address-device.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-address-device.x86_64-latest.args
index 80970358b9c..0597b08ea4f 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-address-device.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-address-device.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-address-unassigned.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-address-unassigned.x86_64-latest.args
index 0328d441dce..3c7d7a54371 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-address-unassigned.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-address-unassigned.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-delete/.config \
-name guest=delete,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-delete/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel kvm \
-cpu qemu64 \
-m size=262144k \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-address.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-address.x86_64-latest.args
index 18dfa2d17d5..5961e551dc2 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-address.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-address.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
index 332fff8b84a..d1d31c04fc2 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-pci-multifunction.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-multifunction.x86_64-latest.args
index 12d10aed715..990f700f968 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-multifunction.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-multifunction.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-delete/.config \
-name guest=delete,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-delete/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel kvm \
-cpu qemu64 \
-m size=262144k \
diff --git a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args
index 7c923d99f10..5817f9ddacf 100644
--- a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ap.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=524288k \
diff --git a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args
index 6ed62006e3a..03c038b537c 100644
--- a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw-boot.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=524288k \
diff --git a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw.s390x-latest.args
index dc225816355..4a3a1ad9eeb 100644
--- a/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-subsys-mdev-vfio-ccw.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=524288k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-multidomain.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-multidomain.x86_64-latest.args
index ad08f942abe..000de5f65ff 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-multidomain.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-multidomain.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-fids.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-fids.s390x-latest.args
index d6c1855a015..a688f06fd38 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-fids.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-fids.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-uids.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-uids.s390x-latest.args
index c71df6ab57f..ef9871783d9 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-uids.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate-uids.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate.s390x-latest.args
index 75bfe10700f..f22c212d403 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-autogenerate.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-boundaries.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-boundaries.s390x-latest.args
index 93f15c430b6..2b8f6590a6f 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-boundaries.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-boundaries.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args
index 37635a3e25c..bd28e8bcb9e 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-ccw-memballoon.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-KVMGuest1/.config \
-name guest=KVMGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-KVMGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel kvm \
-cpu gen16a-base,nnpa=on,aen=on,cmmnt=on,vxpdeh=on,aefsi=on,diag318=on,csske=on,mepoch=on,msa9=on,msa8=on,msa7=on,msa6=on,msa5=on,msa4=on,msa3=on,msa2=on,msa1=on,sthyi=on,edat=on,ri=on,deflate=on,edat2=on,etoken=on,vx=on,ipter=on,pai=on,paie=on,mepochptff=on,ap=on,vxeh=on,vxpd=on,esop=on,msa9_pckmo=on,vxeh2=on,esort=on,appv=on,apqi=on,apft=on,els=on,iep=on,appvi=on,apqci=on,cte=on,ais=on,bpb=on,ctop=on,gs=on,ppa15=on,zpci=on,rdp=on,sea_esop2=on,beareh=on,te=on,cmm=on,vxpdeh2=on \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci-multidomain-many.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci-multidomain-many.s390x-latest.args
index 948bb876fed..6a4605310e3 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci-multidomain-many.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci-multidomain-many.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio-zpci.s390x-latest.args b/tests/qemuxmlconfdata/hostdev-vfio-zpci.s390x-latest.args
index 1e923207ca5..e53d44129dd 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio-zpci.s390x-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio-zpci.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/hostdev-vfio.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-vfio.x86_64-latest.args
index 7054582818e..48798b83553 100644
--- a/tests/qemuxmlconfdata/hostdev-vfio.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-vfio.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args
index fa4084739ed..31747c1e982 100644
--- a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args
+++ b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,aux-ram-share=on \
-accel tcg \
-cpu qemu \
-m size=524288k \
diff --git a/tests/qemuxmlconfdata/net-hostdev-bootorder.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev-bootorder.x86_64-latest.args
index 432627f037f..40dd5309ba8 100644
--- a/tests/qemuxmlconfdata/net-hostdev-bootorder.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev-bootorder.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-hostdev-multidomain.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev-multidomain.x86_64-latest.args
index f9c46a9df79..9a295d59ee4 100644
--- a/tests/qemuxmlconfdata/net-hostdev-multidomain.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev-multidomain.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-hostdev-vfio-multidomain.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev-vfio-multidomain.x86_64-latest.args
index bd59a926816..e2a56874246 100644
--- a/tests/qemuxmlconfdata/net-hostdev-vfio-multidomain.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev-vfio-multidomain.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-hostdev-vfio.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev-vfio.x86_64-latest.args
index 1f8d5357d95..77c56946978 100644
--- a/tests/qemuxmlconfdata/net-hostdev-vfio.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev-vfio.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-hostdev.x86_64-latest.args b/tests/qemuxmlconfdata/net-hostdev.x86_64-latest.args
index 263811a3486..938ae3270f9 100644
--- a/tests/qemuxmlconfdata/net-hostdev.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-hostdev.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-vdpa-multiqueue.x86_64-latest.args b/tests/qemuxmlconfdata/net-vdpa-multiqueue.x86_64-latest.args
index c4f618c1c06..91ccc9bf28a 100644
--- a/tests/qemuxmlconfdata/net-vdpa-multiqueue.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-vdpa-multiqueue.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-vdpa.x86_64-latest.args b/tests/qemuxmlconfdata/net-vdpa.x86_64-latest.args
index 15e9cf0a341..65b50faf7f0 100644
--- a/tests/qemuxmlconfdata/net-vdpa.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-vdpa.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-virtio-teaming-hostdev.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-teaming-hostdev.x86_64-latest.args
index fe6521e61b1..ddc5acdb3a2 100644
--- a/tests/qemuxmlconfdata/net-virtio-teaming-hostdev.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-virtio-teaming-hostdev.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args
index 0255d1b586d..9bd650f61b3 100644
--- a/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-virtio-teaming-network.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/net-virtio-teaming.x86_64-latest.args b/tests/qemuxmlconfdata/net-virtio-teaming.x86_64-latest.args
index a4cf2b9db94..3027e6d3b95 100644
--- a/tests/qemuxmlconfdata/net-virtio-teaming.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/net-virtio-teaming.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-name guest=QEMUGuest1,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/pci-rom.x86_64-latest.args b/tests/qemuxmlconfdata/pci-rom.x86_64-latest.args
index 70556423ac5..0f1a470f7dd 100644
--- a/tests/qemuxmlconfdata/pci-rom.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/pci-rom.x86_64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-name guest=QEMUGuest2,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest2/master-key.aes"}' \
--machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,aux-ram-share=on,acpi=off \
-accel tcg \
-cpu qemu64 \
-m size=219136k \
diff --git a/tests/qemuxmlconfdata/pseries-hostdevs-1.ppc64-latest.args b/tests/qemuxmlconfdata/pseries-hostdevs-1.ppc64-latest.args
index 57fb8128b39..55227197ae2 100644
--- a/tests/qemuxmlconfdata/pseries-hostdevs-1.ppc64-latest.args
+++ b/tests/qemuxmlconfdata/pseries-hostdevs-1.ppc64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-name guest=guest,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
--machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \
+-machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram,aux-ram-share=on \
-accel tcg \
-cpu POWER10 \
-m size=524288k \
diff --git a/tests/qemuxmlconfdata/pseries-hostdevs-2.ppc64-latest.args b/tests/qemuxmlconfdata/pseries-hostdevs-2.ppc64-latest.args
index d7c97f4dae8..7807414e174 100644
--- a/tests/qemuxmlconfdata/pseries-hostdevs-2.ppc64-latest.args
+++ b/tests/qemuxmlconfdata/pseries-hostdevs-2.ppc64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-name guest=guest,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
--machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \
+-machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram,aux-ram-share=on \
-accel tcg \
-cpu POWER10 \
-m size=524288k \
diff --git a/tests/qemuxmlconfdata/pseries-hostdevs-3.ppc64-latest.args b/tests/qemuxmlconfdata/pseries-hostdevs-3.ppc64-latest.args
index 90157f61c25..6b5e7c4ce2e 100644
--- a/tests/qemuxmlconfdata/pseries-hostdevs-3.ppc64-latest.args
+++ b/tests/qemuxmlconfdata/pseries-hostdevs-3.ppc64-latest.args
@@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
-name guest=guest,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
--machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \
+-machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram,aux-ram-share=on \
-accel tcg \
-cpu POWER10 \
-m size=524288k \
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC HCI-8.1 PATCH 5/5] qemu update: refuse PCI hostdevs on non-shared guest RAM #VSTOR-103860
2026-10-09 14:04 [RFC HCI-8.1 PATCH 0/5] qemu: allow qemu-update with VFIO hostdevs on shared memfd RAM #VSTOR-103860 Andrey Drobyshev
` (3 preceding siblings ...)
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 4/5] qemu: share auxiliary RAM of " Andrey Drobyshev
@ 2026-10-09 14:04 ` Andrey Drobyshev
4 siblings, 0 replies; 6+ messages in thread
From: Andrey Drobyshev @ 2026-10-09 14:04 UTC (permalink / raw)
To: svt-core; +Cc: andrey.drobyshev, efim.shevrin, den
New domains with PCI hostdevs get shared memfd guest RAM since the
previous commits, but not all running domains have it: those started
by an older libvirt, those with explicitly configured private memory
backing, and those that got a PCI hostdev hotplugged while running on
anonymous RAM. For them qemu-update would succeed while silently
breaking the device: DMA keeps going to the pages pinned before the
exec, which the guest stops seeing on its first write to them.
Refuse qemu-update for a domain with PCI hostdevs unless all of its
guest RAM is shared. A cold restart gives such a domain shared memfd
RAM, unless its memory backing is configured otherwise.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
src/qemu/qemu_driver.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b3902f10c65..c39e0133ebb 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -25194,6 +25194,16 @@ qemuDomainGuestQemuUpdatePrechecks(virDomainObj *vm)
return -1;
}
+ /* Device DMA keeps going to the pages pinned before the exec, which the
+ * guest stops seeing on its first write if the RAM is private. */
+ if (virDomainDefHasPCIHostdev(vm->def) &&
+ !qemuDomainDefGuestRAMIsShared(vm->def)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("VM '%1$s' has PCI hostdev on non-shared guest memory, qemu-update cancelled; a cold restart switches it to shared memory"),
+ vm->def->name);
+ return -1;
+ }
+
if (virDomainDefHasNVMeDisk(vm->def)) {
virReportError(VIR_ERR_OPERATION_INVALID,
_("VM '%1$s' has NVMe disk, qemu-update cancelled"),
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-09 14:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09 14:04 [RFC HCI-8.1 PATCH 0/5] qemu: allow qemu-update with VFIO hostdevs on shared memfd RAM #VSTOR-103860 Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 1/5] qemu update: allow qemu-update for VMs with PCI and USB hostdevs #VSTOR-103860 #VSTOR-137800 Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 2/5] qemu: capabilities: probe aux-ram-share machine property #VSTOR-103860 Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 3/5] qemu: back guest RAM with shared memfd for VMs with DMA-pinning devices #VSTOR-103860 Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 4/5] qemu: share auxiliary RAM of " Andrey Drobyshev
2026-10-09 14:04 ` [RFC HCI-8.1 PATCH 5/5] qemu update: refuse PCI hostdevs on non-shared guest RAM #VSTOR-103860 Andrey Drobyshev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox