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