From cddded9803cd6c4f53432cc64377d34522aa11c9 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 29 May 2025 11:59:13 -0700 Subject: [PATCH 1/2] crypto: s390/sha256 - rename module to sha256-s390 When the s390 SHA-256 code is built as a loadable module, name it sha256-s390.ko instead of sha256.ko. This avoids a module name collision with crypto/sha256.ko and makes it consistent with the other architectures. We should consider making a single module provide all the SHA-256 library code, which would prevent issues like this. But for now this is the fix that's needed. Fixes: b9eac03edcf8 ("crypto: s390/sha256 - implement library instead of shash") Reported-by: Alex Williamson Closes: https://lore.kernel.org/r/20250529110526.6d2959a9.alex.williamson@redhat.com/ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu --- arch/s390/lib/crypto/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/s390/lib/crypto/Makefile b/arch/s390/lib/crypto/Makefile index 920197967f46..5df30f1e7930 100644 --- a/arch/s390/lib/crypto/Makefile +++ b/arch/s390/lib/crypto/Makefile @@ -3,4 +3,5 @@ obj-$(CONFIG_CRYPTO_CHACHA_S390) += chacha_s390.o chacha_s390-y := chacha-glue.o chacha-s390.o -obj-$(CONFIG_CRYPTO_SHA256_S390) += sha256.o +obj-$(CONFIG_CRYPTO_SHA256_S390) += sha256-s390.o +sha256-s390-y := sha256.o From b9802b54d41bbe98f673e08bc148b0c563fdc02e Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Fri, 30 May 2025 12:16:58 +0800 Subject: [PATCH 2/2] asm-generic: Add sched.h inclusion in simd.h Commit 7ba8df47810f073 ("asm-generic: Make simd.h more resilient") causes a build error for PREEMPT_RT kernels: CC lib/crypto/sha256.o In file included from ./include/asm-generic/simd.h:6, from ./arch/loongarch/include/generated/asm/simd.h:1, from ./include/crypto/internal/simd.h:9, from ./include/crypto/internal/sha2.h:6, from lib/crypto/sha256.c:15: ./include/asm-generic/simd.h: In function 'may_use_simd': ./include/linux/preempt.h:111:34: error: 'current' undeclared (first use in this function) 111 | # define softirq_count() (current->softirq_disable_cnt & SOFTIRQ_MASK) | ^~~~~~~ ./include/linux/preempt.h:112:82: note: in expansion of macro 'softirq_count' 112 | # define irq_count() ((preempt_count() & (NMI_MASK | HARDIRQ_MASK)) | softirq_count()) | ^~~~~~~~~~~~~ ./include/linux/preempt.h:143:34: note: in expansion of macro 'irq_count' 143 | #define in_interrupt() (irq_count()) | ^~~~~~~~~ ./include/asm-generic/simd.h:18:17: note: in expansion of macro 'in_interrupt' 18 | return !in_interrupt(); | ^~~~~~~~~~~~ So add sched.h inclusion in simd.h to fix it. Fixes: 7ba8df47810f073 ("asm-generic: Make simd.h more resilient") Signed-off-by: Huacai Chen Signed-off-by: Herbert Xu --- include/asm-generic/simd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/asm-generic/simd.h b/include/asm-generic/simd.h index ac29a22eb7cf..70c8716ad32a 100644 --- a/include/asm-generic/simd.h +++ b/include/asm-generic/simd.h @@ -4,6 +4,7 @@ #include #include +#include #include /*