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