Commit 58443b67 authored by David Hildenbrand's avatar David Hildenbrand Committed by Heiko Carstens

s390/pkey: Use -ENODEV instead of -EOPNOTSUPP

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.

While at it, also convert the -EOPNOTSUPP in pkey_clr2protkey() to -ENODEV.
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Reviewed-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 2980ba6a
...@@ -690,7 +690,7 @@ int pkey_clr2protkey(u32 keytype, ...@@ -690,7 +690,7 @@ int pkey_clr2protkey(u32 keytype,
*/ */
if (!cpacf_test_func(&pckmo_functions, fc)) { if (!cpacf_test_func(&pckmo_functions, fc)) {
DEBUG_ERR("%s pckmo functions not available\n", __func__); DEBUG_ERR("%s pckmo functions not available\n", __func__);
return -EOPNOTSUPP; return -ENODEV;
} }
/* prepare param block */ /* prepare param block */
...@@ -1695,15 +1695,15 @@ static int __init pkey_init(void) ...@@ -1695,15 +1695,15 @@ static int __init pkey_init(void)
* are able to work with protected keys. * are able to work with protected keys.
*/ */
if (!cpacf_query(CPACF_PCKMO, &pckmo_functions)) if (!cpacf_query(CPACF_PCKMO, &pckmo_functions))
return -EOPNOTSUPP; return -ENODEV;
/* check for kmc instructions available */ /* check for kmc instructions available */
if (!cpacf_query(CPACF_KMC, &kmc_functions)) if (!cpacf_query(CPACF_KMC, &kmc_functions))
return -EOPNOTSUPP; return -ENODEV;
if (!cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_128) || 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_192) ||
!cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_256)) !cpacf_test_func(&kmc_functions, CPACF_KMC_PAES_256))
return -EOPNOTSUPP; return -ENODEV;
pkey_debug_init(); pkey_debug_init();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment