* [PATCH] lib/crc: re-disable optimized CRC code on user-mode Linux
@ 2025-06-12 5:45 Eric Biggers
2025-06-13 18:41 ` Eric Biggers
0 siblings, 1 reply; 2+ messages in thread
From: Eric Biggers @ 2025-06-12 5:45 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-crypto, Ard Biesheuvel, Jason A . Donenfeld , x86
From: Eric Biggers <ebiggers@google.com>
The reorganization of lib/crc/ unintentionally enabled the x86-optimized
CRC64 code on user-mode Linux. (It's enabled when CONFIG_X86_64, which
is set by arch/x86/um/Kconfig. Note that this is a different option
from the "normal" CONFIG_X86_64 which is defined in arch/x86/Kconfig.)
Since this is not being taken into account, a build error results:
CC lib/crc/crc64-main.o
cc1: error: ./lib/crc/um: No such file or directory [-Werror=missing-include-dirs]
lib/crc/crc64-main.c:58:10: fatal error: crc64.h: No such file or directory
58 | #include "crc64.h" /* $(SRCARCH)/crc64.h */
| ^~~~~~~~~
compilation terminated.
cc1: all warnings being treated as errors
Fix this by re-disabling the optimized CRC code on user-mode Linux.
Fixes: e2fd1883971d ("lib/crc: prepare for arch-optimized code in subdirs of lib/crc/")
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
lib/crc/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/crc/Kconfig b/lib/crc/Kconfig
index 5858b3acc6630..70e7a6016de32 100644
--- a/lib/crc/Kconfig
+++ b/lib/crc/Kconfig
@@ -85,10 +85,11 @@ config CRC64_ARCH
default y if RISCV && RISCV_ISA_ZBC && 64BIT
default y if X86_64
config CRC_OPTIMIZATIONS
bool "Enable optimized CRC implementations" if EXPERT
+ depends on !UML
default y
help
Disabling this option reduces code size slightly by disabling the
architecture-optimized implementations of any CRC variants that are
enabled. CRC checksumming performance may get much slower.
base-commit: 7234baeec076d4c2ac05d160ed8cdb2f2d033069
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lib/crc: re-disable optimized CRC code on user-mode Linux
2025-06-12 5:45 [PATCH] lib/crc: re-disable optimized CRC code on user-mode Linux Eric Biggers
@ 2025-06-13 18:41 ` Eric Biggers
0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2025-06-13 18:41 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-crypto, Ard Biesheuvel, Jason A . Donenfeld , x86
On Wed, Jun 11, 2025 at 10:45:14PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> The reorganization of lib/crc/ unintentionally enabled the x86-optimized
> CRC64 code on user-mode Linux. (It's enabled when CONFIG_X86_64, which
> is set by arch/x86/um/Kconfig. Note that this is a different option
> from the "normal" CONFIG_X86_64 which is defined in arch/x86/Kconfig.)
> Since this is not being taken into account, a build error results:
>
> CC lib/crc/crc64-main.o
> cc1: error: ./lib/crc/um: No such file or directory [-Werror=missing-include-dirs]
> lib/crc/crc64-main.c:58:10: fatal error: crc64.h: No such file or directory
> 58 | #include "crc64.h" /* $(SRCARCH)/crc64.h */
> | ^~~~~~~~~
> compilation terminated.
> cc1: all warnings being treated as errors
>
> Fix this by re-disabling the optimized CRC code on user-mode Linux.
>
> Fixes: e2fd1883971d ("lib/crc: prepare for arch-optimized code in subdirs of lib/crc/")
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
> lib/crc/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
FYI: I folded this into the fixed commit, so that it won't be a bisection
hazard.
- Eric
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-13 18:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-12 5:45 [PATCH] lib/crc: re-disable optimized CRC code on user-mode Linux Eric Biggers
2025-06-13 18:41 ` Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox