s390/vfio-ap: Driver feature advertisement
Jason J. Herne
maintainerPATCH 1/1 s390/vfio-ap: Driver feature advertisement
Advertise features of the driver for the benefit of automated tooling like Libvirt and mdevctl.
--- Documentation/arch/s390/vfio-ap.rst | 34 +++++++++++++++++++++++++++++ drivers/s390/crypto/vfio_ap_drv.c | 13 +++++++++++ 2 files changed, 47 insertions(+)
Documentation/arch/s390/vfio-ap.rst +34 -0
@@ -999,6 +999,40 @@ the vfio_ap mediated device to which it is assigned as long as each new APQN resulting from plugging it in references a queue device bound to the vfio_ap device driver. +Driver Features +=============== +The vfio_ap driver exposes a sysfs file containing supported features. +This exists so third party tools (like Libvirt and mdevctl) can query the +availability of specific features. + +The features list can be found here: /sys/bus/matrix/devices/matrix/features + +Entries are \n delimited. Each entry contains a key value pair. The key is made +up of a combination of alphanumeric and underscore characters. The separator +consists of a space, a colon and then another space. The value consists of +alphanumeric, space, and underscore characters. + +Example: +cat /sys/bus/matrix/devices/matrix/features +flags : guest_matrix dyn ap_config + +Presently only a single field named flags is defined. It is meant to advertise a +list of features the driver provides. The flags fields advertises the following +features: + +---------------+---------------------------------------------------------------+ +| Flag | Description | ++==============+===============================================================+ +| guest_matrix | guest_matrix attribute exists. It reports the matrix of | +| | adapters and domains that are or will be passed through to a | +| | guest when the mdev is attached to it. | ++--------------+---------------------------------------------------------------+ +| hotplug | Indicates hot plug/unplug of AP adapters, domains and control | +| | domains for a guest to which the mdev is attached. | ++------------+-----------------------------------------------------------------+ +| ap_config | ap_config interface for one-shot modifications to mdev config | ++--------------+---------------------------------------------------------------+ + Limitations =========== Live guest migration is not supported for guests using AP devices without
drivers/s390/crypto/vfio_ap_drv.c +13 -0
@@ -26,6 +26,18 @@ MODULE_LICENSE("GPL v2");struct ap_matrix_dev *matrix_dev;debug_info_t *vfio_ap_dbf_info; +static ssize_t features_show (struct device *dev,struct device_attribute *attr,char *buf) +{ +return sprintf (buf,"flags : guest_matrix hotplug ap_config\n" ); +} +static DEVICE_ATTR_RO (features); + +static struct attribute *matrix_dev_attrs[] = { + &dev_attr_features.attr, +NULL , +}; +ATTRIBUTE_GROUPS (matrix_dev); +/* Only type 10 adapters (CEX4 and later) are supported * by the AP matrix device driver */
@@ -68,6 +80,7 @@ static struct device_driver matrix_driver = { .name = "vfio_ap", .bus = &matrix_bus, .suppress_bind_attrs = true, + .dev_groups = matrix_dev_groups, };static int vfio_ap_matrix_dev_create (void )
Signature · 1 line
2.46.0
Heiko Carstens
maintainerQuoted 9 lines · Jason J. Herne
Advertise features of the driver for the benefit of automated tooling like Libvirt and mdevctl.
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Anthony Krowiak <[email protected]>--- Documentation/arch/s390/vfio-ap.rst | 34 +++++++++++++++++++++++++++++ drivers/s390/crypto/vfio_ap_drv.c | 13 +++++++++++ 2 files changed, 47 insertions(+)
Via which tree should this go upstream?
Jason J. Herne
maintainerQuoted 4 lines · Heiko Carstens
Quoted 3 lines · Jason J. Herne
Advertise features of the driver for the benefit of automated tooling like Libvirt and mdevctl.
Quoted 9 lines
Quoted 6 lines
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Anthony Krowiak <[email protected]>--- Documentation/arch/s390/vfio-ap.rst | 34 +++++++++++++++++++++++++++++ drivers/s390/crypto/vfio_ap_drv.c | 13 +++++++++++ 2 files changed, 47 insertions(+)Via which tree should this go upstream?
I'm not 100% sure. Would s390 next be appropriate?
Heiko Carstens
maintainerQuoted 12 lines · Jason J. Herne
Quoted 11 lines · Heiko Carstens
Quoted 9 lines · Jason J. Herne
Advertise features of the driver for the benefit of automated tooling like Libvirt and mdevctl.
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Anthony Krowiak <[email protected]>--- Documentation/arch/s390/vfio-ap.rst | 34 +++++++++++++++++++++++++++++ drivers/s390/crypto/vfio_ap_drv.c | 13 +++++++++++ 2 files changed, 47 insertions(+)
Quoted 3 lines
Quoted 2 lines
Via which tree should this go upstream?
I'm not 100% sure. Would s390 next be appropriate?
Well that's up to you to decide; no objection from my side.
FWIW it would be helpful if for future patches there would be a statement in the cover-letter how this should go upstream. Also looking at the "To" list of your patch I don't think anybody would feel like there is a todo :)
That said, you still need to send a v2 which replaces sprintf() with sysfs_emit().
Am 09.09.24 um 14:41 schrieb Heiko Carstens:
Quoted 13 lines · Jason J. Herne
Quoted 12 lines · Heiko Carstens
Quoted 11 lines · Jason J. Herne
Quoted 9 lines
Advertise features of the driver for the benefit of automated tooling like Libvirt and mdevctl.
Signed-off-by Jason J. Herne <[email protected]>Reviewed-by Anthony Krowiak <[email protected]>--- Documentation/arch/s390/vfio-ap.rst | 34 +++++++++++++++++++++++++++++ drivers/s390/crypto/vfio_ap_drv.c | 13 +++++++++++ 2 files changed, 47 insertions(+)
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
Via which tree should this go upstream?
I'm not 100% sure. Would s390 next be appropriate?
Well that's up to you to decide; no objection from my side.
I think as long as we do not touch vfio internals (then we need to talk to Alex) or kvm internals the s390 tree is a good default tree for vfio-ap, so lets do that here.