On 02.12.21 08:13, Thomas Huth wrote:
On 01/12/2021 18.10, Harald Freudenberger wrote:Yes, of course for the automatic module load works this way. But you understand that now
On 01.12.21 15:11, Thomas Huth wrote:Yes, I've tested it. Without the patch, the vfio_ap module does not get loaded automatically if a crypto card is available. With the patch applied, the vfio_ap module correctly gets loaded automatically on my system (similar to the vfio_ccw module).
The crypto devices that we can use with the vfio_ap module are sittingHello Thomas, interesting.
on the "ap" bus, not on the "vfio_ap" bus that the module defines
itself. With this change, the vfio_ap module now gets automatically
loaded if a supported crypto adapter is available in the host.
Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
---
Note: Marked as "RFC" since I'm not 100% sure about it ...
please review carefully!
drivers/s390/crypto/vfio_ap_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c
index 4d2556bc7fe5..5580e40608a4 100644
--- a/drivers/s390/crypto/vfio_ap_drv.c
+++ b/drivers/s390/crypto/vfio_ap_drv.c
@@ -39,7 +39,7 @@ static struct ap_device_id ap_queue_ids[] = {
{ /* end of sibling */ },
};
-MODULE_DEVICE_TABLE(vfio_ap, ap_queue_ids);
+MODULE_DEVICE_TABLE(ap, ap_queue_ids);
/**
* vfio_ap_queue_dev_probe:
Did you test this ? I mean did you build a kernel and have it run on a s390 with crypto cards available ?
My strong feeling is that this will make the AP bus code stumble as the code silently assumes there are exactThis is only about getting the module loaded automatically once such a device is available ... AFAIK it does not grab any of the devices automatically, so there shouldn't be any problems?
two types of ap devices attached to the ap bus: ap cards and ap queues.
Thomas
the vfio devices are childs of the ap bus and thus are siblings of the ap queue and ap card
devices. As I wrote the ap bus code is not prepared to deal with a 3th type of devices
dangling on the ap bus. So you should test what happens when there are real vfio ap devices
in use together with 'regular' ap card and queue devices.
However, I am still not sure if it is preferable to have the vfio ap module loaded automatically. The majority
of customers will never use vfio ap devices - this is specific to kvm hosts only. I think this has to be
decided by Tony and maybe some kvm architect. If there is an agreement, I will try to rework the
ap code to be able to deal with foreign devices attached to the ap bus.
So thanks for your investigations. Let's wait for Tony and see how we proceed.
Harald
Harald