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