From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH 4/7] KVM: s390/CPACF: Choose crypto control block format Date: Wed, 04 Feb 2015 14:05:32 +0100 Message-ID: <54D2191C.9000604@de.ibm.com> References: <1423043092-34044-1-git-send-email-borntraeger@de.ibm.com> <1423043092-34044-5-git-send-email-borntraeger@de.ibm.com> <54D217F8.5050302@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: KVM , Cornelia Huck , Jens Freimann , linux-s390 , Alexander Graf , Tony Krowiak To: Paolo Bonzini Return-path: Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:55379 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965485AbbBDNFh (ORCPT ); Wed, 4 Feb 2015 08:05:37 -0500 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Feb 2015 13:05:35 -0000 In-Reply-To: <54D217F8.5050302@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 04.02.2015 um 14:00 schrieb Paolo Bonzini: > > > On 04/02/2015 10:44, Christian Borntraeger wrote: >> +static void kvm_s390_set_crycb_format(struct kvm *kvm) >> +{ >> + kvm->arch.crypto.crycbd = (__u32)(unsigned long) kvm->arch.crypto.crycb; >> + >> + if (kvm_s390_apxa_installed()) >> + kvm->arch.crypto.crycbd |= CRYCB_FORMAT2; >> + else >> + kvm->arch.crypto.crycbd |= CRYCB_FORMAT1; >> +} >> + >> static int kvm_s390_crypto_init(struct kvm *kvm) >> { >> if (!test_vfacility(76)) >> @@ -663,8 +709,7 @@ static int kvm_s390_crypto_init(struct kvm *kvm) >> if (!kvm->arch.crypto.crycb) >> return -ENOMEM; >> >> - kvm->arch.crypto.crycbd = (__u32) (unsigned long) kvm->arch.crypto.crycb | >> - CRYCB_FORMAT1; >> + kvm_s390_set_crycb_format(kvm); > > Could this also be part of the "things" that KVM can choose to enable, > even though it's not a facility? Can you re-ask that question? Not sure what you want to know. This is mostly a fixup for z13, which wants to have a bigger control block. but this block is not guest visible. Talking about key wrapping, this is actually masked via a facility bit (for MSA-3 and MSA-4), therefore we have the test_vfacility thing in that function. Christian