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