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 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 --- 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 7a9a8f63a76d..21cd9810a18c 100644 --- a/drivers/s390/crypto/vfio_ap_migration.c +++ b/drivers/s390/crypto/vfio_ap_migration.c @@ -1304,12 +1304,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 && -- 2.53.0