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