[PATCH v1 04/24] s390/vfio-ap: Add header file for xfer of vfio device caps to userspace

Anthony Krowiak
2026-03-25T21:02:07Z

Adds the vfio_ap.h file used to transfer vfio device capabilities to
userspace in response to the VFIO_DEVICE_GET_INFO ioctl. The device
capabilities includes an object specifying the vfio device attributes.
This object contains a flag indicating whether the vfio device is
migratable.

Note: The migratable flag could have been returned as a capability
unto itself, but returning it as one attribute of a set of
attributes allows for this capability to easily be extended
to include additional attributes in the future if need be.

Signed-off-by: Anthony Krowiak <akrowiak@linux.ibm.com>
---
include/uapi/linux/vfio_ap.h | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 include/uapi/linux/vfio_ap.h

diff --git a/include/uapi/linux/vfio_ap.h b/include/uapi/linux/vfio_ap.h
new file mode 100644
index 000000000000..9ee14f8649ed
--- /dev/null
+++ b/include/uapi/linux/vfio_ap.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+ * Interfaces for vfio-ap
+ *
+ * Copyright IBM Corp. 2025
+ *
+ * Author(s): Anthony Krowiak <akrowiak@linux.ibm.com>
+ */
+
+#ifndef INCLUDE_UAPI_LINUX_VFIO_AP_H_
+#define INCLUDE_UAPI_LINUX_VFIO_AP_H_
+
+#include <linux/types.h>
+#include <linux/vfio.h>
+
+#define VFIO_DEVINFO_CAP_AP_ATTRS_VERSION 1
+#define VFIO_DEVINFO_CAP_AP_ATTRS_ID 1
+
+/**
+ * struct vfio_device_info_cap_ap_attrs - vfio device capability object used
+ * supply the device attributes to
+ * userspace.
+ *
+ * @header: the header used to extend the struct vfio_device_info object
+ * to provide the vfio device attributes to userspace
+ * @migratable: indicates whether the vfio device is migratable (1) or
+ * not (0).
+ */
+struct vfio_device_info_cap_ap_attrs {
+ struct vfio_info_cap_header header;
+ int migratable;
+};
+
+#endif /* INCLUDE_UAPI_LINUX_VFIO_AP_H_ */
--
2.52.0