Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3839534ybi; Mon, 3 Jun 2019 00:50:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzP7YaT6A3PEiAuya8JjLs0MlWx0L9tSAYC+QaIULKJzwrlS1z45cqGaHhDGJmOzlVBgnOM X-Received: by 2002:a17:902:2aa6:: with SMTP id j35mr28881300plb.189.1559548220273; Mon, 03 Jun 2019 00:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559548220; cv=none; d=google.com; s=arc-20160816; b=MJh6BD9ev/Pe4PODpZnA2FvmwD1pFdIknbkx54mfWzT7MdD3hTlxBe0DziNGqzCDtt cPZJLUw0Q8/jyi/DlutsOv0GXcw8P2bINbzCusblzCBUkx7YVTvWj7VtdCJnwlwBRnLl MN04YNDvz5nLSbEGby+9tAbtlXf0prXu7zChunsX54L4kej3LCwqLgU1S0k66/NbtvfX JyfO+7E8gLWPkWnqUUKsVJIVLyvedIeZImehuxkz80JD42YsfZ3uv0vhqaPEbQustuN3 dYeZ4hN6fE9zEDzYp9m0GwesCrAziTRe4DBS6O9MlUA8crTj5T+tA3YT7jjcUWo9m6U3 aY/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject; bh=VVlTPNUALYZ02siBsr646J+gk3w0aILsZcgMsIbxRkE=; b=plhqeUZPwHrvOkem2xAEQXIjR3fTzJuWGAyXAap4LgWsTf3IbhTlofVBX07Aq/TnDa I/T+mQC4BcwMtVCoUw0OCrQLtaOkuseXuZlTAIs9VDW+7XEiE78JMJ13/FzvUuYRpPpj RnkvUDC40URZ9IwZ8c3stZLT+zDUnRym62X9SnA4IiEEgdh5BaxzdDGR/p3ABtwrT1m1 b5MzIweCKugSSjZuKirAPRNMgqz3fTFYCqJhj+YfyGm/UUVWWpavf+bNae3tUAQBrB0V Z7EgQJWxpha0X/7mFe2+CgupKeRoRB5lLKWuPGIyX3+fMctFiwhTvomI9U2r3mxZDU65 pcwg== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f64si18522596plf.128.2019.06.03.00.50.03; Mon, 03 Jun 2019 00:50:20 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726826AbfFCHs6 (ORCPT + 99 others); Mon, 3 Jun 2019 03:48:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52126 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725856AbfFCHs5 (ORCPT ); Mon, 3 Jun 2019 03:48:57 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x537lS3Y082605 for ; Mon, 3 Jun 2019 03:48:56 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2svx2vucn9-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 03 Jun 2019 03:48:56 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Jun 2019 08:48:54 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 3 Jun 2019 08:48:52 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x537mpGK18481326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Jun 2019 07:48:51 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 18ACA4203F; Mon, 3 Jun 2019 07:48:51 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CAE7B42042; Mon, 3 Jun 2019 07:48:50 +0000 (GMT) Received: from [10.0.2.15] (unknown [9.152.224.114]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 3 Jun 2019 07:48:50 +0000 (GMT) Subject: Re: [PATCH v1] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP To: David Hildenbrand , linux-s390@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Heiko Carstens , Cornelia Huck , Christian Borntraeger References: <20190531093628.14766-1-david@redhat.com> From: Harald Freudenberger Date: Mon, 3 Jun 2019 09:48:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190531093628.14766-1-david@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 19060307-0008-0000-0000-000002ED3534 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19060307-0009-0000-0000-0000225A131F Message-Id: <3dfea8fd-dbe7-f9d0-f7a7-2c65349c0a81@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-03_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906030058 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31.05.19 11:36, 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. > > Cc: Harald Freudenberger > Cc: Heiko Carstens > Cc: Cornelia Huck > Cc: Christian Borntraeger > 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(); > I can't really agree to this: there are a lot more modules returning EOPNOTSUPP, for example have a look into the arch/s390/crypto subdirectory. The ghash_s390 module also registers for MSA feature and also returns EOPNOTSUPPORTED when the required hardware extension is not available. Same with the prng kernel module, sha1_s390, sha256_s390 and I assume there is a bunch of other kernel modules with same behavior. I would prefer having this fixed on the systemd-modules-load.service side. regards Harald Freudenberger