[PATCH v9 14/15] s390/vfio-ap: Add 'migratable' feature to sysfs 'features' attribute
From: Anthony Krowiak
Date: Tue Oct 13 2026 - 12:04:39 EST
Add the 'migration' feature to the features provided by the sysfs
/sys/devices/vfio_ap/matrix/feature attribute to indicate that migration
of vfio devices is supported. Since live guest migration is not supported
for SE guests, the 'migration' feature will not be included when the
feature attribute is displayed.
Signed-off-by: Anthony Krowiak <akrowiak@xxxxxxxxxxxxx>
---
drivers/s390/crypto/vfio_ap_drv.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c
index 8e69ed286bb9..c63a050a2356 100644
--- a/drivers/s390/crypto/vfio_ap_drv.c
+++ b/drivers/s390/crypto/vfio_ap_drv.c
@@ -26,9 +26,21 @@ MODULE_LICENSE("GPL v2");
struct ap_matrix_dev *matrix_dev;
debug_info_t *vfio_ap_dbf_info;
+#define VFIO_AP_BASE_FEATURES "guest_matrix hotplug ap_config"
+#define VFIO_AP_SE_EXCLUDED_FEATURES "migration"
+
static ssize_t features_show(struct device *dev, struct device_attribute *attr, char *buf)
{
- return sysfs_emit(buf, "guest_matrix hotplug ap_config\n");
+ /*
+ * SE guests do not support live guest migration; emit only the base
+ * feature set for them.
+ */
+ if (ap_is_se_guest())
+ return sysfs_emit(buf, "%s\n", VFIO_AP_BASE_FEATURES);
+
+ /* Non-SE: base features plus those not available on SE guests */
+ return sysfs_emit(buf, "%s %s\n", VFIO_AP_BASE_FEATURES,
+ VFIO_AP_SE_EXCLUDED_FEATURES);
}
static DEVICE_ATTR_RO(features);
--
2.53.0