Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5734263ybi; Wed, 12 Jun 2019 07:35:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqDdt55D6rUnYTjxIWTOIahi/Ln+oymPNUb/FnC0z7e5psIUzw/2AXjRGr3dstfmkWk7jb X-Received: by 2002:a17:90a:7f91:: with SMTP id m17mr33187995pjl.86.1560350152124; Wed, 12 Jun 2019 07:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560350152; cv=none; d=google.com; s=arc-20160816; b=IN4gs9eqZelyxAmJqmuH3tp51WX8VoK79GJqjTdSivhJbGS8gSP1LhcuQHeePJJiGu KiFSii1jqzNl+vFW822jrbV0hYjAASE9xukeRo1yGZF39HlYXRMvOCLQmup31u1vwPOP T+V767IdRx0wqMNY0Z2lqzQ3E6VXyURzC2oqcl6RQhcTBZWP9HEAahn7XeNbEjuUhiDV s97QjPJmhTLVFyrEQFfgKXqyVQypIho/GSMj5kB3AV4HJH28L2MGOlZz0HRWQt+iGY/3 J/2W4EjTKSvKt6XuyJGxiFzmLMgawX95sEnuEq1OvH6pTSjT4DZ5Mat/1nLzeRF3pPhu KX9g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Yvco2nrOz9vvfkanlZ1zBz6No8XYcQhoqJS6PFjExi4=; b=a3lrzVb58jMR05OlCW47XStH9PGwwimKJtqYO1Ba/4fLN/dnq9oB3Sgq69ei9y1uVj 6QyrjMAWdqFCj/m6OqErw7Hi0BXOKKh9QBsZy/lJckVT0gfl/LZ+0gYqkT8/63jUD8hi EEH3PhnhAEYivyYKbnZk5H1V1M4Ng/ZxKpxESnhVpgCzqM4uVTuThe9GHB3TRBkfmUal AcNWT7FC2jNkoPNxbfSB4PV7Pn3C37I4kPZmKi99dgB1QjwdaoY5cI280ZObX6rxTPXR 1/M29JPJR0HHW49TxxIRgflr0kG+1rTNFUsCOudAvwWgtT5eDH+BY0Gj7WyixHY/IKaj RRlA== 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 g9si1617954plm.207.2019.06.12.07.35.37; Wed, 12 Jun 2019 07:35:52 -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 S1732103AbfFLKW4 (ORCPT + 99 others); Wed, 12 Jun 2019 06:22:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52018 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbfFLKWy (ORCPT ); Wed, 12 Jun 2019 06:22:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C81280F79; Wed, 12 Jun 2019 10:22:54 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-159.ams2.redhat.com [10.36.116.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A4456A492; Wed, 12 Jun 2019 10:22:52 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org, David Hildenbrand , Herbert Xu , "David S. Miller" , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Harald Freudenberger , Cornelia Huck Subject: [PATCH v2 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP Date: Wed, 12 Jun 2019 12:22:45 +0200 Message-Id: <20190612102248.18903-2-david@redhat.com> In-Reply-To: <20190612102248.18903-1-david@redhat.com> References: <20190612102248.18903-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 12 Jun 2019 10:22:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(); -- 2.21.0