public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harald Freudenberger <freude@linux.ibm.com>
To: David Hildenbrand <david@redhat.com>, linux-kernel@vger.kernel.org
Cc: linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>
Subject: Re: [PATCH v2 1/4] s390/pkey: Use -ENODEV instead of -EOPNOTSUPP
Date: Wed, 12 Jun 2019 12:39:01 +0200	[thread overview]
Message-ID: <7f313d87-f9ea-e291-49e2-8da29cf41680@linux.ibm.com> (raw)
In-Reply-To: <20190612102248.18903-2-david@redhat.com>

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 <cohuck@redhat.com>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  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 <freude@linux.ibm.com>


  reply	other threads:[~2019-06-12 10:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 10:22 [PATCH v2 0/4] s390/crypto: Use -ENODEV instead of -EOPNOTSUPP David Hildenbrand
2019-06-12 10:22 ` [PATCH v2 1/4] s390/pkey: " David Hildenbrand
2019-06-12 10:39   ` Harald Freudenberger [this message]
2019-06-12 10:41     ` David Hildenbrand
2019-06-12 11:07       ` Harald Freudenberger
2019-06-12 11:08         ` David Hildenbrand
2019-06-12 10:22 ` [PATCH v2 2/4] s390/crypto: ghash: " David Hildenbrand
2019-06-12 10:31   ` Harald Freudenberger
2019-06-12 10:32   ` Cornelia Huck
2019-06-12 10:22 ` [PATCH v2 3/4] s390/crypto: prng: " David Hildenbrand
2019-06-12 10:31   ` Harald Freudenberger
2019-06-12 10:35   ` Cornelia Huck
2019-06-12 10:22 ` [PATCH v2 4/4] s390/crypto: sha: " David Hildenbrand
2019-06-12 10:30   ` Harald Freudenberger
2019-06-12 10:37   ` Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f313d87-f9ea-e291-49e2-8da29cf41680@linux.ibm.com \
    --to=freude@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=davem@davemloft.net \
    --cc=david@redhat.com \
    --cc=gor@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox