KVM: s390/cpacf: Enable key wrapping by default
authorTony Krowiak <akrowiak@linux.vnet.ibm.com>
Tue, 24 Feb 2015 19:06:57 +0000 (14:06 -0500)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 3 Mar 2015 11:08:13 +0000 (12:08 +0100)
z/VM and LPAR enable key wrapping by default, lets do the same on KVM.

Signed-off-by: Tony Krowiak <akrowiak@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/kvm-s390.c

index 0c362392756310e1ce0e2da8e35c6bedb5cf0849..b4d2030c22eb6ec93a2b238b69dfad451d465377 100644 (file)
@@ -839,9 +839,13 @@ static int kvm_s390_crypto_init(struct kvm *kvm)
 
        kvm_s390_set_crycb_format(kvm);
 
-       /* Disable AES/DEA protected key functions by default */
-       kvm->arch.crypto.aes_kw = 0;
-       kvm->arch.crypto.dea_kw = 0;
+       /* Enable AES/DEA protected key functions by default */
+       kvm->arch.crypto.aes_kw = 1;
+       kvm->arch.crypto.dea_kw = 1;
+       get_random_bytes(kvm->arch.crypto.crycb->aes_wrapping_key_mask,
+                        sizeof(kvm->arch.crypto.crycb->aes_wrapping_key_mask));
+       get_random_bytes(kvm->arch.crypto.crycb->dea_wrapping_key_mask,
+                        sizeof(kvm->arch.crypto.crycb->dea_wrapping_key_mask));
 
        return 0;
 }