xref: /linux/init/Kconfig (revision 8934827db5403eae57d4537114a9ff88b0a8460f)
1# SPDX-License-Identifier: GPL-2.0-only
2config CC_VERSION_TEXT
3	string
4	default "$(CC_VERSION_TEXT)"
5	help
6	  This is used in unclear ways:
7
8	  - Re-run Kconfig when the compiler is updated
9	    The 'default' property references the environment variable,
10	    CC_VERSION_TEXT so it is recorded in include/config/auto.conf.cmd.
11	    When the compiler is updated, Kconfig will be invoked.
12
13	  - Ensure full rebuild when the compiler is updated
14	    include/linux/compiler-version.h contains this option in the comment
15	    line so fixdep adds include/config/CC_VERSION_TEXT into the
16	    auto-generated dependency. When the compiler is updated, syncconfig
17	    will touch it and then every file will be rebuilt.
18
19config CC_IS_GCC
20	def_bool $(success,test "$(cc-name)" = GCC)
21
22config GCC_VERSION
23	int
24	default $(cc-version) if CC_IS_GCC
25	default 0
26
27config CC_IS_CLANG
28	def_bool $(success,test "$(cc-name)" = Clang)
29
30config CLANG_VERSION
31	int
32	default $(cc-version) if CC_IS_CLANG
33	default 0
34
35config AS_IS_GNU
36	def_bool $(success,test "$(as-name)" = GNU)
37
38config AS_IS_LLVM
39	def_bool $(success,test "$(as-name)" = LLVM)
40
41config AS_VERSION
42	int
43	# Use clang version if this is the integrated assembler
44	default CLANG_VERSION if AS_IS_LLVM
45	default $(as-version)
46
47config LD_IS_BFD
48	def_bool $(success,test "$(ld-name)" = BFD)
49
50config LD_VERSION
51	int
52	default $(ld-version) if LD_IS_BFD
53	default 0
54
55config LD_IS_LLD
56	def_bool $(success,test "$(ld-name)" = LLD)
57
58config LLD_VERSION
59	int
60	default $(ld-version) if LD_IS_LLD
61	default 0
62
63config RUSTC_VERSION
64	int
65	default $(rustc-version)
66	help
67	  It does not depend on `RUST` since that one may need to use the version
68	  in a `depends on`.
69
70config RUST_IS_AVAILABLE
71	def_bool $(success,$(srctree)/scripts/rust_is_available.sh)
72	help
73	  This shows whether a suitable Rust toolchain is available (found).
74
75	  Please see Documentation/rust/quick-start.rst for instructions on how
76	  to satisfy the build requirements of Rust support.
77
78	  In particular, the Makefile target 'rustavailable' is useful to check
79	  why the Rust toolchain is not being detected.
80
81config RUSTC_LLVM_VERSION
82	int
83	default $(rustc-llvm-version)
84
85config ARCH_HAS_CC_CAN_LINK
86	bool
87
88config CC_CAN_LINK
89	bool
90	default ARCH_CC_CAN_LINK if ARCH_HAS_CC_CAN_LINK
91	default $(cc_can_link_user,$(m64-flag)) if 64BIT
92	default $(cc_can_link_user,$(m32-flag))
93
94# Fixed in GCC 14, 13.3, 12.4 and 11.5
95# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
96config GCC_ASM_GOTO_OUTPUT_BROKEN
97	bool
98	depends on CC_IS_GCC
99	default y if GCC_VERSION < 110500
100	default y if GCC_VERSION >= 120000 && GCC_VERSION < 120400
101	default y if GCC_VERSION >= 130000 && GCC_VERSION < 130300
102
103config CC_HAS_ASM_GOTO_OUTPUT
104	def_bool y
105	depends on !GCC_ASM_GOTO_OUTPUT_BROKEN
106	# Detect basic support
107	depends on $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
108	# Detect clang (< v17) scoped label issues
109	depends on $(success,echo 'void b(void **);void* c(void);int f(void){{asm goto(""::::l0);return 0;l0:return 1;}void *x __attribute__((cleanup(b)))=c();{asm goto(""::::l1);return 2;l1:return 3;}}' | $(CC) -x c - -c -o /dev/null)
110
111config CC_HAS_ASM_GOTO_TIED_OUTPUT
112	depends on CC_HAS_ASM_GOTO_OUTPUT
113	# Detect buggy gcc and clang, fixed in gcc-11 clang-14.
114	def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null)
115
116config TOOLS_SUPPORT_RELR
117	def_bool $(success,env "CC=$(CC)" "LD=$(LD)" "NM=$(NM)" "OBJCOPY=$(OBJCOPY)" $(srctree)/scripts/tools-support-relr.sh)
118
119config CC_HAS_ASM_INLINE
120	def_bool $(success,echo 'void foo(void) { asm inline (""); }' | $(CC) -x c - -c -o /dev/null)
121
122config CC_HAS_ASSUME
123	bool
124	# clang needs to be at least 19.1.0 since the meaning of the assume
125	# attribute changed:
126	# https://github.com/llvm/llvm-project/commit/c44fa3e8a9a44c2e9a575768a3c185354b9f6c17
127	default y if CC_IS_CLANG && CLANG_VERSION >= 190100
128	# supported since gcc 13.1.0
129	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106654
130	default y if CC_IS_GCC && GCC_VERSION >= 130100
131
132config CC_HAS_NO_PROFILE_FN_ATTR
133	def_bool $(success,echo '__attribute__((no_profile_instrument_function)) int x();' | $(CC) -x c - -c -o /dev/null -Werror)
134
135config CC_HAS_COUNTED_BY
136	bool
137	# clang needs to be at least 20.1.0 to avoid potential crashes
138	# when building structures that contain __counted_by
139	# https://github.com/ClangBuiltLinux/linux/issues/2114
140	# https://github.com/llvm/llvm-project/commit/160fb1121cdf703c3ef5e61fb26c5659eb581489
141	default y if CC_IS_CLANG && CLANG_VERSION >= 200100
142	# supported since gcc 15.1.0
143	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896
144	default y if CC_IS_GCC && GCC_VERSION >= 150100
145
146config CC_HAS_COUNTED_BY_PTR
147	bool
148	# supported since clang 22
149	default y if CC_IS_CLANG && CLANG_VERSION >= 220000
150	# supported since gcc 16.0.0
151	default y if CC_IS_GCC && GCC_VERSION >= 160000
152
153config CC_HAS_BROKEN_COUNTED_BY_REF
154	bool
155	# https://github.com/llvm/llvm-project/issues/182575
156	default y if CC_IS_CLANG && CLANG_VERSION < 220000
157
158config CC_HAS_MULTIDIMENSIONAL_NONSTRING
159	def_bool $(success,echo 'char tag[][4] __attribute__((__nonstring__)) = { };' | $(CC) $(CLANG_FLAGS) -x c - -c -o /dev/null -Werror)
160
161config LD_CAN_USE_KEEP_IN_OVERLAY
162	# ld.lld prior to 21.0.0 did not support KEEP within an overlay description
163	# https://github.com/llvm/llvm-project/pull/130661
164	def_bool LD_IS_BFD || LLD_VERSION >= 210000
165
166config RUSTC_HAS_SLICE_AS_FLATTENED
167	def_bool RUSTC_VERSION >= 108000
168
169config RUSTC_HAS_COERCE_POINTEE
170	def_bool RUSTC_VERSION >= 108400
171
172config RUSTC_HAS_SPAN_FILE
173	def_bool RUSTC_VERSION >= 108800
174
175config RUSTC_HAS_UNNECESSARY_TRANSMUTES
176	def_bool RUSTC_VERSION >= 108800
177
178config RUSTC_HAS_FILE_WITH_NUL
179	def_bool RUSTC_VERSION >= 108900
180
181config RUSTC_HAS_FILE_AS_C_STR
182	def_bool RUSTC_VERSION >= 109100
183
184config PAHOLE_VERSION
185	int
186	default "$(PAHOLE_VERSION)"
187
188config CONSTRUCTORS
189	bool
190
191config IRQ_WORK
192	def_bool y if SMP
193
194config BUILDTIME_TABLE_SORT
195	bool
196
197config THREAD_INFO_IN_TASK
198	bool
199	help
200	  Select this to move thread_info off the stack into task_struct.  To
201	  make this work, an arch will need to remove all thread_info fields
202	  except flags and fix any runtime bugs.
203
204	  One subtle change that will be needed is to use try_get_task_stack()
205	  and put_task_stack() in save_thread_stack_tsk() and get_wchan().
206
207menu "General setup"
208
209config BROKEN
210	bool
211	help
212	  This option allows you to choose whether you want to try to
213	  compile (and fix) old drivers that haven't been updated to
214	  new infrastructure.
215
216config BROKEN_ON_SMP
217	bool
218	depends on BROKEN || !SMP
219	default y
220
221config INIT_ENV_ARG_LIMIT
222	int
223	default 32 if !UML
224	default 128 if UML
225	help
226	  Maximum of each of the number of arguments and environment
227	  variables passed to init from the kernel command line.
228
229config COMPILE_TEST
230	bool "Compile also drivers which will not load"
231	depends on HAS_IOMEM
232	help
233	  Some drivers can be compiled on a different platform than they are
234	  intended to be run on. Despite they cannot be loaded there (or even
235	  when they load they cannot be used due to missing HW support),
236	  developers still, opposing to distributors, might want to build such
237	  drivers to compile-test them.
238
239	  If you are a developer and want to build everything available, say Y
240	  here. If you are a user/distributor, say N here to exclude useless
241	  drivers to be distributed.
242
243config WERROR
244	bool "Compile the kernel with warnings as errors"
245	default COMPILE_TEST
246	help
247	  A kernel build should not cause any compiler warnings, and this
248	  enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
249	  to enforce that rule by default. Certain warnings from other tools
250	  such as the linker may be upgraded to errors with this option as
251	  well.
252
253	  However, if you have a new (or very old) compiler or linker with odd
254	  and unusual warnings, or you have some architecture with problems,
255	  you may need to disable this config option in order to
256	  successfully build the kernel.
257
258	  If in doubt, say Y.
259
260config UAPI_HEADER_TEST
261	bool "Compile test UAPI headers"
262	depends on HEADERS_INSTALL
263	help
264	  Compile test headers exported to user-space to ensure they are
265	  self-contained, i.e. compilable as standalone units.
266
267	  If you are a developer or tester and want to ensure the exported
268	  headers are self-contained, say Y here. Otherwise, choose N.
269
270config LOCALVERSION
271	string "Local version - append to kernel release"
272	help
273	  Append an extra string to the end of your kernel version.
274	  This will show up when you type uname, for example.
275	  The string you set here will be appended after the contents of
276	  any files with a filename matching localversion* in your
277	  object and source tree, in that order.  Your total string can
278	  be a maximum of 64 characters.
279
280config LOCALVERSION_AUTO
281	bool "Automatically append version information to the version string"
282	default y
283	depends on !COMPILE_TEST
284	help
285	  This will try to automatically determine if the current tree is a
286	  release tree by looking for git tags that belong to the current
287	  top of tree revision.
288
289	  A string of the format -gxxxxxxxx will be added to the localversion
290	  if a git-based tree is found.  The string generated by this will be
291	  appended after any matching localversion* files, and after the value
292	  set in CONFIG_LOCALVERSION.
293
294	  (The actual string used here is the first 12 characters produced
295	  by running the command:
296
297	    $ git rev-parse --verify HEAD
298
299	  which is done within the script "scripts/setlocalversion".)
300
301config BUILD_SALT
302	string "Build ID Salt"
303	default ""
304	help
305	  The build ID is used to link binaries and their debug info. Setting
306	  this option will use the value in the calculation of the build id.
307	  This is mostly useful for distributions which want to ensure the
308	  build is unique between builds. It's safe to leave the default.
309
310config HAVE_KERNEL_GZIP
311	bool
312
313config HAVE_KERNEL_BZIP2
314	bool
315
316config HAVE_KERNEL_LZMA
317	bool
318
319config HAVE_KERNEL_XZ
320	bool
321
322config HAVE_KERNEL_LZO
323	bool
324
325config HAVE_KERNEL_LZ4
326	bool
327
328config HAVE_KERNEL_ZSTD
329	bool
330
331config HAVE_KERNEL_UNCOMPRESSED
332	bool
333
334choice
335	prompt "Kernel compression mode"
336	default KERNEL_GZIP
337	depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO || HAVE_KERNEL_LZ4 || HAVE_KERNEL_ZSTD || HAVE_KERNEL_UNCOMPRESSED
338	help
339	  The linux kernel is a kind of self-extracting executable.
340	  Several compression algorithms are available, which differ
341	  in efficiency, compression and decompression speed.
342	  Compression speed is only relevant when building a kernel.
343	  Decompression speed is relevant at each boot.
344
345	  If you have any problems with bzip2 or lzma compressed
346	  kernels, mail me (Alain Knaff) <alain@knaff.lu>. (An older
347	  version of this functionality (bzip2 only), for 2.4, was
348	  supplied by Christian Ludwig)
349
350	  High compression options are mostly useful for users, who
351	  are low on disk space (embedded systems), but for whom ram
352	  size matters less.
353
354	  If in doubt, select 'gzip'
355
356config KERNEL_GZIP
357	bool "Gzip"
358	depends on HAVE_KERNEL_GZIP
359	help
360	  The old and tried gzip compression. It provides a good balance
361	  between compression ratio and decompression speed.
362
363config KERNEL_BZIP2
364	bool "Bzip2"
365	depends on HAVE_KERNEL_BZIP2
366	help
367	  Its compression ratio and speed is intermediate.
368	  Decompression speed is slowest among the choices.  The kernel
369	  size is about 10% smaller with bzip2, in comparison to gzip.
370	  Bzip2 uses a large amount of memory. For modern kernels you
371	  will need at least 8MB RAM or more for booting.
372
373config KERNEL_LZMA
374	bool "LZMA"
375	depends on HAVE_KERNEL_LZMA
376	help
377	  This compression algorithm's ratio is best.  Decompression speed
378	  is between gzip and bzip2.  Compression is slowest.
379	  The kernel size is about 33% smaller with LZMA in comparison to gzip.
380
381config KERNEL_XZ
382	bool "XZ"
383	depends on HAVE_KERNEL_XZ
384	help
385	  XZ uses the LZMA2 algorithm and instruction set specific
386	  BCJ filters which can improve compression ratio of executable
387	  code. The size of the kernel is about 30% smaller with XZ in
388	  comparison to gzip. On architectures for which there is a BCJ
389	  filter (i386, x86_64, ARM, ARM64, RISC-V, big endian PowerPC,
390	  and SPARC), XZ will create a few percent smaller kernel than
391	  plain LZMA.
392
393	  The speed is about the same as with LZMA: The decompression
394	  speed of XZ is better than that of bzip2 but worse than gzip
395	  and LZO. Compression is slow.
396
397config KERNEL_LZO
398	bool "LZO"
399	depends on HAVE_KERNEL_LZO
400	help
401	  Its compression ratio is the poorest among the choices. The kernel
402	  size is about 10% bigger than gzip; however its speed
403	  (both compression and decompression) is the fastest.
404
405config KERNEL_LZ4
406	bool "LZ4"
407	depends on HAVE_KERNEL_LZ4
408	help
409	  LZ4 is an LZ77-type compressor with a fixed, byte-oriented encoding.
410	  A preliminary version of LZ4 de/compression tool is available at
411	  <https://code.google.com/p/lz4/>.
412
413	  Its compression ratio is worse than LZO. The size of the kernel
414	  is about 8% bigger than LZO. But the decompression speed is
415	  faster than LZO.
416
417config KERNEL_ZSTD
418	bool "ZSTD"
419	depends on HAVE_KERNEL_ZSTD
420	help
421	  ZSTD is a compression algorithm targeting intermediate compression
422	  with fast decompression speed. It will compress better than GZIP and
423	  decompress around the same speed as LZO, but slower than LZ4. You
424	  will need at least 192 KB RAM or more for booting. The zstd command
425	  line tool is required for compression.
426
427config KERNEL_UNCOMPRESSED
428	bool "None"
429	depends on HAVE_KERNEL_UNCOMPRESSED
430	help
431	  Produce uncompressed kernel image. This option is usually not what
432	  you want. It is useful for debugging the kernel in slow simulation
433	  environments, where decompressing and moving the kernel is awfully
434	  slow. This option allows early boot code to skip the decompressor
435	  and jump right at uncompressed kernel image.
436
437endchoice
438
439config DEFAULT_INIT
440	string "Default init path"
441	default ""
442	help
443	  This option determines the default init for the system if no init=
444	  option is passed on the kernel command line. If the requested path is
445	  not present, we will still then move on to attempting further
446	  locations (e.g. /sbin/init, etc). If this is empty, we will just use
447	  the fallback list when init= is not passed.
448
449config DEFAULT_HOSTNAME
450	string "Default hostname"
451	default "(none)"
452	help
453	  This option determines the default system hostname before userspace
454	  calls sethostname(2). The kernel traditionally uses "(none)" here,
455	  but you may wish to use a different default here to make a minimal
456	  system more usable with less configuration.
457
458config SYSVIPC
459	bool "System V IPC"
460	help
461	  Inter Process Communication is a suite of library functions and
462	  system calls which let processes (running programs) synchronize and
463	  exchange information. It is generally considered to be a good thing,
464	  and some programs won't run unless you say Y here. In particular, if
465	  you want to run the DOS emulator dosemu under Linux (read the
466	  DOSEMU-HOWTO, available from <http://www.tldp.org/docs.html#howto>),
467	  you'll need to say Y here.
468
469	  You can find documentation about IPC with "info ipc" and also in
470	  section 6.4 of the Linux Programmer's Guide, available from
471	  <http://www.tldp.org/guides.html>.
472
473config SYSVIPC_SYSCTL
474	bool
475	depends on SYSVIPC
476	depends on SYSCTL
477	default y
478
479config SYSVIPC_COMPAT
480	def_bool y
481	depends on COMPAT && SYSVIPC
482
483config POSIX_MQUEUE
484	bool "POSIX Message Queues"
485	depends on NET
486	help
487	  POSIX variant of message queues is a part of IPC. In POSIX message
488	  queues every message has a priority which decides about succession
489	  of receiving it by a process. If you want to compile and run
490	  programs written e.g. for Solaris with use of its POSIX message
491	  queues (functions mq_*) say Y here.
492
493	  POSIX message queues are visible as a filesystem called 'mqueue'
494	  and can be mounted somewhere if you want to do filesystem
495	  operations on message queues.
496
497	  If unsure, say Y.
498
499config POSIX_MQUEUE_SYSCTL
500	bool
501	depends on POSIX_MQUEUE
502	depends on SYSCTL
503	default y
504
505config WATCH_QUEUE
506	bool "General notification queue"
507	default n
508	help
509
510	  This is a general notification queue for the kernel to pass events to
511	  userspace by splicing them into pipes.  It can be used in conjunction
512	  with watches for key/keyring change notifications and device
513	  notifications.
514
515	  See Documentation/core-api/watch_queue.rst
516
517config CROSS_MEMORY_ATTACH
518	bool "Enable process_vm_readv/writev syscalls"
519	depends on MMU
520	default y
521	help
522	  Enabling this option adds the system calls process_vm_readv and
523	  process_vm_writev which allow a process with the correct privileges
524	  to directly read from or write to another process' address space.
525	  See the man page for more details.
526
527config AUDIT
528	bool "Auditing support"
529	depends on NET
530	help
531	  Enable auditing infrastructure that can be used with another
532	  kernel subsystem, such as SELinux (which requires this for
533	  logging of avc messages output).  System call auditing is included
534	  on architectures which support it.
535
536config HAVE_ARCH_AUDITSYSCALL
537	bool
538
539config AUDITSYSCALL
540	def_bool y
541	depends on AUDIT && HAVE_ARCH_AUDITSYSCALL
542	select FSNOTIFY
543
544source "kernel/irq/Kconfig"
545source "kernel/time/Kconfig"
546source "kernel/bpf/Kconfig"
547source "kernel/Kconfig.preempt"
548
549menu "CPU/Task time and stats accounting"
550
551config VIRT_CPU_ACCOUNTING
552	bool
553
554choice
555	prompt "Cputime accounting"
556	default TICK_CPU_ACCOUNTING
557
558# Kind of a stub config for the pure tick based cputime accounting
559config TICK_CPU_ACCOUNTING
560	bool "Simple tick based cputime accounting"
561	depends on !S390 && !NO_HZ_FULL
562	help
563	  This is the basic tick based cputime accounting that maintains
564	  statistics about user, system and idle time spent on per jiffies
565	  granularity.
566
567	  If unsure, say Y.
568
569config VIRT_CPU_ACCOUNTING_NATIVE
570	bool "Deterministic task and CPU time accounting"
571	depends on HAVE_VIRT_CPU_ACCOUNTING && !NO_HZ_FULL
572	select VIRT_CPU_ACCOUNTING
573	help
574	  Select this option to enable more accurate task and CPU time
575	  accounting.  This is done by reading a CPU counter on each
576	  kernel entry and exit and on transitions within the kernel
577	  between system, softirq and hardirq state, so there is a
578	  small performance impact.  In the case of s390 or IBM POWER > 5,
579	  this also enables accounting of stolen time on logically-partitioned
580	  systems.
581
582config VIRT_CPU_ACCOUNTING_GEN
583	bool "Full dynticks CPU time accounting"
584	depends on HAVE_CONTEXT_TRACKING_USER
585	depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
586	depends on GENERIC_CLOCKEVENTS
587	select VIRT_CPU_ACCOUNTING
588	select CONTEXT_TRACKING_USER
589	help
590	  Select this option to enable task and CPU time accounting on full
591	  dynticks systems. This accounting is implemented by watching every
592	  kernel-user boundaries using the context tracking subsystem.
593	  The accounting is thus performed at the expense of some significant
594	  overhead.
595
596	  For now this is only useful if you are working on the full
597	  dynticks subsystem development.
598
599	  If unsure, say N.
600
601endchoice
602
603config IRQ_TIME_ACCOUNTING
604	bool "Fine granularity task level IRQ time accounting"
605	depends on HAVE_IRQ_TIME_ACCOUNTING && !VIRT_CPU_ACCOUNTING_NATIVE
606	help
607	  Select this option to enable fine granularity task irq time
608	  accounting. This is done by reading a timestamp on each
609	  transitions between softirq and hardirq state, so there can be a
610	  small performance impact.
611
612	  If in doubt, say N here.
613
614config HAVE_SCHED_AVG_IRQ
615	def_bool y
616	depends on IRQ_TIME_ACCOUNTING || PARAVIRT_TIME_ACCOUNTING
617	depends on SMP
618
619config SCHED_HW_PRESSURE
620	bool
621	default y if ARM && ARM_CPU_TOPOLOGY
622	default y if ARM64
623	depends on SMP
624	depends on CPU_FREQ_THERMAL
625	help
626	  Select this option to enable HW pressure accounting in the
627	  scheduler. HW pressure is the value conveyed to the scheduler
628	  that reflects the reduction in CPU compute capacity resulted from
629	  HW throttling. HW throttling occurs when the performance of
630	  a CPU is capped due to high operating temperatures as an example.
631
632	  If selected, the scheduler will be able to balance tasks accordingly,
633	  i.e. put less load on throttled CPUs than on non/less throttled ones.
634
635	  This requires the architecture to implement
636	  arch_update_hw_pressure() and arch_scale_thermal_pressure().
637
638config BSD_PROCESS_ACCT
639	bool "BSD Process Accounting (DEPRECATED)"
640	depends on MULTIUSER
641	default n
642	help
643	  If you say Y here, a user level program will be able to instruct the
644	  kernel (via a special system call) to write process accounting
645	  information to a file: whenever a process exits, information about
646	  that process will be appended to the file by the kernel.  The
647	  information includes things such as creation time, owning user,
648	  command name, memory usage, controlling terminal etc. (the complete
649	  list is in the struct acct in <file:include/linux/acct.h>).  It is
650	  up to the user level program to do useful things with this
651	  information.  This mechanism is antiquated and has significant
652	  scalability issues.  You probably want to use eBPF instead.  Say
653	  N unless you really need this.
654
655config BSD_PROCESS_ACCT_V3
656	bool "BSD Process Accounting version 3 file format"
657	depends on BSD_PROCESS_ACCT
658	default n
659	help
660	  If you say Y here, the process accounting information is written
661	  in a new file format that also logs the process IDs of each
662	  process and its parent. Note that this file format is incompatible
663	  with previous v0/v1/v2 file formats, so you will need updated tools
664	  for processing it. A preliminary version of these tools is available
665	  at <http://www.gnu.org/software/acct/>.
666
667config TASKSTATS
668	bool "Export task/process statistics through netlink"
669	depends on NET
670	depends on MULTIUSER
671	default n
672	help
673	  Export selected statistics for tasks/processes through the
674	  generic netlink interface. Unlike BSD process accounting, the
675	  statistics are available during the lifetime of tasks/processes as
676	  responses to commands. Like BSD accounting, they are sent to user
677	  space on task exit.
678
679	  Say N if unsure.
680
681config TASK_DELAY_ACCT
682	bool "Enable per-task delay accounting"
683	depends on TASKSTATS
684	select SCHED_INFO
685	help
686	  Collect information on time spent by a task waiting for system
687	  resources like cpu, synchronous block I/O completion and swapping
688	  in pages. Such statistics can help in setting a task's priorities
689	  relative to other tasks for cpu, io, rss limits etc.
690
691	  Say N if unsure.
692
693config TASK_XACCT
694	bool "Enable extended accounting over taskstats"
695	depends on TASKSTATS
696	help
697	  Collect extended task accounting data and send the data
698	  to userland for processing over the taskstats interface.
699
700	  Say N if unsure.
701
702config TASK_IO_ACCOUNTING
703	bool "Enable per-task storage I/O accounting"
704	depends on TASK_XACCT
705	help
706	  Collect information on the number of bytes of storage I/O which this
707	  task has caused.
708
709	  Say N if unsure.
710
711config PSI
712	bool "Pressure stall information tracking"
713	select KERNFS
714	help
715	  Collect metrics that indicate how overcommitted the CPU, memory,
716	  and IO capacity are in the system.
717
718	  If you say Y here, the kernel will create /proc/pressure/ with the
719	  pressure statistics files cpu, memory, and io. These will indicate
720	  the share of walltime in which some or all tasks in the system are
721	  delayed due to contention of the respective resource.
722
723	  In kernels with cgroup support, cgroups (cgroup2 only) will
724	  have cpu.pressure, memory.pressure, and io.pressure files,
725	  which aggregate pressure stalls for the grouped tasks only.
726
727	  For more details see Documentation/accounting/psi.rst.
728
729	  Say N if unsure.
730
731config PSI_DEFAULT_DISABLED
732	bool "Require boot parameter to enable pressure stall information tracking"
733	default n
734	depends on PSI
735	help
736	  If set, pressure stall information tracking will be disabled
737	  per default but can be enabled through passing psi=1 on the
738	  kernel commandline during boot.
739
740	  This feature adds some code to the task wakeup and sleep
741	  paths of the scheduler. The overhead is too low to affect
742	  common scheduling-intense workloads in practice (such as
743	  webservers, memcache), but it does show up in artificial
744	  scheduler stress tests, such as hackbench.
745
746	  If you are paranoid and not sure what the kernel will be
747	  used for, say Y.
748
749	  Say N if unsure.
750
751endmenu # "CPU/Task time and stats accounting"
752
753config CPU_ISOLATION
754	bool "CPU isolation"
755	depends on SMP
756	default y
757	help
758	  Make sure that CPUs running critical tasks are not disturbed by
759	  any source of "noise" such as unbound workqueues, timers, kthreads...
760	  Unbound jobs get offloaded to housekeeping CPUs. This is driven by
761	  the "isolcpus=" boot parameter.
762
763	  Say Y if unsure.
764
765source "kernel/rcu/Kconfig"
766
767config IKCONFIG
768	tristate "Kernel .config support"
769	help
770	  This option enables the complete Linux kernel ".config" file
771	  contents to be saved in the kernel. It provides documentation
772	  of which kernel options are used in a running kernel or in an
773	  on-disk kernel.  This information can be extracted from the kernel
774	  image file with the script scripts/extract-ikconfig and used as
775	  input to rebuild the current kernel or to build another kernel.
776	  It can also be extracted from a running kernel by reading
777	  /proc/config.gz if enabled (below).
778
779config IKCONFIG_PROC
780	bool "Enable access to .config through /proc/config.gz"
781	depends on IKCONFIG && PROC_FS
782	help
783	  This option enables access to the kernel configuration file
784	  through /proc/config.gz.
785
786config IKHEADERS
787	tristate "Enable kernel headers through /sys/kernel/kheaders.tar.xz"
788	depends on SYSFS
789	help
790	  This option enables access to the in-kernel headers that are generated during
791	  the build process. These can be used to build eBPF tracing programs,
792	  or similar programs.  If you build the headers as a module, a module called
793	  kheaders.ko is built which can be loaded on-demand to get access to headers.
794
795config LOG_BUF_SHIFT
796	int "Kernel log buffer size (16 => 64KB, 17 => 128KB)"
797	range 12 25
798	default 17
799	depends on PRINTK
800	help
801	  Select the minimal kernel log buffer size as a power of 2.
802	  The final size is affected by LOG_CPU_MAX_BUF_SHIFT config
803	  parameter, see below. Any higher size also might be forced
804	  by "log_buf_len" boot parameter.
805
806	  Examples:
807		     17 => 128 KB
808		     16 => 64 KB
809		     15 => 32 KB
810		     14 => 16 KB
811		     13 =>  8 KB
812		     12 =>  4 KB
813
814config LOG_CPU_MAX_BUF_SHIFT
815	int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)"
816	depends on SMP
817	range 0 21
818	default 0 if BASE_SMALL
819	default 12
820	depends on PRINTK
821	help
822	  This option allows to increase the default ring buffer size
823	  according to the number of CPUs. The value defines the contribution
824	  of each CPU as a power of 2. The used space is typically only few
825	  lines however it might be much more when problems are reported,
826	  e.g. backtraces.
827
828	  The increased size means that a new buffer has to be allocated and
829	  the original static one is unused. It makes sense only on systems
830	  with more CPUs. Therefore this value is used only when the sum of
831	  contributions is greater than the half of the default kernel ring
832	  buffer as defined by LOG_BUF_SHIFT. The default values are set
833	  so that more than 16 CPUs are needed to trigger the allocation.
834
835	  Also this option is ignored when "log_buf_len" kernel parameter is
836	  used as it forces an exact (power of two) size of the ring buffer.
837
838	  The number of possible CPUs is used for this computation ignoring
839	  hotplugging making the computation optimal for the worst case
840	  scenario while allowing a simple algorithm to be used from bootup.
841
842	  Examples shift values and their meaning:
843		     17 => 128 KB for each CPU
844		     16 =>  64 KB for each CPU
845		     15 =>  32 KB for each CPU
846		     14 =>  16 KB for each CPU
847		     13 =>   8 KB for each CPU
848		     12 =>   4 KB for each CPU
849
850config PRINTK_INDEX
851	bool "Printk indexing debugfs interface"
852	depends on PRINTK && DEBUG_FS
853	help
854	  Add support for indexing of all printk formats known at compile time
855	  at <debugfs>/printk/index/<module>.
856
857	  This can be used as part of maintaining daemons which monitor
858	  /dev/kmsg, as it permits auditing the printk formats present in a
859	  kernel, allowing detection of cases where monitored printks are
860	  changed or no longer present.
861
862	  There is no additional runtime cost to printk with this enabled.
863
864#
865# Architectures with an unreliable sched_clock() should select this:
866#
867config HAVE_UNSTABLE_SCHED_CLOCK
868	bool
869
870config GENERIC_SCHED_CLOCK
871	bool
872
873menu "Scheduler features"
874
875config UCLAMP_TASK
876	bool "Enable utilization clamping for RT/FAIR tasks"
877	depends on CPU_FREQ_GOV_SCHEDUTIL
878	help
879	  This feature enables the scheduler to track the clamped utilization
880	  of each CPU based on RUNNABLE tasks scheduled on that CPU.
881
882	  With this option, the user can specify the min and max CPU
883	  utilization allowed for RUNNABLE tasks. The max utilization defines
884	  the maximum frequency a task should use while the min utilization
885	  defines the minimum frequency it should use.
886
887	  Both min and max utilization clamp values are hints to the scheduler,
888	  aiming at improving its frequency selection policy, but they do not
889	  enforce or grant any specific bandwidth for tasks.
890
891	  If in doubt, say N.
892
893config UCLAMP_BUCKETS_COUNT
894	int "Number of supported utilization clamp buckets"
895	range 5 20
896	default 5
897	depends on UCLAMP_TASK
898	help
899	  Defines the number of clamp buckets to use. The range of each bucket
900	  will be SCHED_CAPACITY_SCALE/UCLAMP_BUCKETS_COUNT. The higher the
901	  number of clamp buckets the finer their granularity and the higher
902	  the precision of clamping aggregation and tracking at run-time.
903
904	  For example, with the minimum configuration value we will have 5
905	  clamp buckets tracking 20% utilization each. A 25% boosted tasks will
906	  be refcounted in the [20..39]% bucket and will set the bucket clamp
907	  effective value to 25%.
908	  If a second 30% boosted task should be co-scheduled on the same CPU,
909	  that task will be refcounted in the same bucket of the first task and
910	  it will boost the bucket clamp effective value to 30%.
911	  The clamp effective value of a bucket is reset to its nominal value
912	  (20% in the example above) when there are no more tasks refcounted in
913	  that bucket.
914
915	  An additional boost/capping margin can be added to some tasks. In the
916	  example above the 25% task will be boosted to 30% until it exits the
917	  CPU. If that should be considered not acceptable on certain systems,
918	  it's always possible to reduce the margin by increasing the number of
919	  clamp buckets to trade off used memory for run-time tracking
920	  precision.
921
922	  If in doubt, use the default value.
923
924config SCHED_PROXY_EXEC
925	bool "Proxy Execution"
926	# Avoid some build failures w/ PREEMPT_RT until it can be fixed
927	depends on !PREEMPT_RT
928	# Need to investigate how to inform sched_ext of split contexts
929	depends on !SCHED_CLASS_EXT
930	# Not particularly useful until we get to multi-rq proxying
931	depends on EXPERT
932	help
933	  This option enables proxy execution, a mechanism for mutex-owning
934	  tasks to inherit the scheduling context of higher priority waiters.
935
936endmenu
937
938#
939# For architectures that want to enable the support for NUMA-affine scheduler
940# balancing logic:
941#
942config ARCH_SUPPORTS_NUMA_BALANCING
943	bool
944
945#
946# For architectures that prefer to flush all TLBs after a number of pages
947# are unmapped instead of sending one IPI per page to flush. The architecture
948# must provide guarantees on what happens if a clean TLB cache entry is
949# written after the unmap. Details are in mm/rmap.c near the check for
950# should_defer_flush. The architecture should also consider if the full flush
951# and the refill costs are offset by the savings of sending fewer IPIs.
952config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
953	bool
954
955config CC_HAS_INT128
956	def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT
957
958config CC_IMPLICIT_FALLTHROUGH
959	string
960	default "-Wimplicit-fallthrough=5" if CC_IS_GCC && $(cc-option,-Wimplicit-fallthrough=5)
961	default "-Wimplicit-fallthrough" if CC_IS_CLANG && $(cc-option,-Wunreachable-code-fallthrough)
962
963# Currently, disable gcc-10+ array-bounds globally.
964# It's still broken in gcc-13, so no upper bound yet.
965config GCC10_NO_ARRAY_BOUNDS
966	def_bool y
967
968config CC_NO_ARRAY_BOUNDS
969	bool
970	default y if CC_IS_GCC && GCC_VERSION >= 90000 && GCC10_NO_ARRAY_BOUNDS
971
972# Currently, disable -Wstringop-overflow for GCC globally.
973config GCC_NO_STRINGOP_OVERFLOW
974	def_bool y
975
976config CC_NO_STRINGOP_OVERFLOW
977	bool
978	default y if CC_IS_GCC && GCC_NO_STRINGOP_OVERFLOW
979
980config CC_STRINGOP_OVERFLOW
981	bool
982	default y if CC_IS_GCC && !CC_NO_STRINGOP_OVERFLOW
983
984#
985# For architectures that know their GCC __int128 support is sound
986#
987config ARCH_SUPPORTS_INT128
988	bool
989
990# For architectures that (ab)use NUMA to represent different memory regions
991# all cpu-local but of different latencies, such as SuperH.
992#
993config ARCH_WANT_NUMA_VARIABLE_LOCALITY
994	bool
995
996config NUMA_BALANCING
997	bool "Memory placement aware NUMA scheduler"
998	depends on ARCH_SUPPORTS_NUMA_BALANCING
999	depends on !ARCH_WANT_NUMA_VARIABLE_LOCALITY
1000	depends on SMP && NUMA && MIGRATION && !PREEMPT_RT
1001	help
1002	  This option adds support for automatic NUMA aware memory/task placement.
1003	  The mechanism is quite primitive and is based on migrating memory when
1004	  it has references to the node the task is running on.
1005
1006	  This system will be inactive on UMA systems.
1007
1008config NUMA_BALANCING_DEFAULT_ENABLED
1009	bool "Automatically enable NUMA aware memory/task placement"
1010	default y
1011	depends on NUMA_BALANCING
1012	help
1013	  If set, automatic NUMA balancing will be enabled if running on a NUMA
1014	  machine.
1015
1016config SLAB_OBJ_EXT
1017	bool
1018
1019menuconfig CGROUPS
1020	bool "Control Group support"
1021	select KERNFS
1022	help
1023	  This option adds support for grouping sets of processes together, for
1024	  use with process control subsystems such as Cpusets, CFS, memory
1025	  controls or device isolation.
1026	  See
1027		- Documentation/scheduler/sched-design-CFS.rst	(CFS)
1028		- Documentation/admin-guide/cgroup-v1/ (features for grouping, isolation
1029					  and resource control)
1030
1031	  Say N if unsure.
1032
1033if CGROUPS
1034
1035config PAGE_COUNTER
1036	bool
1037
1038config CGROUP_FAVOR_DYNMODS
1039        bool "Favor dynamic modification latency reduction by default"
1040        help
1041          This option enables the "favordynmods" mount option by default
1042          which reduces the latencies of dynamic cgroup modifications such
1043          as task migrations and controller on/offs at the cost of making
1044          hot path operations such as forks and exits more expensive.
1045
1046          Say N if unsure.
1047
1048config MEMCG
1049	bool "Memory controller"
1050	select PAGE_COUNTER
1051	select EVENTFD
1052	select SLAB_OBJ_EXT
1053	select VM_EVENT_COUNTERS
1054	help
1055	  Provides control over the memory footprint of tasks in a cgroup.
1056
1057config MEMCG_NMI_UNSAFE
1058	bool
1059	depends on MEMCG
1060	depends on HAVE_NMI
1061	depends on !ARCH_HAS_NMI_SAFE_THIS_CPU_OPS && !ARCH_HAVE_NMI_SAFE_CMPXCHG
1062	default y
1063
1064config MEMCG_NMI_SAFETY_REQUIRES_ATOMIC
1065	bool
1066	depends on MEMCG
1067	depends on HAVE_NMI
1068	depends on !ARCH_HAS_NMI_SAFE_THIS_CPU_OPS && ARCH_HAVE_NMI_SAFE_CMPXCHG
1069	default y
1070
1071config MEMCG_V1
1072	bool "Legacy cgroup v1 memory controller"
1073	depends on MEMCG
1074	default n
1075	help
1076	  Legacy cgroup v1 memory controller which has been deprecated by
1077	  cgroup v2 implementation. The v1 is there for legacy applications
1078	  which haven't migrated to the new cgroup v2 interface yet. If you
1079	  do not have any such application then you are completely fine leaving
1080	  this option disabled.
1081
1082	  Please note that feature set of the legacy memory controller is likely
1083	  going to shrink due to deprecation process. New deployments with v1
1084	  controller are highly discouraged.
1085
1086	  Say N if unsure.
1087
1088config BLK_CGROUP
1089	bool "IO controller"
1090	depends on BLOCK
1091	default n
1092	help
1093	Generic block IO controller cgroup interface. This is the common
1094	cgroup interface which should be used by various IO controlling
1095	policies.
1096
1097	Currently, CFQ IO scheduler uses it to recognize task groups and
1098	control disk bandwidth allocation (proportional time slice allocation)
1099	to such task groups. It is also used by bio throttling logic in
1100	block layer to implement upper limit in IO rates on a device.
1101
1102	This option only enables generic Block IO controller infrastructure.
1103	One needs to also enable actual IO controlling logic/policy. For
1104	enabling proportional weight division of disk bandwidth in CFQ, set
1105	CONFIG_BFQ_GROUP_IOSCHED=y; for enabling throttling policy, set
1106	CONFIG_BLK_DEV_THROTTLING=y.
1107
1108	See Documentation/admin-guide/cgroup-v1/blkio-controller.rst for more information.
1109
1110config CGROUP_WRITEBACK
1111	bool
1112	depends on MEMCG && BLK_CGROUP
1113	default y
1114
1115menuconfig CGROUP_SCHED
1116	bool "CPU controller"
1117	default n
1118	help
1119	  This feature lets CPU scheduler recognize task groups and control CPU
1120	  bandwidth allocation to such task groups. It uses cgroups to group
1121	  tasks.
1122
1123if CGROUP_SCHED
1124config GROUP_SCHED_WEIGHT
1125	def_bool n
1126
1127config GROUP_SCHED_BANDWIDTH
1128        def_bool n
1129
1130config FAIR_GROUP_SCHED
1131	bool "Group scheduling for SCHED_OTHER"
1132	depends on CGROUP_SCHED
1133	select GROUP_SCHED_WEIGHT
1134	default CGROUP_SCHED
1135
1136config CFS_BANDWIDTH
1137	bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
1138	depends on FAIR_GROUP_SCHED
1139	select GROUP_SCHED_BANDWIDTH
1140	default n
1141	help
1142	  This option allows users to define CPU bandwidth rates (limits) for
1143	  tasks running within the fair group scheduler.  Groups with no limit
1144	  set are considered to be unconstrained and will run with no
1145	  restriction.
1146	  See Documentation/scheduler/sched-bwc.rst for more information.
1147
1148config RT_GROUP_SCHED
1149	bool "Group scheduling for SCHED_RR/FIFO"
1150	depends on CGROUP_SCHED
1151	default n
1152	help
1153	  This feature lets you explicitly allocate real CPU bandwidth
1154	  to task groups. If enabled, it will also make it impossible to
1155	  schedule realtime tasks for non-root users until you allocate
1156	  realtime bandwidth for them.
1157	  See Documentation/scheduler/sched-rt-group.rst for more information.
1158
1159config RT_GROUP_SCHED_DEFAULT_DISABLED
1160	bool "Require boot parameter to enable group scheduling for SCHED_RR/FIFO"
1161	depends on RT_GROUP_SCHED
1162	default n
1163	help
1164	  When set, the RT group scheduling is disabled by default. The option
1165	  is in inverted form so that mere RT_GROUP_SCHED enables the group
1166	  scheduling.
1167
1168	  Say N if unsure.
1169
1170config EXT_GROUP_SCHED
1171	bool
1172	depends on SCHED_CLASS_EXT && CGROUP_SCHED
1173	select GROUP_SCHED_WEIGHT
1174	select GROUP_SCHED_BANDWIDTH
1175	default y
1176
1177endif #CGROUP_SCHED
1178
1179config SCHED_MM_CID
1180	def_bool y
1181	depends on SMP && RSEQ
1182
1183config UCLAMP_TASK_GROUP
1184	bool "Utilization clamping per group of tasks"
1185	depends on CGROUP_SCHED
1186	depends on UCLAMP_TASK
1187	default n
1188	help
1189	  This feature enables the scheduler to track the clamped utilization
1190	  of each CPU based on RUNNABLE tasks currently scheduled on that CPU.
1191
1192	  When this option is enabled, the user can specify a min and max
1193	  CPU bandwidth which is allowed for each single task in a group.
1194	  The max bandwidth allows to clamp the maximum frequency a task
1195	  can use, while the min bandwidth allows to define a minimum
1196	  frequency a task will always use.
1197
1198	  When task group based utilization clamping is enabled, an eventually
1199	  specified task-specific clamp value is constrained by the cgroup
1200	  specified clamp value. Both minimum and maximum task clamping cannot
1201	  be bigger than the corresponding clamping defined at task group level.
1202
1203	  If in doubt, say N.
1204
1205config CGROUP_PIDS
1206	bool "PIDs controller"
1207	help
1208	  Provides enforcement of process number limits in the scope of a
1209	  cgroup. Any attempt to fork more processes than is allowed in the
1210	  cgroup will fail. PIDs are fundamentally a global resource because it
1211	  is fairly trivial to reach PID exhaustion before you reach even a
1212	  conservative kmemcg limit. As a result, it is possible to grind a
1213	  system to halt without being limited by other cgroup policies. The
1214	  PIDs controller is designed to stop this from happening.
1215
1216	  It should be noted that organisational operations (such as attaching
1217	  to a cgroup hierarchy) will *not* be blocked by the PIDs controller,
1218	  since the PIDs limit only affects a process's ability to fork, not to
1219	  attach to a cgroup.
1220
1221config CGROUP_RDMA
1222	bool "RDMA controller"
1223	help
1224	  Provides enforcement of RDMA resources defined by IB stack.
1225	  It is fairly easy for consumers to exhaust RDMA resources, which
1226	  can result into resource unavailability to other consumers.
1227	  RDMA controller is designed to stop this from happening.
1228	  Attaching processes with active RDMA resources to the cgroup
1229	  hierarchy is allowed even if can cross the hierarchy's limit.
1230
1231config CGROUP_DMEM
1232	bool "Device memory controller (DMEM)"
1233	select PAGE_COUNTER
1234	help
1235	  The DMEM controller allows compatible devices to restrict device
1236	  memory usage based on the cgroup hierarchy.
1237
1238	  As an example, it allows you to restrict VRAM usage for applications
1239	  in the DRM subsystem.
1240
1241config CGROUP_FREEZER
1242	bool "Freezer controller"
1243	help
1244	  Provides a way to freeze and unfreeze all tasks in a
1245	  cgroup.
1246
1247	  This option affects the ORIGINAL cgroup interface. The cgroup2 memory
1248	  controller includes important in-kernel memory consumers per default.
1249
1250	  If you're using cgroup2, say N.
1251
1252config CGROUP_HUGETLB
1253	bool "HugeTLB controller"
1254	depends on HUGETLB_PAGE
1255	select PAGE_COUNTER
1256	default n
1257	help
1258	  Provides a cgroup controller for HugeTLB pages.
1259	  When you enable this, you can put a per cgroup limit on HugeTLB usage.
1260	  The limit is enforced during page fault. Since HugeTLB doesn't
1261	  support page reclaim, enforcing the limit at page fault time implies
1262	  that, the application will get SIGBUS signal if it tries to access
1263	  HugeTLB pages beyond its limit. This requires the application to know
1264	  beforehand how much HugeTLB pages it would require for its use. The
1265	  control group is tracked in the third page lru pointer. This means
1266	  that we cannot use the controller with huge page less than 3 pages.
1267
1268config CPUSETS
1269	bool "Cpuset controller"
1270	depends on SMP
1271	select UNION_FIND
1272	select CPU_ISOLATION
1273	help
1274	  This option will let you create and manage CPUSETs which
1275	  allow dynamically partitioning a system into sets of CPUs and
1276	  Memory Nodes and assigning tasks to run only within those sets.
1277	  This is primarily useful on large SMP or NUMA systems.
1278
1279	  Say N if unsure.
1280
1281config CPUSETS_V1
1282	bool "Legacy cgroup v1 cpusets controller"
1283	depends on CPUSETS
1284	default n
1285	help
1286	  Legacy cgroup v1 cpusets controller which has been deprecated by
1287	  cgroup v2 implementation. The v1 is there for legacy applications
1288	  which haven't migrated to the new cgroup v2 interface yet. Legacy
1289	  interface includes cpuset filesystem and /proc/<pid>/cpuset. If you
1290	  do not have any such application then you are completely fine leaving
1291	  this option disabled.
1292
1293	  Say N if unsure.
1294
1295config PROC_PID_CPUSET
1296	bool "Include legacy /proc/<pid>/cpuset file"
1297	depends on CPUSETS_V1
1298	default y
1299
1300config CGROUP_DEVICE
1301	bool "Device controller"
1302	help
1303	  Provides a cgroup controller implementing whitelists for
1304	  devices which a process in the cgroup can mknod or open.
1305
1306config CGROUP_CPUACCT
1307	bool "Simple CPU accounting controller"
1308	help
1309	  Provides a simple controller for monitoring the
1310	  total CPU consumed by the tasks in a cgroup.
1311
1312config CGROUP_PERF
1313	bool "Perf controller"
1314	depends on PERF_EVENTS
1315	help
1316	  This option extends the perf per-cpu mode to restrict monitoring
1317	  to threads which belong to the cgroup specified and run on the
1318	  designated cpu.  Or this can be used to have cgroup ID in samples
1319	  so that it can monitor performance events among cgroups.
1320
1321	  Say N if unsure.
1322
1323config CGROUP_BPF
1324	bool "Support for eBPF programs attached to cgroups"
1325	depends on BPF_SYSCALL
1326	select SOCK_CGROUP_DATA
1327	help
1328	  Allow attaching eBPF programs to a cgroup using the bpf(2)
1329	  syscall command BPF_PROG_ATTACH.
1330
1331	  In which context these programs are accessed depends on the type
1332	  of attachment. For instance, programs that are attached using
1333	  BPF_CGROUP_INET_INGRESS will be executed on the ingress path of
1334	  inet sockets.
1335
1336config CGROUP_MISC
1337	bool "Misc resource controller"
1338	default n
1339	help
1340	  Provides a controller for miscellaneous resources on a host.
1341
1342	  Miscellaneous scalar resources are the resources on the host system
1343	  which cannot be abstracted like the other cgroups. This controller
1344	  tracks and limits the miscellaneous resources used by a process
1345	  attached to a cgroup hierarchy.
1346
1347	  For more information, please check misc cgroup section in
1348	  /Documentation/admin-guide/cgroup-v2.rst.
1349
1350config CGROUP_DEBUG
1351	bool "Debug controller"
1352	default n
1353	depends on DEBUG_KERNEL
1354	help
1355	  This option enables a simple controller that exports
1356	  debugging information about the cgroups framework. This
1357	  controller is for control cgroup debugging only. Its
1358	  interfaces are not stable.
1359
1360	  Say N.
1361
1362config SOCK_CGROUP_DATA
1363	bool
1364	default n
1365
1366endif # CGROUPS
1367
1368menuconfig NAMESPACES
1369	bool "Namespaces support" if EXPERT
1370	depends on MULTIUSER
1371	default !EXPERT
1372	help
1373	  Provides the way to make tasks work with different objects using
1374	  the same id. For example same IPC id may refer to different objects
1375	  or same user id or pid may refer to different tasks when used in
1376	  different namespaces.
1377
1378if NAMESPACES
1379
1380config UTS_NS
1381	bool "UTS namespace"
1382	default y
1383	help
1384	  In this namespace tasks see different info provided with the
1385	  uname() system call
1386
1387config TIME_NS
1388	bool "TIME namespace"
1389	depends on GENERIC_GETTIMEOFDAY
1390	default y
1391	help
1392	  In this namespace boottime and monotonic clocks can be set.
1393	  The time will keep going with the same pace.
1394
1395config IPC_NS
1396	bool "IPC namespace"
1397	depends on (SYSVIPC || POSIX_MQUEUE)
1398	default y
1399	help
1400	  In this namespace tasks work with IPC ids which correspond to
1401	  different IPC objects in different namespaces.
1402
1403config USER_NS
1404	bool "User namespace"
1405	default n
1406	help
1407	  This allows containers, i.e. vservers, to use user namespaces
1408	  to provide different user info for different servers.
1409
1410	  When user namespaces are enabled in the kernel it is
1411	  recommended that the MEMCG option also be enabled and that
1412	  user-space use the memory control groups to limit the amount
1413	  of memory a memory unprivileged users can use.
1414
1415	  If unsure, say N.
1416
1417config PID_NS
1418	bool "PID Namespaces"
1419	default y
1420	help
1421	  Support process id namespaces.  This allows having multiple
1422	  processes with the same pid as long as they are in different
1423	  pid namespaces.  This is a building block of containers.
1424
1425config NET_NS
1426	bool "Network namespace"
1427	depends on NET
1428	default y
1429	help
1430	  Allow user space to create what appear to be multiple instances
1431	  of the network stack.
1432
1433endif # NAMESPACES
1434
1435config CHECKPOINT_RESTORE
1436	bool "Checkpoint/restore support"
1437	depends on PROC_FS
1438	select PROC_CHILDREN
1439	select KCMP
1440	default n
1441	help
1442	  Enables additional kernel features in a sake of checkpoint/restore.
1443	  In particular it adds auxiliary prctl codes to setup process text,
1444	  data and heap segment sizes, and a few additional /proc filesystem
1445	  entries.
1446
1447	  If unsure, say N here.
1448
1449config SCHED_AUTOGROUP
1450	bool "Automatic process group scheduling"
1451	select CGROUPS
1452	select CGROUP_SCHED
1453	select FAIR_GROUP_SCHED
1454	help
1455	  This option optimizes the scheduler for common desktop workloads by
1456	  automatically creating and populating task groups.  This separation
1457	  of workloads isolates aggressive CPU burners (like build jobs) from
1458	  desktop applications.  Task group autogeneration is currently based
1459	  upon task session.
1460
1461config RELAY
1462	bool "Kernel->user space relay support (formerly relayfs)"
1463	select IRQ_WORK
1464	help
1465	  This option enables support for relay interface support in
1466	  certain file systems (such as debugfs).
1467	  It is designed to provide an efficient mechanism for tools and
1468	  facilities to relay large amounts of data from kernel space to
1469	  user space.
1470
1471	  If unsure, say N.
1472
1473config BLK_DEV_INITRD
1474	bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
1475	help
1476	  The initial RAM filesystem is a ramfs which is loaded by the
1477	  boot loader (loadlin or lilo) and that is mounted as root
1478	  before the normal boot procedure. It is typically used to
1479	  load modules needed to mount the "real" root file system,
1480	  etc. See <file:Documentation/admin-guide/initrd.rst> for details.
1481
1482	  If RAM disk support (BLK_DEV_RAM) is also included, this
1483	  also enables initial RAM disk (initrd) support and adds
1484	  15 Kbytes (more on some other architectures) to the kernel size.
1485
1486	  If unsure say Y.
1487
1488if BLK_DEV_INITRD
1489
1490source "usr/Kconfig"
1491
1492endif
1493
1494config BOOT_CONFIG
1495	bool "Boot config support"
1496	select BLK_DEV_INITRD if !BOOT_CONFIG_EMBED
1497	help
1498	  Extra boot config allows system admin to pass a config file as
1499	  complemental extension of kernel cmdline when booting.
1500	  The boot config file must be attached at the end of initramfs
1501	  with checksum, size and magic word.
1502	  See <file:Documentation/admin-guide/bootconfig.rst> for details.
1503
1504	  If unsure, say Y.
1505
1506config BOOT_CONFIG_FORCE
1507	bool "Force unconditional bootconfig processing"
1508	depends on BOOT_CONFIG
1509	default y if BOOT_CONFIG_EMBED
1510	help
1511	  With this Kconfig option set, BOOT_CONFIG processing is carried
1512	  out even when the "bootconfig" kernel-boot parameter is omitted.
1513	  In fact, with this Kconfig option set, there is no way to
1514	  make the kernel ignore the BOOT_CONFIG-supplied kernel-boot
1515	  parameters.
1516
1517	  If unsure, say N.
1518
1519config BOOT_CONFIG_EMBED
1520	bool "Embed bootconfig file in the kernel"
1521	depends on BOOT_CONFIG
1522	help
1523	  Embed a bootconfig file given by BOOT_CONFIG_EMBED_FILE in the
1524	  kernel. Usually, the bootconfig file is loaded with the initrd
1525	  image. But if the system doesn't support initrd, this option will
1526	  help you by embedding a bootconfig file while building the kernel.
1527
1528	  If unsure, say N.
1529
1530config BOOT_CONFIG_EMBED_FILE
1531	string "Embedded bootconfig file path"
1532	depends on BOOT_CONFIG_EMBED
1533	help
1534	  Specify a bootconfig file which will be embedded to the kernel.
1535	  This bootconfig will be used if there is no initrd or no other
1536	  bootconfig in the initrd.
1537
1538config CMDLINE_LOG_WRAP_IDEAL_LEN
1539	int "Length to try to wrap the cmdline when logged at boot"
1540	default 1021
1541	range 0 1021
1542	help
1543	  At boot time, the kernel command line is logged to the console.
1544	  The log message will start with the prefix "Kernel command line: ".
1545	  The log message will attempt to be wrapped (split into multiple log
1546	  messages) at spaces based on CMDLINE_LOG_WRAP_IDEAL_LEN characters.
1547	  If wrapping happens, each log message will start with the prefix and
1548	  all but the last message will end with " \". Messages may exceed the
1549	  ideal length if a place to wrap isn't found before the specified
1550	  number of characters.
1551
1552	  A value of 0 disables wrapping, though be warned that the maximum
1553	  length of a log message (1021 characters) may cause the cmdline to
1554	  be truncated.
1555
1556config INITRAMFS_PRESERVE_MTIME
1557	bool "Preserve cpio archive mtimes in initramfs"
1558	depends on BLK_DEV_INITRD
1559	default y
1560	help
1561	  Each entry in an initramfs cpio archive carries an mtime value. When
1562	  enabled, extracted cpio items take this mtime, with directory mtime
1563	  setting deferred until after creation of any child entries.
1564
1565	  If unsure, say Y.
1566
1567config INITRAMFS_TEST
1568	bool "Test initramfs cpio archive extraction" if !KUNIT_ALL_TESTS
1569	depends on BLK_DEV_INITRD && KUNIT=y
1570	default KUNIT_ALL_TESTS
1571	help
1572	  Build KUnit tests for initramfs. See Documentation/dev-tools/kunit
1573
1574choice
1575	prompt "Compiler optimization level"
1576	default CC_OPTIMIZE_FOR_PERFORMANCE
1577
1578config CC_OPTIMIZE_FOR_PERFORMANCE
1579	bool "Optimize for performance (-O2)"
1580	help
1581	  This is the default optimization level for the kernel, building
1582	  with the "-O2" compiler flag for best performance and most
1583	  helpful compile-time warnings.
1584
1585config CC_OPTIMIZE_FOR_SIZE
1586	bool "Optimize for size (-Os)"
1587	help
1588	  Choosing this option will pass "-Os" to your compiler resulting
1589	  in a smaller kernel.
1590
1591endchoice
1592
1593config HAVE_LD_DEAD_CODE_DATA_ELIMINATION
1594	bool
1595	help
1596	  This requires that the arch annotates or otherwise protects
1597	  its external entry points from being discarded. Linker scripts
1598	  must also merge .text.*, .data.*, and .bss.* correctly into
1599	  output sections. Care must be taken not to pull in unrelated
1600	  sections (e.g., '.text.init'). Typically '.' in section names
1601	  is used to distinguish them from label names / C identifiers.
1602
1603config LD_DEAD_CODE_DATA_ELIMINATION
1604	bool "Dead code and data elimination (EXPERIMENTAL)"
1605	depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION
1606	depends on EXPERT
1607	depends on $(cc-option,-ffunction-sections -fdata-sections)
1608	depends on $(ld-option,--gc-sections)
1609	help
1610	  Enable this if you want to do dead code and data elimination with
1611	  the linker by compiling with -ffunction-sections -fdata-sections,
1612	  and linking with --gc-sections.
1613
1614	  This can reduce on disk and in-memory size of the kernel
1615	  code and static data, particularly for small configs and
1616	  on small systems. This has the possibility of introducing
1617	  silently broken kernel if the required annotations are not
1618	  present. This option is not well tested yet, so use at your
1619	  own risk.
1620
1621config LD_ORPHAN_WARN
1622	def_bool y
1623	depends on ARCH_WANT_LD_ORPHAN_WARN
1624	depends on $(ld-option,--orphan-handling=warn)
1625	depends on $(ld-option,--orphan-handling=error)
1626
1627config LD_ORPHAN_WARN_LEVEL
1628        string
1629        depends on LD_ORPHAN_WARN
1630        default "error" if WERROR
1631        default "warn"
1632
1633config SYSCTL
1634	bool
1635
1636config HAVE_UID16
1637	bool
1638
1639config SYSCTL_EXCEPTION_TRACE
1640	bool
1641	help
1642	  Enable support for /proc/sys/debug/exception-trace.
1643
1644config SYSCTL_ARCH_UNALIGN_NO_WARN
1645	bool
1646	help
1647	  Enable support for /proc/sys/kernel/ignore-unaligned-usertrap
1648	  Allows arch to define/use @no_unaligned_warning to possibly warn
1649	  about unaligned access emulation going on under the hood.
1650
1651config SYSCTL_ARCH_UNALIGN_ALLOW
1652	bool
1653	help
1654	  Enable support for /proc/sys/kernel/unaligned-trap
1655	  Allows arches to define/use @unaligned_enabled to runtime toggle
1656	  the unaligned access emulation.
1657	  see arch/parisc/kernel/unaligned.c for reference
1658
1659config SYSFS_SYSCALL
1660	bool "Sysfs syscall support"
1661	default n
1662	help
1663	  sys_sysfs is an obsolete system call no longer supported in libc.
1664	  Note that disabling this option is more secure but might break
1665	  compatibility with some systems.
1666
1667	  If unsure say N here.
1668
1669config HAVE_PCSPKR_PLATFORM
1670	bool
1671
1672menuconfig EXPERT
1673	bool "Configure standard kernel features (expert users)"
1674	# Unhide debug options, to make the on-by-default options visible
1675	select DEBUG_KERNEL
1676	help
1677	  This option allows certain base kernel options and settings
1678	  to be disabled or tweaked. This is for specialized
1679	  environments which can tolerate a "non-standard" kernel.
1680	  Only use this if you really know what you are doing.
1681
1682config UID16
1683	bool "Enable 16-bit UID system calls" if EXPERT
1684	depends on HAVE_UID16 && MULTIUSER
1685	default y
1686	help
1687	  This enables the legacy 16-bit UID syscall wrappers.
1688
1689config MULTIUSER
1690	bool "Multiple users, groups and capabilities support" if EXPERT
1691	default y
1692	help
1693	  This option enables support for non-root users, groups and
1694	  capabilities.
1695
1696	  If you say N here, all processes will run with UID 0, GID 0, and all
1697	  possible capabilities.  Saying N here also compiles out support for
1698	  system calls related to UIDs, GIDs, and capabilities, such as setuid,
1699	  setgid, and capset.
1700
1701	  If unsure, say Y here.
1702
1703config SGETMASK_SYSCALL
1704	bool "sgetmask/ssetmask syscalls support" if EXPERT
1705	default PARISC || M68K || PPC || MIPS || X86 || SPARC || MICROBLAZE || SUPERH
1706	help
1707	  sys_sgetmask and sys_ssetmask are obsolete system calls
1708	  no longer supported in libc but still enabled by default in some
1709	  architectures.
1710
1711	  If unsure, leave the default option here.
1712
1713config FHANDLE
1714	bool "open by fhandle syscalls" if EXPERT
1715	select EXPORTFS
1716	default y
1717	help
1718	  If you say Y here, a user level program will be able to map
1719	  file names to handle and then later use the handle for
1720	  different file system operations. This is useful in implementing
1721	  userspace file servers, which now track files using handles instead
1722	  of names. The handle would remain the same even if file names
1723	  get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
1724	  syscalls.
1725
1726config POSIX_TIMERS
1727	bool "Posix Clocks & timers" if EXPERT
1728	default y
1729	help
1730	  This includes native support for POSIX timers to the kernel.
1731	  Some embedded systems have no use for them and therefore they
1732	  can be configured out to reduce the size of the kernel image.
1733
1734	  When this option is disabled, the following syscalls won't be
1735	  available: timer_create, timer_gettime: timer_getoverrun,
1736	  timer_settime, timer_delete, clock_adjtime, getitimer,
1737	  setitimer, alarm. Furthermore, the clock_settime, clock_gettime,
1738	  clock_getres and clock_nanosleep syscalls will be limited to
1739	  CLOCK_REALTIME, CLOCK_MONOTONIC and CLOCK_BOOTTIME only.
1740
1741	  If unsure say y.
1742
1743config PRINTK
1744	default y
1745	bool "Enable support for printk" if EXPERT
1746	select IRQ_WORK
1747	help
1748	  This option enables normal printk support. Removing it
1749	  eliminates most of the message strings from the kernel image
1750	  and makes the kernel more or less silent. As this makes it
1751	  very difficult to diagnose system problems, saying N here is
1752	  strongly discouraged.
1753
1754config PRINTK_RINGBUFFER_KUNIT_TEST
1755	tristate "KUnit Test for the printk ringbuffer" if !KUNIT_ALL_TESTS
1756	depends on PRINTK && KUNIT
1757	default KUNIT_ALL_TESTS
1758	help
1759	  This builds the printk ringbuffer KUnit test suite.
1760
1761	  For more information on KUnit and unit tests in general, please refer
1762	  to the KUnit documentation.
1763
1764	  If unsure, say N.
1765
1766config BUG
1767	bool "BUG() support" if EXPERT
1768	default y
1769	help
1770	  Disabling this option eliminates support for BUG and WARN, reducing
1771	  the size of your kernel image and potentially quietly ignoring
1772	  numerous fatal conditions. You should only consider disabling this
1773	  option for embedded systems with no facilities for reporting errors.
1774	  Just say Y.
1775
1776config ELF_CORE
1777	depends on COREDUMP
1778	default y
1779	bool "Enable ELF core dumps" if EXPERT
1780	help
1781	  Enable support for generating core dumps. Disabling saves about 4k.
1782
1783
1784config PCSPKR_PLATFORM
1785	bool "Enable PC-Speaker support" if EXPERT
1786	depends on HAVE_PCSPKR_PLATFORM
1787	select I8253_LOCK
1788	default y
1789	help
1790	  This option allows to disable the internal PC-Speaker
1791	  support, saving some memory.
1792
1793config BASE_SMALL
1794	bool "Enable smaller-sized data structures for core" if EXPERT
1795	help
1796	  Enabling this option reduces the size of miscellaneous core
1797	  kernel data structures. This saves memory on small machines,
1798	  but may reduce performance.
1799
1800config FUTEX
1801	bool "Enable futex support" if EXPERT
1802	depends on !(SPARC32 && SMP)
1803	default y
1804	imply RT_MUTEXES
1805	help
1806	  Disabling this option will cause the kernel to be built without
1807	  support for "fast userspace mutexes".  The resulting kernel may not
1808	  run glibc-based applications correctly.
1809
1810config FUTEX_PI
1811	bool
1812	depends on FUTEX && RT_MUTEXES
1813	default y
1814
1815config FUTEX_PRIVATE_HASH
1816	bool
1817	depends on FUTEX && !BASE_SMALL && MMU
1818	default y
1819
1820config FUTEX_MPOL
1821	bool
1822	depends on FUTEX && NUMA
1823	default y
1824
1825config EPOLL
1826	bool "Enable eventpoll support" if EXPERT
1827	default y
1828	help
1829	  Disabling this option will cause the kernel to be built without
1830	  support for epoll family of system calls.
1831
1832config SIGNALFD
1833	bool "Enable signalfd() system call" if EXPERT
1834	default y
1835	help
1836	  Enable the signalfd() system call that allows to receive signals
1837	  on a file descriptor.
1838
1839	  If unsure, say Y.
1840
1841config TIMERFD
1842	bool "Enable timerfd() system call" if EXPERT
1843	default y
1844	help
1845	  Enable the timerfd() system call that allows to receive timer
1846	  events on a file descriptor.
1847
1848	  If unsure, say Y.
1849
1850config EVENTFD
1851	bool "Enable eventfd() system call" if EXPERT
1852	default y
1853	help
1854	  Enable the eventfd() system call that allows to receive both
1855	  kernel notification (ie. KAIO) or userspace notifications.
1856
1857	  If unsure, say Y.
1858
1859config SHMEM
1860	bool "Use full shmem filesystem" if EXPERT
1861	default y
1862	depends on MMU
1863	help
1864	  The shmem is an internal filesystem used to manage shared memory.
1865	  It is backed by swap and manages resource limits. It is also exported
1866	  to userspace as tmpfs if TMPFS is enabled. Disabling this
1867	  option replaces shmem and tmpfs with the much simpler ramfs code,
1868	  which may be appropriate on small systems without swap.
1869
1870config AIO
1871	bool "Enable AIO support" if EXPERT
1872	default y
1873	help
1874	  This option enables POSIX asynchronous I/O which may by used
1875	  by some high performance threaded applications. Disabling
1876	  this option saves about 7k.
1877
1878config IO_URING
1879	bool "Enable IO uring support" if EXPERT
1880	select IO_WQ
1881	default y
1882	help
1883	  This option enables support for the io_uring interface, enabling
1884	  applications to submit and complete IO through submission and
1885	  completion rings that are shared between the kernel and application.
1886
1887config GCOV_PROFILE_URING
1888	bool "Enable GCOV profiling on the io_uring subsystem"
1889	depends on IO_URING && GCOV_KERNEL
1890	help
1891	  Enable GCOV profiling on the io_uring subsystem, to facilitate
1892	  code coverage testing.
1893
1894	  If unsure, say N.
1895
1896	  Note that this will have a negative impact on the performance of
1897	  the io_uring subsystem, hence this should only be enabled for
1898	  specific test purposes.
1899
1900config IO_URING_MOCK_FILE
1901	tristate "Enable io_uring mock files (Experimental)" if EXPERT
1902	default n
1903	depends on IO_URING
1904	help
1905	  Enable mock files for io_uring subststem testing. The ABI might
1906	  still change, so it's still experimental and should only be enabled
1907	  for specific test purposes.
1908
1909	  If unsure, say N.
1910
1911config ADVISE_SYSCALLS
1912	bool "Enable madvise/fadvise syscalls" if EXPERT
1913	default y
1914	help
1915	  This option enables the madvise and fadvise syscalls, used by
1916	  applications to advise the kernel about their future memory or file
1917	  usage, improving performance. If building an embedded system where no
1918	  applications use these syscalls, you can disable this option to save
1919	  space.
1920
1921config MEMBARRIER
1922	bool "Enable membarrier() system call" if EXPERT
1923	default y
1924	help
1925	  Enable the membarrier() system call that allows issuing memory
1926	  barriers across all running threads, which can be used to distribute
1927	  the cost of user-space memory barriers asymmetrically by transforming
1928	  pairs of memory barriers into pairs consisting of membarrier() and a
1929	  compiler barrier.
1930
1931	  If unsure, say Y.
1932
1933config KCMP
1934	bool "Enable kcmp() system call" if EXPERT
1935	help
1936	  Enable the kernel resource comparison system call. It provides
1937	  user-space with the ability to compare two processes to see if they
1938	  share a common resource, such as a file descriptor or even virtual
1939	  memory space.
1940
1941	  If unsure, say N.
1942
1943config RSEQ
1944	bool "Enable rseq() system call" if EXPERT
1945	default y
1946	depends on HAVE_RSEQ
1947	select MEMBARRIER
1948	help
1949	  Enable the restartable sequences system call. It provides a
1950	  user-space cache for the current CPU number value, which
1951	  speeds up getting the current CPU number from user-space,
1952	  as well as an ABI to speed up user-space operations on
1953	  per-CPU data.
1954
1955	  If unsure, say Y.
1956
1957config RSEQ_SLICE_EXTENSION
1958	bool "Enable rseq-based time slice extension mechanism"
1959	depends on RSEQ && HIGH_RES_TIMERS && GENERIC_ENTRY && HAVE_GENERIC_TIF_BITS
1960	help
1961	  Allows userspace to request a limited time slice extension when
1962	  returning from an interrupt to user space via the RSEQ shared
1963	  data ABI. If granted, that allows to complete a critical section,
1964	  so that other threads are not stuck on a conflicted resource,
1965	  while the task is scheduled out.
1966
1967	  If unsure, say N.
1968
1969config RSEQ_STATS
1970	default n
1971	bool "Enable lightweight statistics of restartable sequences" if EXPERT
1972	depends on RSEQ && DEBUG_FS
1973	help
1974	  Enable lightweight counters which expose information about the
1975	  frequency of RSEQ operations via debugfs. Mostly interesting for
1976	  kernel debugging or performance analysis. While lightweight it's
1977	  still adding code into the user/kernel mode transitions.
1978
1979	  If unsure, say N.
1980
1981config RSEQ_DEBUG_DEFAULT_ENABLE
1982	default n
1983	bool "Enable restartable sequences debug mode by default" if EXPERT
1984	depends on RSEQ
1985	help
1986	  This enables the static branch for debug mode of restartable
1987	  sequences.
1988
1989	  This also can be controlled on the kernel command line via the
1990	  command line parameter "rseq_debug=0/1" and through debugfs.
1991
1992	  If unsure, say N.
1993
1994config DEBUG_RSEQ
1995	default n
1996	bool "Enable debugging of rseq() system call" if EXPERT
1997	depends on RSEQ && DEBUG_KERNEL && !GENERIC_ENTRY
1998	select RSEQ_DEBUG_DEFAULT_ENABLE
1999	help
2000	  Enable extra debugging checks for the rseq system call.
2001
2002	  If unsure, say N.
2003
2004config CACHESTAT_SYSCALL
2005	bool "Enable cachestat() system call" if EXPERT
2006	default y
2007	help
2008	  Enable the cachestat system call, which queries the page cache
2009	  statistics of a file (number of cached pages, dirty pages,
2010	  pages marked for writeback, (recently) evicted pages).
2011
2012	  If unsure say Y here.
2013
2014config KALLSYMS
2015	bool "Load all symbols for debugging/ksymoops" if EXPERT
2016	default y
2017	help
2018	  Say Y here to let the kernel print out symbolic crash information and
2019	  symbolic stack backtraces. This increases the size of the kernel
2020	  somewhat, as all symbols have to be loaded into the kernel image.
2021
2022config KALLSYMS_SELFTEST
2023	bool "Test the basic functions and performance of kallsyms"
2024	depends on KALLSYMS
2025	default n
2026	help
2027	  Test the basic functions and performance of some interfaces, such as
2028	  kallsyms_lookup_name. It also calculates the compression rate of the
2029	  kallsyms compression algorithm for the current symbol set.
2030
2031	  Start self-test automatically after system startup. Suggest executing
2032	  "dmesg | grep kallsyms_selftest" to collect test results. "finish" is
2033	  displayed in the last line, indicating that the test is complete.
2034
2035config KALLSYMS_ALL
2036	bool "Include all symbols in kallsyms"
2037	depends on DEBUG_KERNEL && KALLSYMS
2038	help
2039	  Normally kallsyms only contains the symbols of functions for nicer
2040	  OOPS messages and backtraces (i.e., symbols from the text and inittext
2041	  sections). This is sufficient for most cases. And only if you want to
2042	  enable kernel live patching, or other less common use cases (e.g.,
2043	  when a debugger is used) all symbols are required (i.e., names of
2044	  variables from the data sections, etc).
2045
2046	  This option makes sure that all symbols are loaded into the kernel
2047	  image (i.e., symbols from all sections) in cost of increased kernel
2048	  size (depending on the kernel configuration, it may be 300KiB or
2049	  something like this).
2050
2051	  Say N unless you really need all symbols, or kernel live patching.
2052
2053# end of the "standard kernel features (expert users)" menu
2054
2055config ARCH_HAS_MEMBARRIER_CALLBACKS
2056	bool
2057
2058config ARCH_HAS_MEMBARRIER_SYNC_CORE
2059	bool
2060
2061config ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
2062	bool
2063	help
2064	  Control MSEAL_SYSTEM_MAPPINGS access based on architecture.
2065
2066	  A 64-bit kernel is required for the memory sealing feature.
2067	  No specific hardware features from the CPU are needed.
2068
2069	  To enable this feature, the architecture needs to update their
2070	  special mappings calls to include the sealing flag and confirm
2071	  that it doesn't unmap/remap system mappings during the life
2072	  time of the process. The existence of this flag for an architecture
2073	  implies that it does not require the remapping of the system
2074	  mappings during process lifetime, so sealing these mappings is safe
2075	  from a kernel perspective.
2076
2077	  After the architecture enables this, a distribution can set
2078	  CONFIG_MSEAL_SYSTEM_MAPPING to manage access to the feature.
2079
2080	  For complete descriptions of memory sealing, please see
2081	  Documentation/userspace-api/mseal.rst
2082
2083config HAVE_PERF_EVENTS
2084	bool
2085	help
2086	  See tools/perf/design.txt for details.
2087
2088config GUEST_PERF_EVENTS
2089	bool
2090	depends on HAVE_PERF_EVENTS
2091
2092config PERF_GUEST_MEDIATED_PMU
2093	bool
2094	depends on GUEST_PERF_EVENTS
2095
2096config PERF_USE_VMALLOC
2097	bool
2098	help
2099	  See tools/perf/design.txt for details
2100
2101menu "Kernel Performance Events And Counters"
2102
2103config PERF_EVENTS
2104	bool "Kernel performance events and counters"
2105	default y if PROFILING
2106	depends on HAVE_PERF_EVENTS
2107	select IRQ_WORK
2108	help
2109	  Enable kernel support for various performance events provided
2110	  by software and hardware.
2111
2112	  Software events are supported either built-in or via the
2113	  use of generic tracepoints.
2114
2115	  Most modern CPUs support performance events via performance
2116	  counter registers. These registers count the number of certain
2117	  types of hw events: such as instructions executed, cachemisses
2118	  suffered, or branches mis-predicted - without slowing down the
2119	  kernel or applications. These registers can also trigger interrupts
2120	  when a threshold number of events have passed - and can thus be
2121	  used to profile the code that runs on that CPU.
2122
2123	  The Linux Performance Event subsystem provides an abstraction of
2124	  these software and hardware event capabilities, available via a
2125	  system call and used by the "perf" utility in tools/perf/. It
2126	  provides per task and per CPU counters, and it provides event
2127	  capabilities on top of those.
2128
2129	  Say Y if unsure.
2130
2131config DEBUG_PERF_USE_VMALLOC
2132	default n
2133	bool "Debug: use vmalloc to back perf mmap() buffers"
2134	depends on PERF_EVENTS && DEBUG_KERNEL && !PPC
2135	select PERF_USE_VMALLOC
2136	help
2137	  Use vmalloc memory to back perf mmap() buffers.
2138
2139	  Mostly useful for debugging the vmalloc code on platforms
2140	  that don't require it.
2141
2142	  Say N if unsure.
2143
2144endmenu
2145
2146config SYSTEM_DATA_VERIFICATION
2147	def_bool n
2148	select SYSTEM_TRUSTED_KEYRING
2149	select KEYS
2150	select CRYPTO
2151	select CRYPTO_RSA
2152	select ASYMMETRIC_KEY_TYPE
2153	select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
2154	select ASN1
2155	select OID_REGISTRY
2156	select X509_CERTIFICATE_PARSER
2157	select PKCS7_MESSAGE_PARSER
2158	help
2159	  Provide PKCS#7 message verification using the contents of the system
2160	  trusted keyring to provide public keys.  This then can be used for
2161	  module verification, kexec image verification and firmware blob
2162	  verification.
2163
2164config PROFILING
2165	bool "Profiling support"
2166	help
2167	  Say Y here to enable the extended profiling support mechanisms used
2168	  by profilers.
2169
2170config RUST
2171	bool "Rust support"
2172	depends on HAVE_RUST
2173	depends on RUST_IS_AVAILABLE
2174	select EXTENDED_MODVERSIONS if MODVERSIONS
2175	depends on !MODVERSIONS || GENDWARFKSYMS
2176	depends on !GCC_PLUGIN_RANDSTRUCT
2177	depends on !RANDSTRUCT
2178	depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO)
2179	depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
2180	select CFI_ICALL_NORMALIZE_INTEGERS if CFI
2181	depends on !CALL_PADDING || RUSTC_VERSION >= 108100
2182	depends on !KASAN_SW_TAGS
2183	depends on !(MITIGATION_RETHUNK && KASAN) || RUSTC_VERSION >= 108300
2184	help
2185	  Enables Rust support in the kernel.
2186
2187	  This allows other Rust-related options, like drivers written in Rust,
2188	  to be selected.
2189
2190	  It is also required to be able to load external kernel modules
2191	  written in Rust.
2192
2193	  See Documentation/rust/ for more information.
2194
2195	  If unsure, say N.
2196
2197config RUSTC_VERSION_TEXT
2198	string
2199	depends on RUST
2200	default "$(RUSTC_VERSION_TEXT)"
2201	help
2202	  See `CC_VERSION_TEXT`.
2203
2204config BINDGEN_VERSION_TEXT
2205	string
2206	depends on RUST
2207	# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
2208	# (https://github.com/rust-lang/rust-bindgen/pull/2678) and 0.71.0
2209	# (https://github.com/rust-lang/rust-bindgen/pull/3040). It can be removed
2210	# when the minimum version is upgraded past the latter (0.69.1 and 0.71.1
2211	# both fixed the issue).
2212	default "$(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null)"
2213
2214#
2215# Place an empty function call at each tracepoint site. Can be
2216# dynamically changed for a probe function.
2217#
2218config TRACEPOINTS
2219	bool
2220	select TASKS_TRACE_RCU
2221
2222source "kernel/Kconfig.kexec"
2223
2224source "kernel/liveupdate/Kconfig"
2225
2226endmenu		# General setup
2227
2228source "arch/Kconfig"
2229
2230config RT_MUTEXES
2231	bool
2232	default y if PREEMPT_RT
2233
2234config MODULE_SIG_FORMAT
2235	def_bool n
2236	select SYSTEM_DATA_VERIFICATION
2237
2238source "kernel/module/Kconfig"
2239
2240config INIT_ALL_POSSIBLE
2241	bool
2242	help
2243	  Back when each arch used to define their own cpu_online_mask and
2244	  cpu_possible_mask, some of them chose to initialize cpu_possible_mask
2245	  with all 1s, and others with all 0s.  When they were centralised,
2246	  it was better to provide this option than to break all the archs
2247	  and have several arch maintainers pursuing me down dark alleys.
2248
2249source "block/Kconfig"
2250
2251config PREEMPT_NOTIFIERS
2252	bool
2253
2254config PADATA
2255	depends on SMP
2256	bool
2257
2258config ASN1
2259	tristate
2260	help
2261	  Build a simple ASN.1 grammar compiler that produces a bytecode output
2262	  that can be interpreted by the ASN.1 stream decoder and used to
2263	  inform it as to what tags are to be expected in a stream and what
2264	  functions to call on what tags.
2265
2266source "kernel/Kconfig.locks"
2267
2268config ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
2269	bool
2270
2271config ARCH_HAS_PREPARE_SYNC_CORE_CMD
2272	bool
2273
2274config ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
2275	bool
2276
2277# It may be useful for an architecture to override the definitions of the
2278# SYSCALL_DEFINE() and __SYSCALL_DEFINEx() macros in <linux/syscalls.h>
2279# and the COMPAT_ variants in <linux/compat.h>, in particular to use a
2280# different calling convention for syscalls. They can also override the
2281# macros for not-implemented syscalls in kernel/sys_ni.c and
2282# kernel/time/posix-stubs.c. All these overrides need to be available in
2283# <asm/syscall_wrapper.h>.
2284config ARCH_HAS_SYSCALL_WRAPPER
2285	def_bool n
2286