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