xref: /linux/lib/Kconfig (revision 37b33c68b00089a574ebd0a856a5d554eb3001b7)
1# SPDX-License-Identifier: GPL-2.0-only
2#
3# Library configuration
4#
5
6config BINARY_PRINTF
7	def_bool n
8
9menu "Library routines"
10
11config RAID6_PQ
12	tristate
13
14config RAID6_PQ_BENCHMARK
15	bool "Automatically choose fastest RAID6 PQ functions"
16	depends on RAID6_PQ
17	default y
18	help
19	  Benchmark all available RAID6 PQ functions on init and choose the
20	  fastest one.
21
22config LINEAR_RANGES
23	tristate
24
25config PACKING
26	bool "Generic bitfield packing and unpacking"
27	select BITREVERSE
28	default n
29	help
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
35	      group)
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.
40
41	  When in doubt, say N.
42
43config PACKING_KUNIT_TEST
44	tristate "KUnit tests for packing library" if !KUNIT_ALL_TESTS
45	depends on PACKING && KUNIT
46	default KUNIT_ALL_TESTS
47	help
48	  This builds KUnit tests for the packing library.
49
50	  For more information on KUnit and unit tests in general,
51	  please refer to the KUnit documentation in Documentation/dev-tools/kunit/.
52
53	  When in doubt, say N.
54
55config BITREVERSE
56	tristate
57
58config HAVE_ARCH_BITREVERSE
59	bool
60	default n
61	help
62	  This option enables the use of hardware bit-reversal instructions on
63	  architectures which support such operations.
64
65config ARCH_HAS_STRNCPY_FROM_USER
66	bool
67
68config ARCH_HAS_STRNLEN_USER
69	bool
70
71config GENERIC_STRNCPY_FROM_USER
72	def_bool !ARCH_HAS_STRNCPY_FROM_USER
73
74config GENERIC_STRNLEN_USER
75	def_bool !ARCH_HAS_STRNLEN_USER
76
77config GENERIC_NET_UTILS
78	bool
79
80source "lib/math/Kconfig"
81
82config NO_GENERIC_PCI_IOPORT_MAP
83	bool
84
85config GENERIC_IOMAP
86	bool
87	select GENERIC_PCI_IOMAP
88
89config STMP_DEVICE
90	bool
91
92config ARCH_USE_CMPXCHG_LOCKREF
93	bool
94
95config ARCH_HAS_FAST_MULTIPLIER
96	bool
97
98config ARCH_USE_SYM_ANNOTATIONS
99	bool
100
101config INDIRECT_PIO
102	bool "Access I/O in non-MMIO mode"
103	depends on ARM64
104	depends on HAS_IOPORT
105	help
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
111	  I/O accessors.
112
113	  This way has relatively little I/O performance cost. Please make
114	  sure your devices really need this configure item enabled.
115
116	  When in doubt, say N.
117
118config INDIRECT_IOMEM
119	bool
120	help
121	  This is selected by other options/architectures to provide the
122	  emulated iomem accessors.
123
124config INDIRECT_IOMEM_FALLBACK
125	bool
126	depends on INDIRECT_IOMEM
127	help
128	  If INDIRECT_IOMEM is selected, this enables falling back to plain
129	  mmio accesses when the IO memory address is not a registered
130	  emulated region.
131
132config TRACE_MMIO_ACCESS
133	bool "Register read/write tracing"
134	depends on TRACING && ARCH_HAVE_TRACE_MMIO_ACCESS
135	help
136	  Create tracepoints for MMIO read/write operations. These trace events
137	  can be used for logging all MMIO read/write operations.
138
139source "lib/crypto/Kconfig"
140
141config CRC_CCITT
142	tristate "CRC-CCITT functions"
143	help
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.
148
149config CRC16
150	tristate "CRC16 functions"
151	help
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.
156
157config CRC_T10DIF
158	tristate "CRC calculation for the T10 Data Integrity Field"
159	help
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.
163
164config ARCH_HAS_CRC_T10DIF
165	bool
166
167choice
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
172	help
173	  This option allows you to override the default choice of CRC-T10DIF
174	  implementation.
175
176config CRC_T10DIF_IMPL_ARCH
177	bool "Architecture-optimized" if ARCH_HAS_CRC_T10DIF
178	help
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.
182
183config CRC_T10DIF_IMPL_GENERIC
184	bool "Generic implementation"
185	help
186	  Use the generic table-based implementation of CRC-T10DIF.  Selecting
187	  this will reduce code size slightly but can greatly reduce CRC-T10DIF
188	  performance.
189
190endchoice
191
192config CRC_T10DIF_ARCH
193	tristate
194	default CRC_T10DIF if CRC_T10DIF_IMPL_ARCH
195
196config CRC64_ROCKSOFT
197	tristate "CRC calculation for the Rocksoft model CRC64"
198	select CRC64
199	select CRYPTO
200	select CRYPTO_CRC64_ROCKSOFT
201	help
202	  This option provides a CRC64 API to a registered crypto driver.
203	  This is used with the block layer's data integrity subsystem.
204
205config CRC_ITU_T
206	tristate "CRC ITU-T V.41 functions"
207	help
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.
212
213config CRC32
214	tristate "CRC32/CRC32c functions"
215	default y
216	select BITREVERSE
217	help
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.
222
223config ARCH_HAS_CRC32
224	bool
225
226choice
227	prompt "CRC32 implementation"
228	depends on CRC32
229	default CRC32_IMPL_ARCH_PLUS_SLICEBY8 if ARCH_HAS_CRC32
230	default CRC32_IMPL_SLICEBY8 if !ARCH_HAS_CRC32
231	help
232	  This option allows you to override the default choice of CRC32
233	  implementation.  Choose the default unless you know that you need one
234	  of the others.
235
236config CRC32_IMPL_ARCH_PLUS_SLICEBY8
237	bool "Arch-optimized, with fallback to slice-by-8" if ARCH_HAS_CRC32
238	help
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.
242
243	  This is the default when an arch-optimized implementation exists.
244
245config CRC32_IMPL_ARCH_PLUS_SLICEBY1
246	bool "Arch-optimized, with fallback to slice-by-1" if ARCH_HAS_CRC32
247	help
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.
250
251config CRC32_IMPL_SLICEBY8
252	bool "Slice by 8 bytes"
253	help
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.
260
261config CRC32_IMPL_SLICEBY4
262	bool "Slice by 4 bytes"
263	help
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
266	  table.
267
268	  Only choose this option if you know what you are doing.
269
270config CRC32_IMPL_SLICEBY1
271	bool "Slice by 1 byte (Sarwate's algorithm)"
272	help
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.
275
276	  Only choose this option if you know what you are doing.
277
278config CRC32_IMPL_BIT
279	bool "Classic Algorithm (one bit at a time)"
280	help
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.
283
284	  Only choose this option if you are debugging crc32.
285
286endchoice
287
288config CRC32_ARCH
289	tristate
290	default CRC32 if CRC32_IMPL_ARCH_PLUS_SLICEBY8 || CRC32_IMPL_ARCH_PLUS_SLICEBY1
291
292config CRC32_SLICEBY8
293	bool
294	default y if CRC32_IMPL_SLICEBY8 || CRC32_IMPL_ARCH_PLUS_SLICEBY8
295
296config CRC32_SLICEBY4
297	bool
298	default y if CRC32_IMPL_SLICEBY4
299
300config CRC32_SARWATE
301	bool
302	default y if CRC32_IMPL_SLICEBY1 || CRC32_IMPL_ARCH_PLUS_SLICEBY1
303
304config CRC32_BIT
305	bool
306	default y if CRC32_IMPL_BIT
307
308config CRC64
309	tristate "CRC64 functions"
310	help
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.
315
316config CRC4
317	tristate "CRC4 functions"
318	help
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.
323
324config CRC7
325	tristate "CRC7 functions"
326	help
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.
331
332config LIBCRC32C
333	tristate "CRC32c (Castagnoli, et al) Cyclic Redundancy-Check"
334	select CRC32
335	help
336	  This option just selects CRC32 and is provided for compatibility
337	  purposes until the users are updated to select CRC32 directly.
338
339config CRC8
340	tristate "CRC8 function"
341	help
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.
345
346config XXHASH
347	tristate
348
349config AUDIT_GENERIC
350	bool
351	depends on AUDIT && !AUDIT_ARCH
352	default y
353
354config AUDIT_ARCH_COMPAT_GENERIC
355	bool
356	default n
357
358config AUDIT_COMPAT_GENERIC
359	bool
360	depends on AUDIT_GENERIC && AUDIT_ARCH_COMPAT_GENERIC && COMPAT
361	default y
362
363config RANDOM32_SELFTEST
364	bool "PRNG perform self test on init"
365	help
366	  This option enables the 32 bit PRNG library functions to perform a
367	  self test on initialization.
368
369#
370# compression support is select'ed if needed
371#
372config 842_COMPRESS
373	select CRC32
374	tristate
375
376config 842_DECOMPRESS
377	select CRC32
378	tristate
379
380config ZLIB_INFLATE
381	tristate
382
383config ZLIB_DEFLATE
384	tristate
385	select BITREVERSE
386
387config ZLIB_DFLTCC
388	def_bool y
389	depends on S390
390	prompt "Enable s390x DEFLATE CONVERSION CALL support for kernel zlib"
391	help
392	 Enable s390x hardware support for zlib in the kernel.
393
394config LZO_COMPRESS
395	tristate
396
397config LZO_DECOMPRESS
398	tristate
399
400config LZ4_COMPRESS
401	tristate
402
403config LZ4HC_COMPRESS
404	tristate
405
406config LZ4_DECOMPRESS
407	tristate
408
409config ZSTD_COMMON
410	select XXHASH
411	tristate
412
413config ZSTD_COMPRESS
414	select ZSTD_COMMON
415	tristate
416
417config ZSTD_DECOMPRESS
418	select ZSTD_COMMON
419	tristate
420
421source "lib/xz/Kconfig"
422
423#
424# These all provide a common interface (hence the apparent duplication with
425# ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.)
426#
427config DECOMPRESS_GZIP
428	select ZLIB_INFLATE
429	tristate
430
431config DECOMPRESS_BZIP2
432	tristate
433
434config DECOMPRESS_LZMA
435	tristate
436
437config DECOMPRESS_XZ
438	select XZ_DEC
439	tristate
440
441config DECOMPRESS_LZO
442	select LZO_DECOMPRESS
443	tristate
444
445config DECOMPRESS_LZ4
446	select LZ4_DECOMPRESS
447	tristate
448
449config DECOMPRESS_ZSTD
450	select ZSTD_DECOMPRESS
451	tristate
452
453#
454# Generic allocator support is selected if needed
455#
456config GENERIC_ALLOCATOR
457	bool
458
459#
460# reed solomon support is select'ed if needed
461#
462config REED_SOLOMON
463	tristate
464
465config REED_SOLOMON_ENC8
466	bool
467
468config REED_SOLOMON_DEC8
469	bool
470
471config REED_SOLOMON_ENC16
472	bool
473
474config REED_SOLOMON_DEC16
475	bool
476
477#
478# BCH support is selected if needed
479#
480config BCH
481	tristate
482	select BITREVERSE
483
484config BCH_CONST_PARAMS
485	bool
486	help
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
491	  and BCH_CONST_T.
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
498	  parameters.
499
500config BCH_CONST_M
501	int
502	range 5 15
503	help
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.
509
510config BCH_CONST_T
511	int
512	help
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.
516
517#
518# Textsearch support is select'ed if needed
519#
520config TEXTSEARCH
521	bool
522
523config TEXTSEARCH_KMP
524	tristate
525
526config TEXTSEARCH_BM
527	tristate
528
529config TEXTSEARCH_FSM
530	tristate
531
532config BTREE
533	bool
534
535config INTERVAL_TREE
536	bool
537	help
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
541	  augmented rbtree.
542
543	  See:
544
545		Documentation/core-api/rbtree.rst
546
547	  for more information.
548
549config INTERVAL_TREE_SPAN_ITER
550	bool
551	depends on INTERVAL_TREE
552
553config XARRAY_MULTI
554	bool
555	help
556	  Support entries which occupy multiple consecutive indices in the
557	  XArray.
558
559config ASSOCIATIVE_ARRAY
560	bool
561	help
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
565	  capacious.
566
567	  See:
568
569		Documentation/core-api/assoc_array.rst
570
571	  for more information.
572
573config CLOSURES
574	bool
575
576config HAS_IOMEM
577	bool
578	depends on !NO_IOMEM
579	default y
580
581config HAS_IOPORT
582	bool
583
584config HAS_IOPORT_MAP
585	bool
586	depends on HAS_IOMEM && !NO_IOPORT_MAP
587	default y
588
589source "kernel/dma/Kconfig"
590
591config SGL_ALLOC
592	bool
593	default n
594
595config IOMMU_HELPER
596	bool
597
598config CHECK_SIGNATURE
599	bool
600
601config CPUMASK_OFFSTACK
602	bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS
603	help
604	  Use dynamic allocation for cpumask_var_t, instead of putting
605	  them on the stack.  This is a bit more expensive, but avoids
606	  stack overflow.
607
608config FORCE_NR_CPUS
609	def_bool !SMP
610
611config CPU_RMAP
612	bool
613	depends on SMP
614
615config DQL
616	bool
617
618config GLOB
619	bool
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"
626	help
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.
631
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
635	  depends on this.
636
637config GLOB_SELFTEST
638	tristate "glob self-test on init"
639	depends on GLOB
640	help
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
644	  regressions.
645
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.
649
650#
651# Netlink attribute parsing support is select'ed if needed
652#
653config NLATTR
654	bool
655
656#
657# Generic 64-bit atomic support is selected if needed
658#
659config GENERIC_ATOMIC64
660       bool
661
662config LRU_CACHE
663	tristate
664
665config CLZ_TAB
666	bool
667
668config IRQ_POLL
669	bool "IRQ polling library"
670	help
671	  Helper library to poll interrupt mitigation using polling.
672
673config MPILIB
674	tristate
675	select CLZ_TAB
676	help
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.
680
681config SIGNATURE
682	tristate
683	depends on KEYS
684	select CRYPTO
685	select CRYPTO_SHA1
686	select MPILIB
687	help
688	  Digital signature verification. Currently only RSA is supported.
689	  Implementation is done using GnuPG MPI library
690
691config DIMLIB
692	tristate
693	depends on NET
694	help
695	  Dynamic Interrupt Moderation library.
696	  Implements an algorithm for dynamically changing CQ moderation values
697	  according to run time performance.
698
699#
700# libfdt files, only selected if needed.
701#
702config LIBFDT
703	bool
704
705config OID_REGISTRY
706	tristate
707	help
708	  Enable fast lookup object identifier registry.
709
710config UCS2_STRING
711	tristate
712
713#
714# generic vdso
715#
716source "lib/vdso/Kconfig"
717
718source "lib/fonts/Kconfig"
719
720config SG_SPLIT
721	def_bool n
722	help
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.
726
727config SG_POOL
728	def_bool n
729	help
730	 Provides a helper to allocate chained scatterlists. This should be
731	 selected by a driver or an API which whishes to allocate chained
732	 scatterlist.
733
734#
735# sg chaining option
736#
737
738config ARCH_NO_SG_CHAIN
739	def_bool n
740
741config ARCH_HAS_PMEM_API
742	bool
743
744config MEMREGION
745	bool
746
747config ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
748	bool
749
750config ARCH_HAS_MEMREMAP_COMPAT_ALIGN
751	bool
752
753# use memcpy to implement user copies for nommu architectures
754config UACCESS_MEMCPY
755	bool
756
757config ARCH_HAS_UACCESS_FLUSHCACHE
758	bool
759
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
764# buffer.
765config ARCH_HAS_COPY_MC
766	bool
767
768# Temporary. Goes away when all archs are cleaned up
769config ARCH_STACKWALK
770       bool
771
772config STACKDEPOT
773	bool
774	select STACKTRACE
775	help
776	  Stack depot: stack trace storage that avoids duplication
777
778config STACKDEPOT_ALWAYS_INIT
779	bool
780	select STACKDEPOT
781	help
782	  Always initialize stack depot during early boot
783
784config STACKDEPOT_MAX_FRAMES
785	int "Maximum number of frames in trace saved in stack depot"
786	range 1 256
787	default 64
788	depends on STACKDEPOT
789
790config REF_TRACKER
791	bool
792	depends on STACKTRACE_SUPPORT
793	select STACKDEPOT
794
795config SBITMAP
796	bool
797
798config PARMAN
799	tristate "parman" if COMPILE_TEST
800
801config OBJAGG
802	tristate "objagg" if COMPILE_TEST
803
804config LWQ_TEST
805	bool "Boot-time test for lwq queuing"
806	help
807          Run boot-time test of light-weight queuing.
808
809endmenu
810
811config GENERIC_IOREMAP
812	bool
813
814config GENERIC_LIB_ASHLDI3
815	bool
816
817config GENERIC_LIB_ASHRDI3
818	bool
819
820config GENERIC_LIB_LSHRDI3
821	bool
822
823config GENERIC_LIB_MULDI3
824	bool
825
826config GENERIC_LIB_CMPDI2
827	bool
828
829config GENERIC_LIB_UCMPDI2
830	bool
831
832config GENERIC_LIB_DEVMEM_IS_ALLOWED
833	bool
834
835config PLDMFW
836	bool
837	default n
838
839config ASN1_ENCODER
840       tristate
841
842config POLYNOMIAL
843       tristate
844
845config FIRMWARE_TABLE
846	bool
847
848config UNION_FIND
849	bool
850
851config MIN_HEAP
852	bool
853