From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59900 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2408938AbfFLKjK (ORCPT ); Wed, 12 Jun 2019 06:39:10 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5CAWX2q015202 for ; Wed, 12 Jun 2019 06:39:09 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t2w9ny0qs-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 12 Jun 2019 06:39:09 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Jun 2019 11:39:07 +0100 Subject: Re: [PATCH v2 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP References: <20190612102248.18903-1-david@redhat.com> <20190612102248.18903-2-david@redhat.com> From: Harald Freudenberger Date: Wed, 12 Jun 2019 12:39:01 +0200 MIME-Version: 1.0 In-Reply-To: <20190612102248.18903-2-david@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Message-Id: <7f313d87-f9ea-e291-49e2-8da29cf41680@linux.ibm.com> Sender: linux-s390-owner@vger.kernel.org List-ID: To: David Hildenbrand , linux-kernel@vger.kernel.org Cc: linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org, Herbert Xu , "David S. Miller" , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Cornelia Huck On 12.06.19 12:22, David Hildenbrand wrote: > systemd-modules-load.service automatically tries to load the pkey module > on systems that have MSA. > > Pkey also requires the MSA3 facility and a bunch of subfunctions. > Failing with -EOPNOTSUPP makes "systemd-modules-load.service" fail on > any system that does not have all needed subfunctions. For example, > when running under QEMU TCG (but also on systems where protected keys > are disabled via the HMC). > > Let's use -ENODEV, so systemd-modules-load.service properly ignores > failing to load the pkey module because of missing HW functionality. > > Reviewed-by: Cornelia Huck > Signed-off-by: David Hildenbrand > --- > drivers/s390/crypto/pkey_api.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/s390/crypto/pkey_api.c b/drivers/s390/crypto/pkey_api.c > index 45eb0c14b880..ddfcefb47284 100644 > --- a/drivers/s390/crypto/pkey_api.c > +++ b/drivers/s390/crypto/pkey_api.c > @@ -1695,15 +1695,15 @@ static int __init pkey_init(void) > * are able to work with protected keys. > */ > if (!cpacf_query(CPACF_PCKMO, &pckmo_functions)) > - return -EOPNOTSUPP; > + return -ENODEV; > > /* check for kmc instructions available */ > if (!cpacf_query(CPACF_KMC, &kmc_functions)) > - return -EOPNOTSUPP; > + return -ENODEV; > if (!cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_128) || > !cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_192) || > !cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_256)) > - return -EOPNOTSUPP; > + return -ENODEV; > > pkey_debug_init(); > You missed one match in this file. Function pkey_clr2protkey() also does a cpacf_test_func() and may return -EOPNOTSUPP. I checked the call chain, it's save to change the returncode there also. If done, Thanks and add my reviewed-by: Harald Freudenberger