Skip to contentSkip to conversation

s390: vfio-ap: register matrix device with VFIO mdev framework

PATCH Halil Pasic 1 participant 1 message Jul 30, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 28 lines · Cornelia Huck
Quoted 25 lines · On Mon, 30 Jul 2018 13:24:24 +0200 Pierre Morel <[email protected]> wrote:
Quoted 19 lines · Cornelia Huck
Quoted 5 lines · On Fri, 27 Jul 2018 16:17:47 +0200 Halil Pasic <[email protected]> wrote:
Quoted 4 lines · Christian Borntraeger
(quoted diff) +0 -0
@@ -65,6 +66,21 @@ static int vfio_ap_matrix_dev_create(void)
    {
    	int ret;
 
Quoted 11 lines

Review static int vfio_ap_matrix_dev_create(void) · line 75

Quoted 7 lines
(quoted diff) +7 -0
+	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)) {

After Connie's curiosity was piqued I gave this another look. If I read the ap_qci() documentation and code correctly, it can return either 0 or -EOPNOTSUPP, but nothing else. So basically this is a dead branch.

Quoted 1 line

Can it return -EOPNOTSUPP if facility 12 is present?

I do not think it is reasonable to continue if
we stated that facility 12 is present but the ap_qci function failed.

Quoted 6 lines
Quoted 1 line

So I propose that we return an error and break the insmod.

So, would that be a bug? If yes, returning an error makes sense.

(I can't check the documentation to find out about the interaction between facility 12 and PQAP(QCI)...)

If we are in z architectural mode and facility 12 is indicated and ap_qci() returns an error code, it's because of an exception while executing the PQAP instruction. The reason can be a bad input pointer or other stuff. It is likely a bug. I'm not sure how this interacts with machine checks though. I think we should report the problem and give up.

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html