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