xref: /linux/lib/Kconfig (revision 00751d655ece97fe85ce9193542ee8396fe98651)
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	select GENERIC_BITREVERSE if !HAVE_ARCH_BITREVERSE
58
59config HAVE_ARCH_BITREVERSE
60	bool
61	default n
62	depends on BITREVERSE
63	help
64	  This option enables the use of hardware bit-reversal instructions on
65	  architectures which support such operations.
66
67config GENERIC_BITREVERSE
68	tristate
69	depends on BITREVERSE
70	help
71	  Generic bit reversal implementation. Drivers should never enable
72	  it explicitly. Instead, enable BITREVERSE.
73
74	  Architectures may want to select it as a fall-back option for
75	  HAVE_ARCH_BITREVERSE, when the hardware-accelerated bit reverse
76	  instruction set is optional, like RISC-V ZBKB extension.
77
78config ARCH_HAS_STRNCPY_FROM_USER
79	bool
80
81config ARCH_HAS_STRNLEN_USER
82	bool
83
84config GENERIC_STRNCPY_FROM_USER
85	def_bool !ARCH_HAS_STRNCPY_FROM_USER
86
87config GENERIC_STRNLEN_USER
88	def_bool !ARCH_HAS_STRNLEN_USER
89
90config GENERIC_NET_UTILS
91	bool
92
93source "lib/math/Kconfig"
94
95config NO_GENERIC_PCI_IOPORT_MAP
96	bool
97
98config GENERIC_IOMAP
99	bool
100	select GENERIC_PCI_IOMAP
101
102config STMP_DEVICE
103	bool
104
105config ARCH_USE_CMPXCHG_LOCKREF
106	bool
107
108config ARCH_HAS_FAST_MULTIPLIER
109	bool
110
111config ARCH_USE_SYM_ANNOTATIONS
112	bool
113
114config INDIRECT_PIO
115	bool "Access I/O in non-MMIO mode"
116	depends on ARM64
117	depends on HAS_IOPORT
118	help
119	  On some platforms where no separate I/O space exists, there are I/O
120	  hosts which can not be accessed in MMIO mode. Using the logical PIO
121	  mechanism, the host-local I/O resource can be mapped into system
122	  logic PIO space shared with MMIO hosts, such as PCI/PCIe, then the
123	  system can access the I/O devices with the mapped-logic PIO through
124	  I/O accessors.
125
126	  This way has relatively little I/O performance cost. Please make
127	  sure your devices really need this configure item enabled.
128
129	  When in doubt, say N.
130
131config INDIRECT_IOMEM
132	bool
133	help
134	  This is selected by other options/architectures to provide the
135	  emulated iomem accessors.
136
137config INDIRECT_IOMEM_FALLBACK
138	bool
139	depends on INDIRECT_IOMEM
140	help
141	  If INDIRECT_IOMEM is selected, this enables falling back to plain
142	  mmio accesses when the IO memory address is not a registered
143	  emulated region.
144
145config TRACE_MMIO_ACCESS
146	bool "Register read/write tracing"
147	depends on TRACING && ARCH_HAVE_TRACE_MMIO_ACCESS
148	help
149	  Create tracepoints for MMIO read/write operations. These trace events
150	  can be used for logging all MMIO read/write operations.
151
152source "lib/crc/Kconfig"
153source "lib/crypto/Kconfig"
154source "lib/raid/Kconfig"
155
156config XXHASH
157	tristate
158
159config AUDIT_GENERIC
160	bool
161	depends on AUDIT && !AUDIT_ARCH
162	default y
163
164config AUDIT_ARCH_COMPAT_GENERIC
165	bool
166	default n
167
168config AUDIT_COMPAT_GENERIC
169	bool
170	depends on AUDIT_GENERIC && AUDIT_ARCH_COMPAT_GENERIC && COMPAT
171	default y
172
173config RANDOM32_SELFTEST
174	bool "PRNG perform self test on init"
175	help
176	  This option enables the 32 bit PRNG library functions to perform a
177	  self test on initialization.
178
179#
180# compression support is select'ed if needed
181#
182config 842_COMPRESS
183	select CRC32
184	tristate
185
186config 842_DECOMPRESS
187	select CRC32
188	tristate
189
190config ZLIB_INFLATE
191	tristate
192
193config ZLIB_DEFLATE
194	tristate
195	select BITREVERSE
196
197config ZLIB_DFLTCC
198	def_bool y
199	depends on S390
200	prompt "Enable s390x DEFLATE CONVERSION CALL support for kernel zlib"
201	help
202	 Enable s390x hardware support for zlib in the kernel.
203
204config LZO_COMPRESS
205	tristate
206
207config LZO_DECOMPRESS
208	tristate
209
210config LZ4_COMPRESS
211	tristate
212
213config LZ4HC_COMPRESS
214	tristate
215
216config LZ4_DECOMPRESS
217	tristate
218
219config ZSTD_COMMON
220	select XXHASH
221	tristate
222
223config ZSTD_COMPRESS
224	select ZSTD_COMMON
225	tristate
226
227config ZSTD_DECOMPRESS
228	select ZSTD_COMMON
229	tristate
230
231source "lib/xz/Kconfig"
232
233#
234# These all provide a common interface (hence the apparent duplication with
235# ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.)
236#
237config DECOMPRESS_GZIP
238	select ZLIB_INFLATE
239	tristate
240
241config DECOMPRESS_BZIP2
242	tristate
243
244config DECOMPRESS_LZMA
245	tristate
246
247config DECOMPRESS_XZ
248	select XZ_DEC
249	tristate
250
251config DECOMPRESS_LZO
252	select LZO_DECOMPRESS
253	tristate
254
255config DECOMPRESS_LZ4
256	select LZ4_DECOMPRESS
257	tristate
258
259config DECOMPRESS_ZSTD
260	select ZSTD_DECOMPRESS
261	tristate
262
263#
264# Generic allocator support is selected if needed
265#
266config GENERIC_ALLOCATOR
267	bool
268
269#
270# reed solomon support is select'ed if needed
271#
272config REED_SOLOMON
273	tristate
274
275config REED_SOLOMON_ENC8
276	bool
277
278config REED_SOLOMON_DEC8
279	bool
280
281config REED_SOLOMON_ENC16
282	bool
283
284config REED_SOLOMON_DEC16
285	bool
286
287#
288# BCH support is selected if needed
289#
290config BCH
291	tristate
292	select BITREVERSE
293
294config BCH_CONST_PARAMS
295	bool
296	help
297	  Drivers may select this option to force specific constant
298	  values for parameters 'm' (Galois field order) and 't'
299	  (error correction capability). Those specific values must
300	  be set by declaring default values for symbols BCH_CONST_M
301	  and BCH_CONST_T.
302	  Doing so will enable extra compiler optimizations,
303	  improving encoding and decoding performance up to 2x for
304	  usual (m,t) values (typically such that m*t < 200).
305	  When this option is selected, the BCH library supports
306	  only a single (m,t) configuration. This is mainly useful
307	  for NAND flash board drivers requiring known, fixed BCH
308	  parameters.
309
310config BCH_CONST_M
311	int
312	range 5 15
313	help
314	  Constant value for Galois field order 'm'. If 'k' is the
315	  number of data bits to protect, 'm' should be chosen such
316	  that (k + m*t) <= 2**m - 1.
317	  Drivers should declare a default value for this symbol if
318	  they select option BCH_CONST_PARAMS.
319
320config BCH_CONST_T
321	int
322	help
323	  Constant value for error correction capability in bits 't'.
324	  Drivers should declare a default value for this symbol if
325	  they select option BCH_CONST_PARAMS.
326
327#
328# Textsearch support is select'ed if needed
329#
330config TEXTSEARCH
331	bool
332
333config TEXTSEARCH_KMP
334	tristate
335
336config TEXTSEARCH_BM
337	tristate
338
339config TEXTSEARCH_FSM
340	tristate
341
342config BTREE
343	bool
344
345config INTERVAL_TREE
346	bool
347	help
348	  Simple, embeddable, interval-tree. Can find the start of an
349	  overlapping range in log(n) time and then iterate over all
350	  overlapping nodes. The algorithm is implemented as an
351	  augmented rbtree.
352
353	  See:
354
355		Documentation/core-api/rbtree.rst
356
357	  for more information.
358
359config INTERVAL_TREE_SPAN_ITER
360	bool
361	depends on INTERVAL_TREE
362
363config XARRAY_MULTI
364	bool
365	help
366	  Support entries which occupy multiple consecutive indices in the
367	  XArray.
368
369config ASSOCIATIVE_ARRAY
370	bool
371	help
372	  Generic associative array.  Can be searched and iterated over whilst
373	  it is being modified.  It is also reasonably quick to search and
374	  modify.  The algorithms are non-recursive, and the trees are highly
375	  capacious.
376
377	  See:
378
379		Documentation/core-api/assoc_array.rst
380
381	  for more information.
382
383config CLOSURES
384	bool
385
386config HAS_IOMEM
387	bool
388	depends on !NO_IOMEM
389	default y
390
391config HAS_IOPORT
392	bool
393
394config HAS_IOPORT_MAP
395	bool
396	depends on HAS_IOMEM && !NO_IOPORT_MAP
397	default y
398
399source "kernel/dma/Kconfig"
400
401config SGL_ALLOC
402	bool
403	default n
404
405config IOMMU_HELPER
406	bool
407
408config CHECK_SIGNATURE
409	bool
410
411config CPUMASK_OFFSTACK
412	bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS
413	help
414	  Use dynamic allocation for cpumask_var_t, instead of putting
415	  them on the stack.  This is a bit more expensive, but avoids
416	  stack overflow.
417
418config FORCE_NR_CPUS
419	def_bool !SMP
420
421config CPU_RMAP
422	bool
423	depends on SMP
424
425config DQL
426	bool
427
428config GLOB
429	bool
430#	This actually supports modular compilation, but the module overhead
431#	is ridiculous for the amount of code involved.	Until an out-of-tree
432#	driver asks for it, we'll just link it directly it into the kernel
433#	when required.  Since we're ignoring out-of-tree users,	there's also
434#	no need bother prompting for a manual decision:
435#	prompt "glob_match() function"
436	help
437	  This option provides a glob_match function for performing
438	  simple text pattern matching.  It originated in the ATA code
439	  to blacklist particular drive models, but other device drivers
440	  may need similar functionality.
441
442	  All drivers in the Linux kernel tree that require this function
443	  should automatically select this option.  Say N unless you
444	  are compiling an out-of tree driver which tells you that it
445	  depends on this.
446
447#
448# Netlink attribute parsing support is select'ed if needed
449#
450config NLATTR
451	bool
452
453#
454# Generic 64-bit atomic support is selected if needed
455#
456config GENERIC_ATOMIC64
457       bool
458
459config LRU_CACHE
460	tristate
461
462config CLZ_TAB
463	bool
464
465config IRQ_POLL
466	bool "IRQ polling library"
467	help
468	  Helper library to poll interrupt mitigation using polling.
469
470config MPILIB
471	tristate
472	select CLZ_TAB
473	help
474	  Multiprecision maths library from GnuPG.
475	  It is used to implement RSA digital signature verification,
476	  which is used by IMA/EVM digital signature extension.
477
478config SIGNATURE
479	tristate
480	depends on KEYS
481	select CRYPTO_LIB_SHA1
482	select MPILIB
483	help
484	  Digital signature verification. Currently only RSA is supported.
485	  Implementation is done using GnuPG MPI library
486
487config DIMLIB
488	tristate
489	depends on NET
490	help
491	  Dynamic Interrupt Moderation library.
492	  Implements an algorithm for dynamically changing CQ moderation values
493	  according to run time performance.
494
495#
496# libfdt files, only selected if needed.
497#
498config LIBFDT
499	bool
500
501config OID_REGISTRY
502	tristate
503	help
504	  Enable fast lookup object identifier registry.
505
506config UCS2_STRING
507	tristate
508
509#
510# generic vdso
511#
512source "lib/vdso/Kconfig"
513
514source "lib/fonts/Kconfig"
515
516config SG_SPLIT
517	def_bool n
518	help
519	 Provides a helper to split scatterlists into chunks, each chunk being
520	 a scatterlist. This should be selected by a driver or an API which
521	 whishes to split a scatterlist amongst multiple DMA channels.
522
523config SG_POOL
524	def_bool n
525	help
526	 Provides a helper to allocate chained scatterlists. This should be
527	 selected by a driver or an API which whishes to allocate chained
528	 scatterlist.
529
530#
531# sg chaining option
532#
533
534config ARCH_NO_SG_CHAIN
535	def_bool n
536
537config ARCH_HAS_PMEM_API
538	bool
539
540config MEMREGION
541	bool
542
543config ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
544	bool
545
546config GENERIC_CPU_CACHE_MAINTENANCE
547	bool
548
549config ARCH_HAS_MEMREMAP_COMPAT_ALIGN
550	bool
551
552# use memcpy to implement user copies for nommu architectures
553config UACCESS_MEMCPY
554	bool
555
556config ARCH_HAS_UACCESS_FLUSHCACHE
557	bool
558
559# arch has a concept of a recoverable synchronous exception due to a
560# memory-read error like x86 machine-check or ARM data-abort, and
561# implements copy_mc_to_{user,kernel} to abort and report
562# 'bytes-transferred' if that exception fires when accessing the source
563# buffer.
564config ARCH_HAS_COPY_MC
565	bool
566
567# Temporary. Goes away when all archs are cleaned up
568config ARCH_STACKWALK
569       bool
570
571config STACKDEPOT
572	bool
573	select STACKTRACE
574	help
575	  Stack depot: stack trace storage that avoids duplication
576
577config STACKDEPOT_ALWAYS_INIT
578	bool
579	select STACKDEPOT
580	help
581	  Always initialize stack depot during early boot
582
583config STACKDEPOT_MAX_FRAMES
584	int "Maximum number of frames in trace saved in stack depot"
585	range 1 256
586	default 64
587	depends on STACKDEPOT
588
589config REF_TRACKER
590	bool
591	depends on STACKTRACE_SUPPORT
592	select STACKDEPOT
593
594config SBITMAP
595	bool
596
597config PARMAN
598	tristate "parman" if COMPILE_TEST
599
600config OBJAGG
601	tristate "objagg" if COMPILE_TEST
602
603config LWQ_TEST
604	bool "Boot-time test for lwq queuing"
605	help
606          Run boot-time test of light-weight queuing.
607
608endmenu
609
610config GENERIC_IOREMAP
611	bool
612
613config GENERIC_LIB_ASHLDI3
614	bool
615
616config GENERIC_LIB_ASHRDI3
617	bool
618
619config GENERIC_LIB_LSHRDI3
620	bool
621
622config GENERIC_LIB_MULDI3
623	bool
624
625config GENERIC_LIB_CMPDI2
626	bool
627
628config GENERIC_LIB_UCMPDI2
629	bool
630
631config GENERIC_LIB_DEVMEM_IS_ALLOWED
632	bool
633
634config PLDMFW
635	bool
636	select CRC32
637	default n
638
639config ASN1_ENCODER
640       tristate
641
642config FIRMWARE_TABLE
643	bool
644
645config UNION_FIND
646	bool
647
648config MIN_HEAP
649	bool
650