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