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