return 0;
 }
 
-/* Copy to APCB FORMAT0 from APCB FORMAT0 */
+/**
+ * setup_apcb00 - Copy to APCB FORMAT0 from APCB FORMAT0
+ * @vcpu: pointer to the virtual CPU
+ * @apcb_s: pointer to start of apcb in the shadow crycb
+ * @apcb_o: pointer to start of original apcb in the guest2
+ * @apcb_h: pointer to start of apcb in the guest1
+ *
+ * Returns 0 and -EFAULT on error reading guest apcb
+ */
 static int setup_apcb00(struct kvm_vcpu *vcpu, unsigned long *apcb_s,
                        unsigned long apcb_o, unsigned long *apcb_h)
 {
                return setup_apcb00(vcpu, (unsigned long *) &crycb_s->apcb0,
                                    (unsigned long) &crycb->apcb0,
                                    (unsigned long *) &crycb_h->apcb0);
+       case CRYCB_FORMAT0:
+               if ((crycb_o & PAGE_MASK) != ((crycb_o + 32) & PAGE_MASK))
+                       return -EACCES;
+               if (fmt_h != CRYCB_FORMAT0)
+                       return -EINVAL;
+               return setup_apcb00(vcpu, (unsigned long *) &crycb_s->apcb0,
+                                   (unsigned long) &crycb->apcb0,
+                                   (unsigned long *) &crycb_h->apcb0);
        }
        return -EINVAL;
 }
        int ret = 0;
 
        scb_s->crycbd = 0;
-       if (!(crycbd_o & vcpu->arch.sie_block->crycbd & CRYCB_FORMAT1))
-               return 0;
 
        apie_h = vcpu->arch.sie_block->eca & ECA_APIE;
        if (!apie_h && !key_msk)