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