xref: /linux/lib/Kconfig (revision a6d0dbba950880e269d433222ca6d516ebe8a6ae)
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
143
144config CRC16
145	tristate
146
147config CRC_T10DIF
148	tristate
149
150config ARCH_HAS_CRC_T10DIF
151	bool
152
153config CRC_T10DIF_ARCH
154	tristate
155	default CRC_T10DIF if ARCH_HAS_CRC_T10DIF && CRC_OPTIMIZATIONS
156
157config CRC_ITU_T
158	tristate "CRC ITU-T V.41 functions"
159	help
160	  This option is provided for the case where no in-kernel-tree
161	  modules require CRC ITU-T V.41 functions, but a module built outside
162	  the kernel tree does. Such modules that use library CRC ITU-T V.41
163	  functions require M here.
164
165config CRC32
166	tristate
167	select BITREVERSE
168
169config ARCH_HAS_CRC32
170	bool
171
172config CRC32_ARCH
173	tristate
174	default CRC32 if ARCH_HAS_CRC32 && CRC_OPTIMIZATIONS
175
176config CRC64
177	tristate
178
179config ARCH_HAS_CRC64
180	bool
181
182config CRC64_ARCH
183	tristate
184	default CRC64 if ARCH_HAS_CRC64 && CRC_OPTIMIZATIONS
185
186config CRC4
187	tristate
188
189config CRC7
190	tristate
191
192config LIBCRC32C
193	tristate
194	select CRC32
195	help
196	  This option just selects CRC32 and is provided for compatibility
197	  purposes until the users are updated to select CRC32 directly.
198
199config CRC8
200	tristate
201
202config CRC_OPTIMIZATIONS
203	bool "Enable optimized CRC implementations" if EXPERT
204	default y
205	help
206	  Disabling this option reduces code size slightly by disabling the
207	  architecture-optimized implementations of any CRC variants that are
208	  enabled.  CRC checksumming performance may get much slower.
209
210	  Keep this enabled unless you're really trying to minimize the size of
211	  the kernel.
212
213config XXHASH
214	tristate
215
216config AUDIT_GENERIC
217	bool
218	depends on AUDIT && !AUDIT_ARCH
219	default y
220
221config AUDIT_ARCH_COMPAT_GENERIC
222	bool
223	default n
224
225config AUDIT_COMPAT_GENERIC
226	bool
227	depends on AUDIT_GENERIC && AUDIT_ARCH_COMPAT_GENERIC && COMPAT
228	default y
229
230config RANDOM32_SELFTEST
231	bool "PRNG perform self test on init"
232	help
233	  This option enables the 32 bit PRNG library functions to perform a
234	  self test on initialization.
235
236#
237# compression support is select'ed if needed
238#
239config 842_COMPRESS
240	select CRC32
241	tristate
242
243config 842_DECOMPRESS
244	select CRC32
245	tristate
246
247config ZLIB_INFLATE
248	tristate
249
250config ZLIB_DEFLATE
251	tristate
252	select BITREVERSE
253
254config ZLIB_DFLTCC
255	def_bool y
256	depends on S390
257	prompt "Enable s390x DEFLATE CONVERSION CALL support for kernel zlib"
258	help
259	 Enable s390x hardware support for zlib in the kernel.
260
261config LZO_COMPRESS
262	tristate
263
264config LZO_DECOMPRESS
265	tristate
266
267config LZ4_COMPRESS
268	tristate
269
270config LZ4HC_COMPRESS
271	tristate
272
273config LZ4_DECOMPRESS
274	tristate
275
276config ZSTD_COMMON
277	select XXHASH
278	tristate
279
280config ZSTD_COMPRESS
281	select ZSTD_COMMON
282	tristate
283
284config ZSTD_DECOMPRESS
285	select ZSTD_COMMON
286	tristate
287
288source "lib/xz/Kconfig"
289
290#
291# These all provide a common interface (hence the apparent duplication with
292# ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.)
293#
294config DECOMPRESS_GZIP
295	select ZLIB_INFLATE
296	tristate
297
298config DECOMPRESS_BZIP2
299	tristate
300
301config DECOMPRESS_LZMA
302	tristate
303
304config DECOMPRESS_XZ
305	select XZ_DEC
306	tristate
307
308config DECOMPRESS_LZO
309	select LZO_DECOMPRESS
310	tristate
311
312config DECOMPRESS_LZ4
313	select LZ4_DECOMPRESS
314	tristate
315
316config DECOMPRESS_ZSTD
317	select ZSTD_DECOMPRESS
318	tristate
319
320#
321# Generic allocator support is selected if needed
322#
323config GENERIC_ALLOCATOR
324	bool
325
326#
327# reed solomon support is select'ed if needed
328#
329config REED_SOLOMON
330	tristate
331
332config REED_SOLOMON_ENC8
333	bool
334
335config REED_SOLOMON_DEC8
336	bool
337
338config REED_SOLOMON_ENC16
339	bool
340
341config REED_SOLOMON_DEC16
342	bool
343
344#
345# BCH support is selected if needed
346#
347config BCH
348	tristate
349	select BITREVERSE
350
351config BCH_CONST_PARAMS
352	bool
353	help
354	  Drivers may select this option to force specific constant
355	  values for parameters 'm' (Galois field order) and 't'
356	  (error correction capability). Those specific values must
357	  be set by declaring default values for symbols BCH_CONST_M
358	  and BCH_CONST_T.
359	  Doing so will enable extra compiler optimizations,
360	  improving encoding and decoding performance up to 2x for
361	  usual (m,t) values (typically such that m*t < 200).
362	  When this option is selected, the BCH library supports
363	  only a single (m,t) configuration. This is mainly useful
364	  for NAND flash board drivers requiring known, fixed BCH
365	  parameters.
366
367config BCH_CONST_M
368	int
369	range 5 15
370	help
371	  Constant value for Galois field order 'm'. If 'k' is the
372	  number of data bits to protect, 'm' should be chosen such
373	  that (k + m*t) <= 2**m - 1.
374	  Drivers should declare a default value for this symbol if
375	  they select option BCH_CONST_PARAMS.
376
377config BCH_CONST_T
378	int
379	help
380	  Constant value for error correction capability in bits 't'.
381	  Drivers should declare a default value for this symbol if
382	  they select option BCH_CONST_PARAMS.
383
384#
385# Textsearch support is select'ed if needed
386#
387config TEXTSEARCH
388	bool
389
390config TEXTSEARCH_KMP
391	tristate
392
393config TEXTSEARCH_BM
394	tristate
395
396config TEXTSEARCH_FSM
397	tristate
398
399config BTREE
400	bool
401
402config INTERVAL_TREE
403	bool
404	help
405	  Simple, embeddable, interval-tree. Can find the start of an
406	  overlapping range in log(n) time and then iterate over all
407	  overlapping nodes. The algorithm is implemented as an
408	  augmented rbtree.
409
410	  See:
411
412		Documentation/core-api/rbtree.rst
413
414	  for more information.
415
416config INTERVAL_TREE_SPAN_ITER
417	bool
418	depends on INTERVAL_TREE
419
420config XARRAY_MULTI
421	bool
422	help
423	  Support entries which occupy multiple consecutive indices in the
424	  XArray.
425
426config ASSOCIATIVE_ARRAY
427	bool
428	help
429	  Generic associative array.  Can be searched and iterated over whilst
430	  it is being modified.  It is also reasonably quick to search and
431	  modify.  The algorithms are non-recursive, and the trees are highly
432	  capacious.
433
434	  See:
435
436		Documentation/core-api/assoc_array.rst
437
438	  for more information.
439
440config CLOSURES
441	bool
442
443config HAS_IOMEM
444	bool
445	depends on !NO_IOMEM
446	default y
447
448config HAS_IOPORT
449	bool
450
451config HAS_IOPORT_MAP
452	bool
453	depends on HAS_IOMEM && !NO_IOPORT_MAP
454	default y
455
456source "kernel/dma/Kconfig"
457
458config SGL_ALLOC
459	bool
460	default n
461
462config IOMMU_HELPER
463	bool
464
465config CHECK_SIGNATURE
466	bool
467
468config CPUMASK_OFFSTACK
469	bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS
470	help
471	  Use dynamic allocation for cpumask_var_t, instead of putting
472	  them on the stack.  This is a bit more expensive, but avoids
473	  stack overflow.
474
475config FORCE_NR_CPUS
476	def_bool !SMP
477
478config CPU_RMAP
479	bool
480	depends on SMP
481
482config DQL
483	bool
484
485config GLOB
486	bool
487#	This actually supports modular compilation, but the module overhead
488#	is ridiculous for the amount of code involved.	Until an out-of-tree
489#	driver asks for it, we'll just link it directly it into the kernel
490#	when required.  Since we're ignoring out-of-tree users,	there's also
491#	no need bother prompting for a manual decision:
492#	prompt "glob_match() function"
493	help
494	  This option provides a glob_match function for performing
495	  simple text pattern matching.  It originated in the ATA code
496	  to blacklist particular drive models, but other device drivers
497	  may need similar functionality.
498
499	  All drivers in the Linux kernel tree that require this function
500	  should automatically select this option.  Say N unless you
501	  are compiling an out-of tree driver which tells you that it
502	  depends on this.
503
504config GLOB_SELFTEST
505	tristate "glob self-test on init"
506	depends on GLOB
507	help
508	  This option enables a simple self-test of the glob_match
509	  function on startup.	It is primarily useful for people
510	  working on the code to ensure they haven't introduced any
511	  regressions.
512
513	  It only adds a little bit of code and slows kernel boot (or
514	  module load) by a small amount, so you're welcome to play with
515	  it, but you probably don't need it.
516
517#
518# Netlink attribute parsing support is select'ed if needed
519#
520config NLATTR
521	bool
522
523#
524# Generic 64-bit atomic support is selected if needed
525#
526config GENERIC_ATOMIC64
527       bool
528
529config LRU_CACHE
530	tristate
531
532config CLZ_TAB
533	bool
534
535config IRQ_POLL
536	bool "IRQ polling library"
537	help
538	  Helper library to poll interrupt mitigation using polling.
539
540config MPILIB
541	tristate
542	select CLZ_TAB
543	help
544	  Multiprecision maths library from GnuPG.
545	  It is used to implement RSA digital signature verification,
546	  which is used by IMA/EVM digital signature extension.
547
548config SIGNATURE
549	tristate
550	depends on KEYS
551	select CRYPTO
552	select CRYPTO_SHA1
553	select MPILIB
554	help
555	  Digital signature verification. Currently only RSA is supported.
556	  Implementation is done using GnuPG MPI library
557
558config DIMLIB
559	tristate
560	depends on NET
561	help
562	  Dynamic Interrupt Moderation library.
563	  Implements an algorithm for dynamically changing CQ moderation values
564	  according to run time performance.
565
566#
567# libfdt files, only selected if needed.
568#
569config LIBFDT
570	bool
571
572config OID_REGISTRY
573	tristate
574	help
575	  Enable fast lookup object identifier registry.
576
577config UCS2_STRING
578	tristate
579
580#
581# generic vdso
582#
583source "lib/vdso/Kconfig"
584
585source "lib/fonts/Kconfig"
586
587config SG_SPLIT
588	def_bool n
589	help
590	 Provides a helper to split scatterlists into chunks, each chunk being
591	 a scatterlist. This should be selected by a driver or an API which
592	 whishes to split a scatterlist amongst multiple DMA channels.
593
594config SG_POOL
595	def_bool n
596	help
597	 Provides a helper to allocate chained scatterlists. This should be
598	 selected by a driver or an API which whishes to allocate chained
599	 scatterlist.
600
601#
602# sg chaining option
603#
604
605config ARCH_NO_SG_CHAIN
606	def_bool n
607
608config ARCH_HAS_PMEM_API
609	bool
610
611config MEMREGION
612	bool
613
614config ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
615	bool
616
617config ARCH_HAS_MEMREMAP_COMPAT_ALIGN
618	bool
619
620# use memcpy to implement user copies for nommu architectures
621config UACCESS_MEMCPY
622	bool
623
624config ARCH_HAS_UACCESS_FLUSHCACHE
625	bool
626
627# arch has a concept of a recoverable synchronous exception due to a
628# memory-read error like x86 machine-check or ARM data-abort, and
629# implements copy_mc_to_{user,kernel} to abort and report
630# 'bytes-transferred' if that exception fires when accessing the source
631# buffer.
632config ARCH_HAS_COPY_MC
633	bool
634
635# Temporary. Goes away when all archs are cleaned up
636config ARCH_STACKWALK
637       bool
638
639config STACKDEPOT
640	bool
641	select STACKTRACE
642	help
643	  Stack depot: stack trace storage that avoids duplication
644
645config STACKDEPOT_ALWAYS_INIT
646	bool
647	select STACKDEPOT
648	help
649	  Always initialize stack depot during early boot
650
651config STACKDEPOT_MAX_FRAMES
652	int "Maximum number of frames in trace saved in stack depot"
653	range 1 256
654	default 64
655	depends on STACKDEPOT
656
657config REF_TRACKER
658	bool
659	depends on STACKTRACE_SUPPORT
660	select STACKDEPOT
661
662config SBITMAP
663	bool
664
665config PARMAN
666	tristate "parman" if COMPILE_TEST
667
668config OBJAGG
669	tristate "objagg" if COMPILE_TEST
670
671config LWQ_TEST
672	bool "Boot-time test for lwq queuing"
673	help
674          Run boot-time test of light-weight queuing.
675
676endmenu
677
678config GENERIC_IOREMAP
679	bool
680
681config GENERIC_LIB_ASHLDI3
682	bool
683
684config GENERIC_LIB_ASHRDI3
685	bool
686
687config GENERIC_LIB_LSHRDI3
688	bool
689
690config GENERIC_LIB_MULDI3
691	bool
692
693config GENERIC_LIB_CMPDI2
694	bool
695
696config GENERIC_LIB_UCMPDI2
697	bool
698
699config GENERIC_LIB_DEVMEM_IS_ALLOWED
700	bool
701
702config PLDMFW
703	bool
704	default n
705
706config ASN1_ENCODER
707       tristate
708
709config POLYNOMIAL
710       tristate
711
712config FIRMWARE_TABLE
713	bool
714
715config UNION_FIND
716	bool
717
718config MIN_HEAP
719	bool
720