From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Konstantin Shkolnyy <kshk@linux.ibm.com>
Cc: alifm@linux.ibm.com, farman@linux.ibm.com,
richard.henderson@linaro.org, iii@linux.ibm.com,
david@kernel.org, cohuck@redhat.com, pasic@linux.ibm.com,
borntraeger@linux.ibm.com, qemu-s390x@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH v7 14/15] s390x/pci: Implement migration for emulated devices
Date: Mon, 24 Aug 2026 18:35:48 -0400 [thread overview]
Message-ID: <e4520f30-6176-498e-840e-a5407aa68004@linux.ibm.com> (raw)
In-Reply-To: <20260818172521.223460-15-kshk@linux.ibm.com>
On 8/18/26 1:25 PM, Konstantin Shkolnyy wrote:
> Implement zPCI device state migration, consequently enabling migration
> of VMs that have emulated PCI devices, whether virtio or not.
> Migration is allowed for devices whose function handle has the
> FH_SHM_EMUL bit set. For these devices QEMU will save and restore the
> state of its zPCI emulator.
>
> This will enable emulated PCI migration starting with s390-ccw-virtio-11.2.
>
> Passthrough devices will continue to block migration.
>
> Reviewed-by: Farhan Ali<alifm@linux.ibm.com>
> Signed-off-by: Konstantin Shkolnyy <kshk@linux.ibm.com>
> ---
> hw/s390x/s390-pci-bus.c | 195 +++++++++++++++++++++++++++++++-
> hw/s390x/s390-pci-inst.c | 2 +-
> hw/s390x/s390-virtio-ccw.c | 4 +
> include/hw/s390x/s390-pci-bus.h | 4 +
> 4 files changed, 199 insertions(+), 6 deletions(-)
>
One high level comment is that S390pciState has some fields in it that
need consideration.
pending_sei seems like it needs to be handled for sure.
Migrating next_idx would probably only be an optimization; it should get
re-calculated the next time a device is plugged if we don't migrate it.
I think we are OK with zpci_groups because we are only migrating
emulated devices, they should get recreated as-expected on the target.
If we were to ever change the default CLP payload, it would need to be
on a qemu machine boundary.
That would need to be re-visited for vfio-pci migration. Basically, a
guest does not expect the CLP payload to change.
And then same for next_sim_grp, this is only used for vfio-pci devices
that disable interpretation support.
Not necessary now but would need to be re-visited for vfio-pci migration.
zpci_dma_limit is going to be null without vfio-pci; if/when vfio-pci is
supported I think the list will need to be re-populated (not migrated)
as part of updating the max_dma_limit and replaying the IOMMU.
bus_no, bus, zpci_table, iommu_table and zpci_devs all need to be
reconstructed on the target + fixed up during load for zpci_devs and
zpci_table.
[...]
> static const TypeInfo s390_pcibus_info = {
> .name = TYPE_S390_PCI_BUS,
> .parent = TYPE_BUS,
> .instance_size = sizeof(S390PCIBus),
> + /*
> + * Implement get_dev_path() to provide each zpci device with a unique
> + * stable UID-based bus "path". The "path" is used as part of idstr in the
> + * migration stream, making idstr unique and instance_id always 0.
> + * For migration to succeed, (idstr+instance_id) must match those generated
> + * during QEMU start. Without unique idstr, QEMU will generate variable
> + * instance_id to distinquish devices, and that instance_id can change
Typo 's/distinquish/distinguish/' (replace the Q with a G)
[...]
> + VMSTATE_BOOL(iommu_enabled, S390PCIBusDevice),
> + VMSTATE_UINT64(g_iota, S390PCIBusDevice),
> + VMSTATE_UINT64(pba, S390PCIBusDevice),
> + VMSTATE_UINT64(pal, S390PCIBusDevice),
> + VMSTATE_UINT64(max_dma_limit, S390PCIBusDevice),
As mentioned in an earlier patch, let's not migrate this value.
Since you are only migrating emulated devices for now and fencing
vfio-pci, it will always be 0. Set it to 0 unconditionally during load,
before the iommu replay.
If we enable migration of vfio-pci in the future, we would have to
acquire the new DMA limit on the target side prior to the iommu replay
for those devices (while emulated devices remain a 0).
next prev parent reply other threads:[~2026-08-24 22:36 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 17:25 [PATCH v7 00/15] s390x/pci: Implement migration for emulated devices Konstantin Shkolnyy
2026-08-18 17:25 ` [PATCH v7 01/15] s390x/pci: implement IOMMU replay Konstantin Shkolnyy
2026-08-18 17:25 ` [PATCH v7 02/15] s390x/pci: Create function to contain translation status check Konstantin Shkolnyy
2026-08-24 21:27 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 03/15] s390x/pci: Move iommu_mr from S390PCIIOMMU to S390PCIBusDevice Konstantin Shkolnyy
2026-08-24 20:50 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 04/15] s390x/pci: Move dm_mr " Konstantin Shkolnyy
2026-08-24 20:55 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 05/15] s390x/pci: Move iotlb " Konstantin Shkolnyy
2026-08-24 21:12 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 06/15] s390x/pci: Remove a ptr to S390PCIBusDevice from S390PCIIOMMU Konstantin Shkolnyy
2026-08-24 21:15 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 07/15] s390x/pci: Move/rename enabled from S390PCIIOMMU to S390PCIBusDevice Konstantin Shkolnyy
2026-08-24 21:18 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 08/15] s390x/pci: Move dma_limit " Konstantin Shkolnyy
2026-08-24 21:28 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 09/15] s390x/pci: Move g_iota " Konstantin Shkolnyy
2026-08-24 21:32 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 10/15] s390x/pci: Move pba " Konstantin Shkolnyy
2026-08-24 21:36 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 11/15] s390x/pci: Move pal " Konstantin Shkolnyy
2026-08-24 21:42 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 12/15] s390x/pci: Move max_dma_limit " Konstantin Shkolnyy
2026-08-24 21:58 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 13/15] s390x/pci: Add a comment explaining S390PCIIOMMU purpose Konstantin Shkolnyy
2026-08-24 22:00 ` Matthew Rosato
2026-08-18 17:25 ` [PATCH v7 14/15] s390x/pci: Implement migration for emulated devices Konstantin Shkolnyy
2026-08-24 22:35 ` Matthew Rosato [this message]
2026-08-18 17:25 ` [PATCH v7 15/15] s390x/pci: Create function to contain fmb_timer start Konstantin Shkolnyy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e4520f30-6176-498e-840e-a5407aa68004@linux.ibm.com \
--to=mjrosato@linux.ibm.com \
--cc=alifm@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@kernel.org \
--cc=farman@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=kshk@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.