Skip to content

Commit 6cc571b

Browse files
Pierre Morelborntraeger
authored andcommitted
KVM: s390: Clear Crypto Control Block when using vSIE
When we clear the Crypto Control Block (CRYCB) used by a guest level 2, the vSIE shadow CRYCB for guest level 3 must be updated before the guest uses it. We achieve this by using the KVM_REQ_VSIE_RESTART synchronous request for each vCPU belonging to the guest to force the reload of the shadow CRYCB before rerunning the guest level 3. Signed-off-by: Pierre Morel <pmorel@linux.ibm.com> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> Message-Id: <20180925231641.4954-16-akrowiak@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
1 parent cd8a377 commit 6cc571b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/s390/kvm/kvm-s390.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,8 @@ void kvm_arch_crypto_clear_masks(struct kvm *kvm)
20432043
memset(&kvm->arch.crypto.crycb->apcb1, 0,
20442044
sizeof(kvm->arch.crypto.crycb->apcb1));
20452045

2046+
/* recreate the shadow crycb for each vcpu */
2047+
kvm_s390_sync_request_broadcast(kvm, KVM_REQ_VSIE_RESTART);
20462048
kvm_s390_vcpu_unblock_all(kvm);
20472049
mutex_unlock(&kvm->lock);
20482050
}

0 commit comments

Comments
 (0)