s390: vfio-ap: register matrix device with VFIO mdev framework
Quoted 30 lines · On Wed, 1 Aug 2018 17:34:26 -0400 Tony Krowiak <[email protected]> wrote:
Quoted 20 lines · Halil Pasic
Quoted 17 lines · Cornelia Huck
Quoted 14 lines · On Fri, 27 Jul 2018 13:13:40 +0200 Halil Pasic <[email protected]> wrote:
Quoted 13 lines
Review static int vfio_ap_matrix_dev_create(void) · line 74
Quoted 10 lines
(quoted diff) +6
-0@@ -65,6 +66,21 @@ static int vfio_ap_matrix_dev_create(void) { int ret; + mutex_init(&matrix_dev.lock); + INIT_LIST_HEAD(&matrix_dev.mdev_list); + + /* Test if PQAP(QCI) instruction is available */ + if (test_facility(12)) { + ret = ap_qci(&matrix_dev.info); + if (ret && (ret != -EOPNOTSUPP)) {So, is facility 12 a pre-req for PQAP(QCI)? Can the code work if matrix_dev.info is not populated?
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Yes and yes. It's basically only used in
vfio_ap_matrix_init()and it has fallbacks.Ok. So facility 12 is required but not sufficient for PQAP(QCI) to be available? (Just asking as I cannot check the doc; if it works with fallbacks I'm fine.)
I took a look at the
ap_qci()function. It returns:
Quoted 7 lines
0: success
-EOPNOTSUPP: returned when an exception occurs executing the
PQAP(QCI) instructionI conclude that if STFLE.12 is set, then the PQAP(QCI) instruction should work. If
-ENOPNOTSUPPis returned, then this would be a serious error and I think we should return an error from this function.
Sounds reasonable to me.
Quoted 10 lines
Quoted 6 lines
Quoted 2 lines
AFAIR it should be sufficient in our case. My guess is that the non 0 return code stands for program exceptions that are not related to the availability of QCI.