From: Randy Dunlap <rdunlap@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: "Randy Dunlap" <rdunlap@infradead.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Jens Axboe" <axboe@kernel.dk>, "Amit Shah" <amit@kernel.org>,
"Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Eli Cohen" <eli@mellanox.com>,
"Saeed Mahameed" <saeedm@nvidia.com>,
"Leon Romanovsky" <leon@kernel.org>,
"Pablo Neira Ayuso" <pablo@netfilter.org>,
"Jozsef Kadlecsik" <kadlec@netfilter.org>,
"Florian Westphal" <fw@strlen.de>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"Felipe Balbi" <felipe.balbi@linux.intel.com>,
"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
"Krzysztof Opasiak" <k.opasiak@samsung.com>,
"Igor Kotrasinski" <i.kotrasinsk@samsung.com>,
"Valentina Manea" <valentina.manea.m@gmail.com>,
"Shuah Khan" <shuah@kernel.org>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Jussi Kivilinna" <jussi.kivilinna@mbnet.fi>,
"Joachim Fritschi" <jfritschi@freenet.de>,
"Herbert Xu" <herbert@gondor.apana.org.au>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Ingo Molnar" <mingo@kernel.org>,
"Karol Herbst" <karolherbst@gmail.com>,
"Pekka Paalanen" <ppaalanen@gmail.com>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"Andy Lutomirski" <luto@kernel.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Borislav Petkov" <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org, linux-block@vger.kernel.org,
linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org,
nouveau@lists.freedesktop.org,
virtualization@lists.linux-foundation.org, x86@kernel.org
Subject: [PATCH 8/9] x86/crypto: eliminate anonymous module_init & module_exit
Date: Wed, 16 Mar 2022 12:20:09 -0700 [thread overview]
Message-ID: <20220316192010.19001-9-rdunlap@infradead.org> (raw)
In-Reply-To: <20220316192010.19001-1-rdunlap@infradead.org>
Eliminate anonymous module_init() and module_exit(), which can lead to
confusion or ambiguity when reading System.map, crashes/oops/bugs,
or an initcall_debug log.
Give each of these init and exit functions unique driver-specific
names to eliminate the anonymous names.
Example 1: (System.map)
ffffffff832fc78c t init
ffffffff832fc79e t init
ffffffff832fc8f8 t init
Example 2: (initcall_debug log)
calling init+0x0/0x12 @ 1
initcall init+0x0/0x12 returned 0 after 15 usecs
calling init+0x0/0x60 @ 1
initcall init+0x0/0x60 returned 0 after 2 usecs
calling init+0x0/0x9a @ 1
initcall init+0x0/0x9a returned 0 after 74 usecs
Fixes: 64b94ceae8c1 ("crypto: blowfish - add x86_64 assembly implementation")
Fixes: 676a38046f4f ("crypto: camellia-x86_64 - module init/exit functions should be static")
Fixes: 0b95ec56ae19 ("crypto: camellia - add assembler implementation for x86_64")
Fixes: 56d76c96a9f3 ("crypto: serpent - add AVX2/x86_64 assembler implementation of serpent cipher")
Fixes: b9f535ffe38f ("[CRYPTO] twofish: i586 assembly version")
Fixes: ff0a70fe0536 ("crypto: twofish-x86_64-3way - module init/exit functions should be static")
Fixes: 8280daad436e ("crypto: twofish - add 3-way parallel x86_64 assembler implemention")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: Joachim Fritschi <jfritschi@freenet.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Cc: x86@kernel.org
---
arch/x86/crypto/blowfish_glue.c | 8 ++++----
arch/x86/crypto/camellia_glue.c | 8 ++++----
arch/x86/crypto/serpent_avx2_glue.c | 8 ++++----
arch/x86/crypto/twofish_glue.c | 8 ++++----
arch/x86/crypto/twofish_glue_3way.c | 8 ++++----
5 files changed, 20 insertions(+), 20 deletions(-)
--- lnx-517-rc8.orig/arch/x86/crypto/blowfish_glue.c
+++ lnx-517-rc8/arch/x86/crypto/blowfish_glue.c
@@ -315,7 +315,7 @@ static int force;
module_param(force, int, 0);
MODULE_PARM_DESC(force, "Force module load, ignore CPU blacklist");
-static int __init init(void)
+static int __init blowfish_init(void)
{
int err;
@@ -339,15 +339,15 @@ static int __init init(void)
return err;
}
-static void __exit fini(void)
+static void __exit blowfish_fini(void)
{
crypto_unregister_alg(&bf_cipher_alg);
crypto_unregister_skciphers(bf_skcipher_algs,
ARRAY_SIZE(bf_skcipher_algs));
}
-module_init(init);
-module_exit(fini);
+module_init(blowfish_init);
+module_exit(blowfish_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Blowfish Cipher Algorithm, asm optimized");
--- lnx-517-rc8.orig/arch/x86/crypto/camellia_glue.c
+++ lnx-517-rc8/arch/x86/crypto/camellia_glue.c
@@ -1377,7 +1377,7 @@ static int force;
module_param(force, int, 0);
MODULE_PARM_DESC(force, "Force module load, ignore CPU blacklist");
-static int __init init(void)
+static int __init camellia_init(void)
{
int err;
@@ -1401,15 +1401,15 @@ static int __init init(void)
return err;
}
-static void __exit fini(void)
+static void __exit camellia_fini(void)
{
crypto_unregister_alg(&camellia_cipher_alg);
crypto_unregister_skciphers(camellia_skcipher_algs,
ARRAY_SIZE(camellia_skcipher_algs));
}
-module_init(init);
-module_exit(fini);
+module_init(camellia_init);
+module_exit(camellia_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Camellia Cipher Algorithm, asm optimized");
--- lnx-517-rc8.orig/arch/x86/crypto/serpent_avx2_glue.c
+++ lnx-517-rc8/arch/x86/crypto/serpent_avx2_glue.c
@@ -96,7 +96,7 @@ static struct skcipher_alg serpent_algs[
static struct simd_skcipher_alg *serpent_simd_algs[ARRAY_SIZE(serpent_algs)];
-static int __init init(void)
+static int __init serpent_avx2_init(void)
{
const char *feature_name;
@@ -115,14 +115,14 @@ static int __init init(void)
serpent_simd_algs);
}
-static void __exit fini(void)
+static void __exit serpent_avx2_fini(void)
{
simd_unregister_skciphers(serpent_algs, ARRAY_SIZE(serpent_algs),
serpent_simd_algs);
}
-module_init(init);
-module_exit(fini);
+module_init(serpent_avx2_init);
+module_exit(serpent_avx2_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Serpent Cipher Algorithm, AVX2 optimized");
--- lnx-517-rc8.orig/arch/x86/crypto/twofish_glue.c
+++ lnx-517-rc8/arch/x86/crypto/twofish_glue.c
@@ -81,18 +81,18 @@ static struct crypto_alg alg = {
}
};
-static int __init init(void)
+static int __init twofish_glue_init(void)
{
return crypto_register_alg(&alg);
}
-static void __exit fini(void)
+static void __exit twofish_glue_fini(void)
{
crypto_unregister_alg(&alg);
}
-module_init(init);
-module_exit(fini);
+module_init(twofish_glue_init);
+module_exit(twofish_glue_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION ("Twofish Cipher Algorithm, asm optimized");
--- lnx-517-rc8.orig/arch/x86/crypto/twofish_glue_3way.c
+++ lnx-517-rc8/arch/x86/crypto/twofish_glue_3way.c
@@ -140,7 +140,7 @@ static int force;
module_param(force, int, 0);
MODULE_PARM_DESC(force, "Force module load, ignore CPU blacklist");
-static int __init init(void)
+static int __init twofish_3way_init(void)
{
if (!force && is_blacklisted_cpu()) {
printk(KERN_INFO
@@ -154,13 +154,13 @@ static int __init init(void)
ARRAY_SIZE(tf_skciphers));
}
-static void __exit fini(void)
+static void __exit twofish_3way_fini(void)
{
crypto_unregister_skciphers(tf_skciphers, ARRAY_SIZE(tf_skciphers));
}
-module_init(init);
-module_exit(fini);
+module_init(twofish_3way_init);
+module_exit(twofish_3way_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Twofish Cipher Algorithm, 3-way parallel asm optimized");
next prev parent reply other threads:[~2022-03-16 19:20 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 19:20 [PATCH 0/9] treewide: eliminate anonymous module_init & module_exit Randy Dunlap
2022-03-16 19:20 ` [PATCH 1/9] virtio_blk: " Randy Dunlap
2022-03-17 3:26 ` Jason Wang
2022-03-17 8:45 ` Stefan Hajnoczi
2022-03-20 12:04 ` Michael S. Tsirkin
2022-03-16 19:20 ` [PATCH 2/9] virtio_console: " Randy Dunlap
2022-03-17 15:47 ` Amit Shah
2022-03-17 20:40 ` Randy Dunlap
2022-03-20 12:04 ` Michael S. Tsirkin
2022-03-16 19:20 ` [PATCH 3/9] net: mlx5: " Randy Dunlap
2022-03-24 18:03 ` Leon Romanovsky
2022-03-16 19:20 ` [PATCH 4/9] netfilter: h323: " Randy Dunlap
2022-03-17 3:42 ` Florian Westphal
2022-03-17 15:49 ` Pablo Neira Ayuso
2022-03-17 20:42 ` Randy Dunlap
2022-03-19 22:37 ` Pablo Neira Ayuso
2022-03-16 19:20 ` [PATCH 5/9] virtio-scsi: " Randy Dunlap
2022-03-17 3:25 ` Jason Wang
2022-03-17 8:46 ` Stefan Hajnoczi
2022-03-20 12:04 ` Michael S. Tsirkin
2022-03-30 3:51 ` Martin K. Petersen
2022-03-16 19:20 ` [PATCH 6/9] usb: gadget: " Randy Dunlap
2022-03-17 3:29 ` Ira Weiny
2022-03-17 4:59 ` Randy Dunlap
2022-03-16 19:20 ` [PATCH 7/9] usb: usbip: " Randy Dunlap
2022-03-18 22:45 ` Shuah Khan
2022-03-16 19:20 ` Randy Dunlap [this message]
2022-04-08 8:31 ` [PATCH 8/9] x86/crypto: " Herbert Xu
2022-03-16 19:20 ` [PATCH 9/9] testmmiotrace: " Randy Dunlap
2022-03-17 2:38 ` Steven Rostedt
2022-03-17 3:32 ` [PATCH 0/9] treewide: " Ira Weiny
2022-03-17 16:11 ` (subset) " Jens Axboe
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=20220316192010.19001-9-rdunlap@infradead.org \
--to=rdunlap@infradead.org \
--cc=amit@kernel.org \
--cc=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=bigeasy@linutronix.de \
--cc=bp@alien8.de \
--cc=coreteam@netfilter.org \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=eli@mellanox.com \
--cc=felipe.balbi@linux.intel.com \
--cc=fw@strlen.de \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=hpa@zytor.com \
--cc=i.kotrasinsk@samsung.com \
--cc=jasowang@redhat.com \
--cc=jejb@linux.ibm.com \
--cc=jfritschi@freenet.de \
--cc=jussi.kivilinna@mbnet.fi \
--cc=k.opasiak@samsung.com \
--cc=kadlec@netfilter.org \
--cc=karolherbst@gmail.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=luto@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mingo@kernel.org \
--cc=mirq-linux@rere.qmqm.pl \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=pablo@netfilter.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=ppaalanen@gmail.com \
--cc=rostedt@goodmis.org \
--cc=saeedm@nvidia.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=stefanha@redhat.com \
--cc=tglx@linutronix.de \
--cc=valentina.manea.m@gmail.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).