Received: by 10.213.65.68 with SMTP id h4csp3406745imn; Tue, 3 Apr 2018 04:31:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/SAJKSL2LtK6xttwW6qm8QgN7CMKdHs11pUuUVJ7DIhYphe+kGIall4JWn76d5ZrSool2v X-Received: by 2002:a17:902:bd91:: with SMTP id q17-v6mr11930026pls.330.1522755064118; Tue, 03 Apr 2018 04:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522755064; cv=none; d=google.com; s=arc-20160816; b=tIQjBiE2l5jGP6WZPO7bzSQmbyhr5bHlLt3FJFTjRvPIr06i+x5ja7FDVt/FT5h3rB /8zXuYJ3p9UPOjiqVa1g06mRHLqu9oANVwRCpX0jw0q15eEvSSIAbaN3k/6Va9jd0FjC s8RNw3L9I+L1hUKxPX2UFBguZ2vy/SjDmX3BEK4PJYTreWW/CxwK22n29IV7G7gtAB1U PZV9cj/ZZrkjLp2to2ZdBcXRylNT5nSNKwRNzwc9LuzSCz87lWVckUZh52lrwXhTFOSB VKJTjbKLQDiAN+EG/TwkfMQ076sIyRxtvRuB1uX1Vu9qXQvGXWNUP6oanXZv09vi35mU AgMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=DloaZ242ZUW+6Cmeyzzz+KiRT5RiX90akxy2rgwYwbg=; b=Ku0mkuLZwMvFAyq0O9XWFeJ4RQub1UJGwL4lnvW0O/ha9mmVNmj8qKs+buwFFcIEef 0lxpRxmir9PIvkvkyABtraSr5/rDzy38BaEwelA/DFBlAUQWL1bgX85QMPCGcoBiKGAG gTfSn96celdtD13sJUVtWwxppmOk/AoCg80mgSVgooMhwBKpoxnRU0MMBz4OUM1fMFdn yUuaBK54rkPnFjRFiWbdgmRf3RG0DCo+ueHwPlzDV15PqMHRZuxZU/Er/DIhp42RRhgb SJauxWGwfjrVR+Nr6az668QPjOB7aQLj8/DmZixRZh2cDvbRMJMLSzpbubK/hz5ee4Xc 1Ofw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g66si416383pgc.624.2018.04.03.04.30.18; Tue, 03 Apr 2018 04:31:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932119AbeDCL0K (ORCPT + 99 others); Tue, 3 Apr 2018 07:26:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46884 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932082AbeDCL0I (ORCPT ); Tue, 3 Apr 2018 07:26:08 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF7E78182D06; Tue, 3 Apr 2018 11:26:07 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFE05215CDAF; Tue, 3 Apr 2018 11:26:04 +0000 (UTC) Date: Tue, 3 Apr 2018 13:26:02 +0200 From: Cornelia Huck To: Tony Krowiak Cc: Pierre Morel , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, freude@de.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.com, kwankhede@nvidia.com, bjsdjshi@linux.vnet.ibm.com, pbonzini@redhat.com, alex.williamson@redhat.com, alifm@linux.vnet.ibm.com, mjrosato@linux.vnet.ibm.com, jjherne@linux.vnet.ibm.com, thuth@redhat.com, pasic@linux.vnet.ibm.com, berrange@redhat.com, fiuczy@linux.vnet.ibm.com, buendgen@de.ibm.com Subject: Re: [PATCH v3 01/14] KVM: s390: refactor crypto initialization Message-ID: <20180403132602.34972959.cohuck@redhat.com> In-Reply-To: <5c659a5e-1933-366b-65fc-6e9eabe504d5@linux.vnet.ibm.com> References: <1521051954-25715-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1521051954-25715-2-git-send-email-akrowiak@linux.vnet.ibm.com> <3227b02e-4a16-295d-9a01-043702cf149d@linux.vnet.ibm.com> <20180326104455.7773be7b.cohuck@redhat.com> <5c659a5e-1933-366b-65fc-6e9eabe504d5@linux.vnet.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 11:26:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 11:26:07 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Mar 2018 14:57:22 -0400 Tony Krowiak wrote: > On 03/26/2018 04:44 AM, Cornelia Huck wrote: > > On Thu, 15 Mar 2018 15:55:39 +0100 > > Pierre Morel wrote: > > > >> On 15/03/2018 15:48, Tony Krowiak wrote: > >>> On 03/15/2018 08:26 AM, Pierre Morel wrote: > >>>> On 14/03/2018 19:25, Tony Krowiak wrote: > >>>>> diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig > >>>>> index a3dbd45..4ca9077 100644 > >>>>> --- a/arch/s390/kvm/Kconfig > >>>>> +++ b/arch/s390/kvm/Kconfig > >>>>> @@ -33,6 +33,7 @@ config KVM > >>>>> select HAVE_KVM_INVALID_WAKEUPS > >>>>> select SRCU > >>>>> select KVM_VFIO > >>>>> + select ZCRYPT > >>>> I do not think it is a good solution to *always* enable ZCRYPT > >>>> when we have KVM. > >>> If CONFIG_ZCRYPT is not selected, then the kvm_ap_apxa_installed() > >>> function will not compile > >>> because it calls a zcrypt interface. How would you suggest we make > >>> sure zcrypt interfaces > >>> used in KVM are built if CONFIG_ZCRYPT is not selected? > >> if zcrypt is not configured, I suppose that the KVM code initializaing CRYCB > >> has no use but the function will be called from KVM. > >> So I would do something like: > >> > >> #ifdef ZCRYPT > >> external definitions. > >> #else > >> stubs returning error -ENOZCRYPT (or whatever) > >> #endif > > The kvm code used some kind of detection for crycb before (IIRC it was > > for the key-wrapping stuff). I assume that usage is independent of > > zcrypt driver usage in the host? > A function in kvm-s390.c was replaced with a call to the function in > ap_bus.c that was externalized in patch 2/14. This was done to remove > duplicate code. Since zcrypt is built into the kernel, I didn't think > it would be a problem, but apparently because of the way zcrypt is > configured, it is still possible to remove it from the kernel build. Yes. > > > > So, I think that apxa detection function should be used to s390 > > architecture base code and not be conditional on anything. > I am convinced that the original function from kvm_s390.c should be > restored. That would work as well, but removing the code duplication via moving to s390 architecture code should not be that bad, either. Leaving the decision to the respective maintainers.