Commit 0a5f9b38 authored by Heiko Carstens's avatar Heiko Carstens Committed by Alexander Gordeev
Browse files

s390/cpufeature: rework to allow more than only hwcap bits



Rework cpufeature implementation to allow for various cpu feature
indications, which is not only limited to hwcap bits. This is achieved
by adding a sequential list of cpu feature numbers, where each of them
is mapped to an entry which indicates what this number is about.

Each entry contains a type member, which indicates what feature
name space to look into (e.g. hwcap, or cpu facility). If wanted this
allows also to automatically load modules only in e.g. z/VM
configurations.

Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarSteffen Eiden <seiden@linux.ibm.com>
Reviewed-by: default avatarClaudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
Link: https://lore.kernel.org/r/20220713125644.16121-2-seiden@linux.ibm.com


Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent 693714b9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1049,7 +1049,7 @@ static int __init aes_s390_init(void)
	return ret;
}

module_cpu_feature_match(MSA, aes_s390_init);
module_cpu_feature_match(S390_CPU_FEATURE_MSA, aes_s390_init);
module_exit(aes_s390_fini);

MODULE_ALIAS_CRYPTO("aes-all");
+1 −1
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ static void __exit chacha_mod_fini(void)
		crypto_unregister_skciphers(chacha_algs, ARRAY_SIZE(chacha_algs));
}

module_cpu_feature_match(VXRS, chacha_mod_init);
module_cpu_feature_match(S390_CPU_FEATURE_VXRS, chacha_mod_init);
module_exit(chacha_mod_fini);

MODULE_DESCRIPTION("ChaCha20 stream cipher");
+1 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ static void __exit crc_vx_mod_exit(void)
	crypto_unregister_shashes(crc32_vx_algs, ARRAY_SIZE(crc32_vx_algs));
}

module_cpu_feature_match(VXRS, crc_vx_mod_init);
module_cpu_feature_match(S390_CPU_FEATURE_VXRS, crc_vx_mod_init);
module_exit(crc_vx_mod_exit);

MODULE_AUTHOR("Hendrik Brueckner <brueckner@linux.vnet.ibm.com>");
+1 −1
Original line number Diff line number Diff line
@@ -492,7 +492,7 @@ static int __init des_s390_init(void)
	return ret;
}

module_cpu_feature_match(MSA, des_s390_init);
module_cpu_feature_match(S390_CPU_FEATURE_MSA, des_s390_init);
module_exit(des_s390_exit);

MODULE_ALIAS_CRYPTO("des");
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ static void __exit ghash_mod_exit(void)
	crypto_unregister_shash(&ghash_alg);
}

module_cpu_feature_match(MSA, ghash_mod_init);
module_cpu_feature_match(S390_CPU_FEATURE_MSA, ghash_mod_init);
module_exit(ghash_mod_exit);

MODULE_ALIAS_CRYPTO("ghash");
Loading