1 # SPDX-License-Identifier: GPL-2.0-only
3 # Library configuration
9 menu "Library routines"
14 config RAID6_PQ_BENCHMARK
15 bool "Automatically choose fastest RAID6 PQ functions"
19 Benchmark all available RAID6 PQ functions on init and choose the
26 bool "Generic bitfield packing and unpacking"
30 This option provides the packing() helper function, which permits
31 converting bitfields between a CPU-usable representation and a
32 memory representation that can have any combination of these quirks:
33 - Is little endian (bytes are reversed within a 32-bit group)
34 - The least-significant 32-bit word comes first (within a 64-bit
36 - The most significant bit of a byte is at its right (bit 0 of a
37 register description is numerically 2^7).
38 Drivers may use these helpers to match the bit indices as described
39 in the data sheets of the peripherals they are in control of.
43 config PACKING_KUNIT_TEST
44 tristate "KUnit tests for packing library" if !KUNIT_ALL_TESTS
45 depends on PACKING && KUNIT
46 default KUNIT_ALL_TESTS
48 This builds KUnit tests for the packing library.
50 For more information on KUnit and unit tests in general,
51 please refer to the KUnit documentation in Documentation/dev-tools/kunit/.
58 config HAVE_ARCH_BITREVERSE
62 This option enables the use of hardware bit-reversal instructions on
63 architectures which support such operations.
65 config ARCH_HAS_STRNCPY_FROM_USER
68 config ARCH_HAS_STRNLEN_USER
71 config GENERIC_STRNCPY_FROM_USER
72 def_bool !ARCH_HAS_STRNCPY_FROM_USER
74 config GENERIC_STRNLEN_USER
75 def_bool !ARCH_HAS_STRNLEN_USER
77 config GENERIC_NET_UTILS
80 source "lib/math/Kconfig"
82 config NO_GENERIC_PCI_IOPORT_MAP
87 select GENERIC_PCI_IOMAP
92 config ARCH_USE_CMPXCHG_LOCKREF
95 config ARCH_HAS_FAST_MULTIPLIER
98 config ARCH_USE_SYM_ANNOTATIONS
102 bool "Access I/O in non-MMIO mode"
104 depends on HAS_IOPORT
106 On some platforms where no separate I/O space exists, there are I/O
107 hosts which can not be accessed in MMIO mode. Using the logical PIO
108 mechanism, the host-local I/O resource can be mapped into system
109 logic PIO space shared with MMIO hosts, such as PCI/PCIe, then the
110 system can access the I/O devices with the mapped-logic PIO through
113 This way has relatively little I/O performance cost. Please make
114 sure your devices really need this configure item enabled.
116 When in doubt, say N.
118 config INDIRECT_IOMEM
121 This is selected by other options/architectures to provide the
122 emulated iomem accessors.
124 config INDIRECT_IOMEM_FALLBACK
126 depends on INDIRECT_IOMEM
128 If INDIRECT_IOMEM is selected, this enables falling back to plain
129 mmio accesses when the IO memory address is not a registered
132 config TRACE_MMIO_ACCESS
133 bool "Register read/write tracing"
134 depends on TRACING && ARCH_HAVE_TRACE_MMIO_ACCESS
136 Create tracepoints for MMIO read/write operations. These trace events
137 can be used for logging all MMIO read/write operations.
139 source "lib/crypto/Kconfig"
142 tristate "CRC-CCITT functions"
144 This option is provided for the case where no in-kernel-tree
145 modules require CRC-CCITT functions, but a module built outside
146 the kernel tree does. Such modules that use library CRC-CCITT
147 functions require M here.
150 tristate "CRC16 functions"
152 This option is provided for the case where no in-kernel-tree
153 modules require CRC16 functions, but a module built outside
154 the kernel tree does. Such modules that use library CRC16
155 functions require M here.
158 tristate "CRC calculation for the T10 Data Integrity Field"
160 This option is only needed if a module that's not in the
161 kernel tree needs to calculate CRC checks for use with the
162 SCSI data integrity subsystem.
164 config ARCH_HAS_CRC_T10DIF
168 prompt "CRC-T10DIF implementation"
169 depends on CRC_T10DIF
170 default CRC_T10DIF_IMPL_ARCH if ARCH_HAS_CRC_T10DIF
171 default CRC_T10DIF_IMPL_GENERIC if !ARCH_HAS_CRC_T10DIF
173 This option allows you to override the default choice of CRC-T10DIF
176 config CRC_T10DIF_IMPL_ARCH
177 bool "Architecture-optimized" if ARCH_HAS_CRC_T10DIF
179 Use the optimized implementation of CRC-T10DIF for the selected
180 architecture. It is recommended to keep this enabled, as it can
181 greatly improve CRC-T10DIF performance.
183 config CRC_T10DIF_IMPL_GENERIC
184 bool "Generic implementation"
186 Use the generic table-based implementation of CRC-T10DIF. Selecting
187 this will reduce code size slightly but can greatly reduce CRC-T10DIF
192 config CRC_T10DIF_ARCH
194 default CRC_T10DIF if CRC_T10DIF_IMPL_ARCH
196 config CRC64_ROCKSOFT
197 tristate "CRC calculation for the Rocksoft model CRC64"
200 select CRYPTO_CRC64_ROCKSOFT
202 This option provides a CRC64 API to a registered crypto driver.
203 This is used with the block layer's data integrity subsystem.
206 tristate "CRC ITU-T V.41 functions"
208 This option is provided for the case where no in-kernel-tree
209 modules require CRC ITU-T V.41 functions, but a module built outside
210 the kernel tree does. Such modules that use library CRC ITU-T V.41
211 functions require M here.
214 tristate "CRC32/CRC32c functions"
218 This option is provided for the case where no in-kernel-tree
219 modules require CRC32/CRC32c functions, but a module built outside
220 the kernel tree does. Such modules that use library CRC32/CRC32c
221 functions require M here.
223 config ARCH_HAS_CRC32
227 prompt "CRC32 implementation"
229 default CRC32_IMPL_ARCH_PLUS_SLICEBY8 if ARCH_HAS_CRC32
230 default CRC32_IMPL_SLICEBY8 if !ARCH_HAS_CRC32
232 This option allows you to override the default choice of CRC32
233 implementation. Choose the default unless you know that you need one
236 config CRC32_IMPL_ARCH_PLUS_SLICEBY8
237 bool "Arch-optimized, with fallback to slice-by-8" if ARCH_HAS_CRC32
239 Use architecture-optimized implementation of CRC32. Fall back to
240 slice-by-8 in cases where the arch-optimized implementation cannot be
241 used, e.g. if the CPU lacks support for the needed instructions.
243 This is the default when an arch-optimized implementation exists.
245 config CRC32_IMPL_ARCH_PLUS_SLICEBY1
246 bool "Arch-optimized, with fallback to slice-by-1" if ARCH_HAS_CRC32
248 Use architecture-optimized implementation of CRC32, but fall back to
249 slice-by-1 instead of slice-by-8 in order to reduce the binary size.
251 config CRC32_IMPL_SLICEBY8
252 bool "Slice by 8 bytes"
254 Calculate checksum 8 bytes at a time with a clever slicing algorithm.
255 This is much slower than the architecture-optimized implementation of
256 CRC32 (if the selected arch has one), but it is portable and is the
257 fastest implementation when no arch-optimized implementation is
258 available. It uses an 8KiB lookup table. Most modern processors have
259 enough cache to hold this table without thrashing the cache.
261 config CRC32_IMPL_SLICEBY4
262 bool "Slice by 4 bytes"
264 Calculate checksum 4 bytes at a time with a clever slicing algorithm.
265 This is a bit slower than slice by 8, but has a smaller 4KiB lookup
268 Only choose this option if you know what you are doing.
270 config CRC32_IMPL_SLICEBY1
271 bool "Slice by 1 byte (Sarwate's algorithm)"
273 Calculate checksum a byte at a time using Sarwate's algorithm. This
274 is not particularly fast, but has a small 1KiB lookup table.
276 Only choose this option if you know what you are doing.
278 config CRC32_IMPL_BIT
279 bool "Classic Algorithm (one bit at a time)"
281 Calculate checksum one bit at a time. This is VERY slow, but has
282 no lookup table. This is provided as a debugging option.
284 Only choose this option if you are debugging crc32.
290 default CRC32 if CRC32_IMPL_ARCH_PLUS_SLICEBY8 || CRC32_IMPL_ARCH_PLUS_SLICEBY1
292 config CRC32_SLICEBY8
294 default y if CRC32_IMPL_SLICEBY8 || CRC32_IMPL_ARCH_PLUS_SLICEBY8
296 config CRC32_SLICEBY4
298 default y if CRC32_IMPL_SLICEBY4
302 default y if CRC32_IMPL_SLICEBY1 || CRC32_IMPL_ARCH_PLUS_SLICEBY1
306 default y if CRC32_IMPL_BIT
309 tristate "CRC64 functions"
311 This option is provided for the case where no in-kernel-tree
312 modules require CRC64 functions, but a module built outside
313 the kernel tree does. Such modules that use library CRC64
314 functions require M here.
317 tristate "CRC4 functions"
319 This option is provided for the case where no in-kernel-tree
320 modules require CRC4 functions, but a module built outside
321 the kernel tree does. Such modules that use library CRC4
322 functions require M here.
325 tristate "CRC7 functions"
327 This option is provided for the case where no in-kernel-tree
328 modules require CRC7 functions, but a module built outside
329 the kernel tree does. Such modules that use library CRC7
330 functions require M here.
333 tristate "CRC32c (Castagnoli, et al) Cyclic Redundancy-Check"
336 This option just selects CRC32 and is provided for compatibility
337 purposes until the users are updated to select CRC32 directly.
340 tristate "CRC8 function"
342 This option provides CRC8 function. Drivers may select this
343 when they need to do cyclic redundancy check according CRC8
344 algorithm. Module will be called crc8.
351 depends on AUDIT && !AUDIT_ARCH
354 config AUDIT_ARCH_COMPAT_GENERIC
358 config AUDIT_COMPAT_GENERIC
360 depends on AUDIT_GENERIC && AUDIT_ARCH_COMPAT_GENERIC && COMPAT
363 config RANDOM32_SELFTEST
364 bool "PRNG perform self test on init"
366 This option enables the 32 bit PRNG library functions to perform a
367 self test on initialization.
370 # compression support is select'ed if needed
376 config 842_DECOMPRESS
390 prompt "Enable s390x DEFLATE CONVERSION CALL support for kernel zlib"
392 Enable s390x hardware support for zlib in the kernel.
397 config LZO_DECOMPRESS
403 config LZ4HC_COMPRESS
406 config LZ4_DECOMPRESS
417 config ZSTD_DECOMPRESS
421 source "lib/xz/Kconfig"
424 # These all provide a common interface (hence the apparent duplication with
425 # ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.)
427 config DECOMPRESS_GZIP
431 config DECOMPRESS_BZIP2
434 config DECOMPRESS_LZMA
441 config DECOMPRESS_LZO
442 select LZO_DECOMPRESS
445 config DECOMPRESS_LZ4
446 select LZ4_DECOMPRESS
449 config DECOMPRESS_ZSTD
450 select ZSTD_DECOMPRESS
454 # Generic allocator support is selected if needed
456 config GENERIC_ALLOCATOR
460 # reed solomon support is select'ed if needed
465 config REED_SOLOMON_ENC8
468 config REED_SOLOMON_DEC8
471 config REED_SOLOMON_ENC16
474 config REED_SOLOMON_DEC16
478 # BCH support is selected if needed
484 config BCH_CONST_PARAMS
487 Drivers may select this option to force specific constant
488 values for parameters 'm' (Galois field order) and 't'
489 (error correction capability). Those specific values must
490 be set by declaring default values for symbols BCH_CONST_M
492 Doing so will enable extra compiler optimizations,
493 improving encoding and decoding performance up to 2x for
494 usual (m,t) values (typically such that m*t < 200).
495 When this option is selected, the BCH library supports
496 only a single (m,t) configuration. This is mainly useful
497 for NAND flash board drivers requiring known, fixed BCH
504 Constant value for Galois field order 'm'. If 'k' is the
505 number of data bits to protect, 'm' should be chosen such
506 that (k + m*t) <= 2**m - 1.
507 Drivers should declare a default value for this symbol if
508 they select option BCH_CONST_PARAMS.
513 Constant value for error correction capability in bits 't'.
514 Drivers should declare a default value for this symbol if
515 they select option BCH_CONST_PARAMS.
518 # Textsearch support is select'ed if needed
523 config TEXTSEARCH_KMP
529 config TEXTSEARCH_FSM
538 Simple, embeddable, interval-tree. Can find the start of an
539 overlapping range in log(n) time and then iterate over all
540 overlapping nodes. The algorithm is implemented as an
545 Documentation/core-api/rbtree.rst
547 for more information.
549 config INTERVAL_TREE_SPAN_ITER
551 depends on INTERVAL_TREE
556 Support entries which occupy multiple consecutive indices in the
559 config ASSOCIATIVE_ARRAY
562 Generic associative array. Can be searched and iterated over whilst
563 it is being modified. It is also reasonably quick to search and
564 modify. The algorithms are non-recursive, and the trees are highly
569 Documentation/core-api/assoc_array.rst
571 for more information.
584 config HAS_IOPORT_MAP
586 depends on HAS_IOMEM && !NO_IOPORT_MAP
589 source "kernel/dma/Kconfig"
598 config CHECK_SIGNATURE
601 config CPUMASK_OFFSTACK
602 bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS
604 Use dynamic allocation for cpumask_var_t, instead of putting
605 them on the stack. This is a bit more expensive, but avoids
620 # This actually supports modular compilation, but the module overhead
621 # is ridiculous for the amount of code involved. Until an out-of-tree
622 # driver asks for it, we'll just link it directly it into the kernel
623 # when required. Since we're ignoring out-of-tree users, there's also
624 # no need bother prompting for a manual decision:
625 # prompt "glob_match() function"
627 This option provides a glob_match function for performing
628 simple text pattern matching. It originated in the ATA code
629 to blacklist particular drive models, but other device drivers
630 may need similar functionality.
632 All drivers in the Linux kernel tree that require this function
633 should automatically select this option. Say N unless you
634 are compiling an out-of tree driver which tells you that it
638 tristate "glob self-test on init"
641 This option enables a simple self-test of the glob_match
642 function on startup. It is primarily useful for people
643 working on the code to ensure they haven't introduced any
646 It only adds a little bit of code and slows kernel boot (or
647 module load) by a small amount, so you're welcome to play with
648 it, but you probably don't need it.
651 # Netlink attribute parsing support is select'ed if needed
657 # Generic 64-bit atomic support is selected if needed
659 config GENERIC_ATOMIC64
669 bool "IRQ polling library"
671 Helper library to poll interrupt mitigation using polling.
677 Multiprecision maths library from GnuPG.
678 It is used to implement RSA digital signature verification,
679 which is used by IMA/EVM digital signature extension.
688 Digital signature verification. Currently only RSA is supported.
689 Implementation is done using GnuPG MPI library
695 Dynamic Interrupt Moderation library.
696 Implements an algorithm for dynamically changing CQ moderation values
697 according to run time performance.
700 # libfdt files, only selected if needed.
708 Enable fast lookup object identifier registry.
716 source "lib/vdso/Kconfig"
718 source "lib/fonts/Kconfig"
723 Provides a helper to split scatterlists into chunks, each chunk being
724 a scatterlist. This should be selected by a driver or an API which
725 whishes to split a scatterlist amongst multiple DMA channels.
730 Provides a helper to allocate chained scatterlists. This should be
731 selected by a driver or an API which whishes to allocate chained
738 config ARCH_NO_SG_CHAIN
741 config ARCH_HAS_PMEM_API
747 config ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
750 config ARCH_HAS_MEMREMAP_COMPAT_ALIGN
753 # use memcpy to implement user copies for nommu architectures
754 config UACCESS_MEMCPY
757 config ARCH_HAS_UACCESS_FLUSHCACHE
760 # arch has a concept of a recoverable synchronous exception due to a
761 # memory-read error like x86 machine-check or ARM data-abort, and
762 # implements copy_mc_to_{user,kernel} to abort and report
763 # 'bytes-transferred' if that exception fires when accessing the source
765 config ARCH_HAS_COPY_MC
768 # Temporary. Goes away when all archs are cleaned up
769 config ARCH_STACKWALK
776 Stack depot: stack trace storage that avoids duplication
778 config STACKDEPOT_ALWAYS_INIT
782 Always initialize stack depot during early boot
784 config STACKDEPOT_MAX_FRAMES
785 int "Maximum number of frames in trace saved in stack depot"
788 depends on STACKDEPOT
792 depends on STACKTRACE_SUPPORT
799 tristate "parman" if COMPILE_TEST
802 tristate "objagg" if COMPILE_TEST
805 bool "Boot-time test for lwq queuing"
807 Run boot-time test of light-weight queuing.
811 config GENERIC_IOREMAP
814 config GENERIC_LIB_ASHLDI3
817 config GENERIC_LIB_ASHRDI3
820 config GENERIC_LIB_LSHRDI3
823 config GENERIC_LIB_MULDI3
826 config GENERIC_LIB_CMPDI2
829 config GENERIC_LIB_UCMPDI2
832 config GENERIC_LIB_DEVMEM_IS_ALLOWED
845 config FIRMWARE_TABLE