Skip to contentSkip to conversation

KVM: s390: vsie: allow guest FORMAT-0 CRYCB on host FORMAT-1

GIT PULL Christian Borntraeger 1 participant 1 message Oct 2, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

From: Pierre Morel <[email protected]>

When the guest schedules a SIE with a FORMAT-0 CRYCB, we are able to schedule it in the host with a FORMAT-1 CRYCB if the host uses FORMAT-1 or FORMAT-0.

Message-Id: <[email protected]>

---
 arch/s390/kvm/vsie.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
arch/s390/kvm/vsie.c +10 -4
index 67a5536637bb..90ae31072991 100644
@@ -220,11 +220,17 @@ static int setup_apcb(struct kvm_vcpu *vcpu, struct kvm_s390_crypto_cb *crycb_s,
 	case CRYCB_FORMAT0:
 		if ((crycb_o & PAGE_MASK) != ((crycb_o + 32) & PAGE_MASK))
 			return -EACCES;
-		if (fmt_h != CRYCB_FORMAT0)
+
+		switch (fmt_h) {
+		case CRYCB_FORMAT2:
 			return -EINVAL;
-		return setup_apcb00(vcpu, (unsigned long *) &crycb_s->apcb0,
-				    (unsigned long) &crycb->apcb0,
-				    (unsigned long *) &crycb_h->apcb0);
+		case CRYCB_FORMAT1:
+		case CRYCB_FORMAT0:
+			return setup_apcb00(vcpu,
+					    (unsigned long *) &crycb_s->apcb0,
+					    (unsigned long) &crycb->apcb0,
+					    (unsigned long *) &crycb_h->apcb0);
+		}
 	}
 	return -EINVAL;
 }
Signature · 1 line
2.17.0