Re: [PATCH v7 11/15] s390/vfio-ap: Transition device migration state to STOP
From: Anthony Krowiak
Date: Wed Oct 07 2026 - 15:42:34 EST
On 8/20/26 8:43 AM, Jason J. Herne wrote:
On 8/7/26 6:18 PM, Anthony Krowiak wrote:
Typically at this point, interrupt processing for the device, DMA and other
changes to the device's external state must be prohibited. For VFIO AP,
there is no physical DMA device virtualized by the vfio-ap device . It
merely manages the guest's AP configuration that identifies the devices
passed through to the guest, but does not have access to any of them. Those
AP devices are passed through and controlled exclusively by the SIE program
SIE is an instruction, not a program. It might be clearer to say:
pass-through AP devices are controlled by the hardware.
The SIE control block is used to pass through the AP devices via the CRYCB which
I assume is processed by the SIE instruction. After that, vfio_ap has nothing to do
with the AP devices other than to handle interrupt enable/disable when the
PQAP(AQIC) instruction is intercepted. The vfio_ap driver does not manage I/O
between the guest and device memory like other devices using VFIO to pass them
through. It's sole purpose in life is to manage the AP configuration for the guest
to which an mdev is attached.
I'll make a change to this comment.
I'm not sure there is much benefit to having this as a separate patch at all. You could simply roll this into the patch where this logic is originally constructed and skip this patch entirely.
Already addressed with response to 12/15 review comment you made.
used to start the guest. There only thing to do at this point is return
NULL to the caller since the file streams and associated data will get
cleaned up as a result of the VFIO migration framework releasing the files.
Signed-off-by: Anthony Krowiak <akrowiak@xxxxxxxxxxxxx>
---
drivers/s390/crypto/vfio_ap_migration.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/crypto/vfio_ap_migration.c b/drivers/s390/crypto/vfio_ap_migration.c
index 4dd7373c3d9d..30160e3ddded 100644
--- a/drivers/s390/crypto/vfio_ap_migration.c
+++ b/drivers/s390/crypto/vfio_ap_migration.c
@@ -1511,12 +1511,17 @@ vfio_ap_transition_to_state(struct ap_matrix_mdev *matrix_mdev,
return filp;
}
+ /*
+ * Terminates the data transfer session of the vfio-ap device state
+ * between the source and target hosts. Since the vfio-ap device does
+ * not virtualize a DMA device, there is no internal device state to
+ * incorporate into the vfio-ap device on the target.
+ */
if ((cur_state == VFIO_DEVICE_STATE_RESUMING &&
new_state == VFIO_DEVICE_STATE_STOP) ||
(cur_state == VFIO_DEVICE_STATE_STOP_COPY &&
new_state == VFIO_DEVICE_STATE_STOP)) {
- /* TODO */
- return ERR_PTR(-EOPNOTSUPP);
+ return NULL;
}
if ((cur_state == VFIO_DEVICE_STATE_STOP &&