summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorPierre Morel <pmorel@linux.ibm.com>2018-09-26 01:16:36 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2018-09-28 15:50:11 +0200
commitc9ba8c2cd210d35cdb48683db7c94f11c236d841 (patch)
tree3fd1e730838e610889124976a424aa78c566a490 /arch/s390
parentKVM: s390: vsie: allow CRYCB FORMAT-0 (diff)
downloadlinux-c9ba8c2cd210d35cdb48683db7c94f11c236d841.tar.xz
linux-c9ba8c2cd210d35cdb48683db7c94f11c236d841.zip
KVM: s390: vsie: allow guest FORMAT-0 CRYCB on host FORMAT-1
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. Signed-off-by: Pierre Morel <pmorel@linux.ibm.com> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> Message-Id: <20180925231641.4954-22-akrowiak@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kvm/vsie.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index 67a5536637bb..90ae31072991 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -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;
}