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