• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: GPL-2.0-only
2config DEFCONFIG_LIST
3	string
4	depends on !UML
5	option defconfig_list
6	default "/lib/modules/$(shell,uname -r)/.config"
7	default "/etc/kernel-config"
8	default "/boot/config-$(shell,uname -r)"
9	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
10
11config CC_VERSION_TEXT
12	string
13	default "$(CC_VERSION_TEXT)"
14	help
15	  This is used in unclear ways:
16
17	  - Re-run Kconfig when the compiler is updated
18	    The 'default' property references the environment variable,
19	    CC_VERSION_TEXT so it is recorded in include/config/auto.conf.cmd.
20	    When the compiler is updated, Kconfig will be invoked.
21
22	  - Ensure full rebuild when the compier is updated
23	    include/linux/kconfig.h contains this option in the comment line so
24	    fixdep adds include/config/cc/version/text.h into the auto-generated
25	    dependency. When the compiler is updated, syncconfig will touch it
26	    and then every file will be rebuilt.
27
28config CC_IS_GCC
29	def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q gcc)
30
31config GCC_VERSION
32	int
33	default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC
34	default 0
35
36config LD_VERSION
37	int
38	default $(shell,$(LD) --version | $(srctree)/scripts/ld-version.sh)
39
40config CC_IS_CLANG
41	def_bool $(success,echo "$(CC_VERSION_TEXT)" | grep -q clang)
42
43config LD_IS_LLD
44	def_bool $(success,$(LD) -v | head -n 1 | grep -q LLD)
45
46config CLANG_VERSION
47	int
48	default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
49
50config LLD_VERSION
51	int
52	default $(shell,$(srctree)/scripts/lld-version.sh $(LD))
53
54config CC_CAN_LINK
55	bool
56	default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag)) if 64BIT
57	default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m32-flag))
58
59config CC_CAN_LINK_STATIC
60	bool
61	default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m64-flag) -static) if 64BIT
62	default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(m32-flag) -static)
63
64config CC_HAS_ASM_GOTO
65	def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC))
66
67config CC_HAS_ASM_GOTO_OUTPUT
68	depends on CC_HAS_ASM_GOTO
69	def_bool $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
70
71config CC_HAS_ASM_GOTO_TIED_OUTPUT
72	depends on CC_HAS_ASM_GOTO_OUTPUT
73	# Detect buggy gcc and clang, fixed in gcc-11 clang-14.
74	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)
75
76config TOOLS_SUPPORT_RELR
77	def_bool $(success,env "CC=$(CC)" "LD=$(LD)" "NM=$(NM)" "OBJCOPY=$(OBJCOPY)" $(srctree)/scripts/tools-support-relr.sh)
78
79config CC_HAS_ASM_INLINE
80	def_bool $(success,echo 'void foo(void) { asm inline (""); }' | $(CC) -x c - -c -o /dev/null)
81
82config CONSTRUCTORS
83	bool
84	depends on !UML
85
86config IRQ_WORK
87	bool
88
89config BUILDTIME_TABLE_SORT
90	bool
91
92config THREAD_INFO_IN_TASK
93	bool
94	help
95	  Select this to move thread_info off the stack into task_struct.  To
96	  make this work, an arch will need to remove all thread_info fields
97	  except flags and fix any runtime bugs.
98
99	  One subtle change that will be needed is to use try_get_task_stack()
100	  and put_task_stack() in save_thread_stack_tsk() and get_wchan().
101
102menu "General setup"
103
104config BROKEN
105	bool
106
107config BROKEN_ON_SMP
108	bool
109	depends on BROKEN || !SMP
110	default y
111
112config INIT_ENV_ARG_LIMIT
113	int
114	default 32 if !UML
115	default 128 if UML
116	help
117	  Maximum of each of the number of arguments and environment
118	  variables passed to init from the kernel command line.
119
120config COMPILE_TEST
121	bool "Compile also drivers which will not load"
122	depends on HAS_IOMEM
123	help
124	  Some drivers can be compiled on a different platform than they are
125	  intended to be run on. Despite they cannot be loaded there (or even
126	  when they load they cannot be used due to missing HW support),
127	  developers still, opposing to distributors, might want to build such
128	  drivers to compile-test them.
129
130	  If you are a developer and want to build everything available, say Y
131	  here. If you are a user/distributor, say N here to exclude useless
132	  drivers to be distributed.
133
134config UAPI_HEADER_TEST
135	bool "Compile test UAPI headers"
136	depends on HEADERS_INSTALL && CC_CAN_LINK
137	help
138	  Compile test headers exported to user-space to ensure they are
139	  self-contained, i.e. compilable as standalone units.
140
141	  If you are a developer or tester and want to ensure the exported
142	  headers are self-contained, say Y here. Otherwise, choose N.
143
144config LOCALVERSION
145	string "Local version - append to kernel release"
146	help
147	  Append an extra string to the end of your kernel version.
148	  This will show up when you type uname, for example.
149	  The string you set here will be appended after the contents of
150	  any files with a filename matching localversion* in your
151	  object and source tree, in that order.  Your total string can
152	  be a maximum of 64 characters.
153
154config LOCALVERSION_AUTO
155	bool "Automatically append version information to the version string"
156	default y
157	depends on !COMPILE_TEST
158	help
159	  This will try to automatically determine if the current tree is a
160	  release tree by looking for git tags that belong to the current
161	  top of tree revision.
162
163	  A string of the format -gxxxxxxxx will be added to the localversion
164	  if a git-based tree is found.  The string generated by this will be
165	  appended after any matching localversion* files, and after the value
166	  set in CONFIG_LOCALVERSION.
167
168	  (The actual string used here is the first eight characters produced
169	  by running the command:
170
171	    $ git rev-parse --verify HEAD
172
173	  which is done within the script "scripts/setlocalversion".)
174
175config BUILD_SALT
176	string "Build ID Salt"
177	default ""
178	help
179	  The build ID is used to link binaries and their debug info. Setting
180	  this option will use the value in the calculation of the build id.
181	  This is mostly useful for distributions which want to ensure the
182	  build is unique between builds. It's safe to leave the default.
183
184config HAVE_KERNEL_GZIP
185	bool
186
187config HAVE_KERNEL_BZIP2
188	bool
189
190config HAVE_KERNEL_LZMA
191	bool
192
193config HAVE_KERNEL_XZ
194	bool
195
196config HAVE_KERNEL_LZO
197	bool
198
199config HAVE_KERNEL_LZ4
200	bool
201
202config HAVE_KERNEL_ZSTD
203	bool
204
205config HAVE_KERNEL_UNCOMPRESSED
206	bool
207
208choice
209	prompt "Kernel compression mode"
210	default KERNEL_GZIP
211	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
212	help
213	  The linux kernel is a kind of self-extracting executable.
214	  Several compression algorithms are available, which differ
215	  in efficiency, compression and decompression speed.
216	  Compression speed is only relevant when building a kernel.
217	  Decompression speed is relevant at each boot.
218
219	  If you have any problems with bzip2 or lzma compressed
220	  kernels, mail me (Alain Knaff) <alain@knaff.lu>. (An older
221	  version of this functionality (bzip2 only), for 2.4, was
222	  supplied by Christian Ludwig)
223
224	  High compression options are mostly useful for users, who
225	  are low on disk space (embedded systems), but for whom ram
226	  size matters less.
227
228	  If in doubt, select 'gzip'
229
230config KERNEL_GZIP
231	bool "Gzip"
232	depends on HAVE_KERNEL_GZIP
233	help
234	  The old and tried gzip compression. It provides a good balance
235	  between compression ratio and decompression speed.
236
237config KERNEL_BZIP2
238	bool "Bzip2"
239	depends on HAVE_KERNEL_BZIP2
240	help
241	  Its compression ratio and speed is intermediate.
242	  Decompression speed is slowest among the choices.  The kernel
243	  size is about 10% smaller with bzip2, in comparison to gzip.
244	  Bzip2 uses a large amount of memory. For modern kernels you
245	  will need at least 8MB RAM or more for booting.
246
247config KERNEL_LZMA
248	bool "LZMA"
249	depends on HAVE_KERNEL_LZMA
250	help
251	  This compression algorithm's ratio is best.  Decompression speed
252	  is between gzip and bzip2.  Compression is slowest.
253	  The kernel size is about 33% smaller with LZMA in comparison to gzip.
254
255config KERNEL_XZ
256	bool "XZ"
257	depends on HAVE_KERNEL_XZ
258	help
259	  XZ uses the LZMA2 algorithm and instruction set specific
260	  BCJ filters which can improve compression ratio of executable
261	  code. The size of the kernel is about 30% smaller with XZ in
262	  comparison to gzip. On architectures for which there is a BCJ
263	  filter (i386, x86_64, ARM, IA-64, PowerPC, and SPARC), XZ
264	  will create a few percent smaller kernel than plain LZMA.
265
266	  The speed is about the same as with LZMA: The decompression
267	  speed of XZ is better than that of bzip2 but worse than gzip
268	  and LZO. Compression is slow.
269
270config KERNEL_LZO
271	bool "LZO"
272	depends on HAVE_KERNEL_LZO
273	help
274	  Its compression ratio is the poorest among the choices. The kernel
275	  size is about 10% bigger than gzip; however its speed
276	  (both compression and decompression) is the fastest.
277
278config KERNEL_LZ4
279	bool "LZ4"
280	depends on HAVE_KERNEL_LZ4
281	help
282	  LZ4 is an LZ77-type compressor with a fixed, byte-oriented encoding.
283	  A preliminary version of LZ4 de/compression tool is available at
284	  <https://code.google.com/p/lz4/>.
285
286	  Its compression ratio is worse than LZO. The size of the kernel
287	  is about 8% bigger than LZO. But the decompression speed is
288	  faster than LZO.
289
290config KERNEL_ZSTD
291	bool "ZSTD"
292	depends on HAVE_KERNEL_ZSTD
293	help
294	  ZSTD is a compression algorithm targeting intermediate compression
295	  with fast decompression speed. It will compress better than GZIP and
296	  decompress around the same speed as LZO, but slower than LZ4. You
297	  will need at least 192 KB RAM or more for booting. The zstd command
298	  line tool is required for compression.
299
300config KERNEL_UNCOMPRESSED
301	bool "None"
302	depends on HAVE_KERNEL_UNCOMPRESSED
303	help
304	  Produce uncompressed kernel image. This option is usually not what
305	  you want. It is useful for debugging the kernel in slow simulation
306	  environments, where decompressing and moving the kernel is awfully
307	  slow. This option allows early boot code to skip the decompressor
308	  and jump right at uncompressed kernel image.
309
310endchoice
311
312config DEFAULT_INIT
313	string "Default init path"
314	default ""
315	help
316	  This option determines the default init for the system if no init=
317	  option is passed on the kernel command line. If the requested path is
318	  not present, we will still then move on to attempting further
319	  locations (e.g. /sbin/init, etc). If this is empty, we will just use
320	  the fallback list when init= is not passed.
321
322config DEFAULT_HOSTNAME
323	string "Default hostname"
324	default "(none)"
325	help
326	  This option determines the default system hostname before userspace
327	  calls sethostname(2). The kernel traditionally uses "(none)" here,
328	  but you may wish to use a different default here to make a minimal
329	  system more usable with less configuration.
330
331#
332# For some reason microblaze and nios2 hard code SWAP=n.  Hopefully we can
333# add proper SWAP support to them, in which case this can be remove.
334#
335config ARCH_NO_SWAP
336	bool
337
338config SWAP
339	bool "Support for paging of anonymous memory (swap)"
340	depends on MMU && BLOCK && !ARCH_NO_SWAP
341	default y
342	help
343	  This option allows you to choose whether you want to have support
344	  for so called swap devices or swap files in your kernel that are
345	  used to provide more virtual memory than the actual RAM present
346	  in your computer.  If unsure say Y.
347
348config SYSVIPC
349	bool "System V IPC"
350	help
351	  Inter Process Communication is a suite of library functions and
352	  system calls which let processes (running programs) synchronize and
353	  exchange information. It is generally considered to be a good thing,
354	  and some programs won't run unless you say Y here. In particular, if
355	  you want to run the DOS emulator dosemu under Linux (read the
356	  DOSEMU-HOWTO, available from <http://www.tldp.org/docs.html#howto>),
357	  you'll need to say Y here.
358
359	  You can find documentation about IPC with "info ipc" and also in
360	  section 6.4 of the Linux Programmer's Guide, available from
361	  <http://www.tldp.org/guides.html>.
362
363config SYSVIPC_SYSCTL
364	bool
365	depends on SYSVIPC
366	depends on SYSCTL
367	default y
368
369config POSIX_MQUEUE
370	bool "POSIX Message Queues"
371	depends on NET
372	help
373	  POSIX variant of message queues is a part of IPC. In POSIX message
374	  queues every message has a priority which decides about succession
375	  of receiving it by a process. If you want to compile and run
376	  programs written e.g. for Solaris with use of its POSIX message
377	  queues (functions mq_*) say Y here.
378
379	  POSIX message queues are visible as a filesystem called 'mqueue'
380	  and can be mounted somewhere if you want to do filesystem
381	  operations on message queues.
382
383	  If unsure, say Y.
384
385config POSIX_MQUEUE_SYSCTL
386	bool
387	depends on POSIX_MQUEUE
388	depends on SYSCTL
389	default y
390
391config WATCH_QUEUE
392	bool "General notification queue"
393	default n
394	help
395
396	  This is a general notification queue for the kernel to pass events to
397	  userspace by splicing them into pipes.  It can be used in conjunction
398	  with watches for key/keyring change notifications and device
399	  notifications.
400
401	  See Documentation/watch_queue.rst
402
403config CROSS_MEMORY_ATTACH
404	bool "Enable process_vm_readv/writev syscalls"
405	depends on MMU
406	default y
407	help
408	  Enabling this option adds the system calls process_vm_readv and
409	  process_vm_writev which allow a process with the correct privileges
410	  to directly read from or write to another process' address space.
411	  See the man page for more details.
412
413config USELIB
414	bool "uselib syscall"
415	def_bool ALPHA || M68K || SPARC || X86_32 || IA32_EMULATION
416	help
417	  This option enables the uselib syscall, a system call used in the
418	  dynamic linker from libc5 and earlier.  glibc does not use this
419	  system call.  If you intend to run programs built on libc5 or
420	  earlier, you may need to enable this syscall.  Current systems
421	  running glibc can safely disable this.
422
423config AUDIT
424	bool "Auditing support"
425	depends on NET
426	help
427	  Enable auditing infrastructure that can be used with another
428	  kernel subsystem, such as SELinux (which requires this for
429	  logging of avc messages output).  System call auditing is included
430	  on architectures which support it.
431
432config HAVE_ARCH_AUDITSYSCALL
433	bool
434
435config AUDITSYSCALL
436	def_bool y
437	depends on AUDIT && HAVE_ARCH_AUDITSYSCALL
438	select FSNOTIFY
439
440source "kernel/irq/Kconfig"
441source "kernel/time/Kconfig"
442source "kernel/Kconfig.preempt"
443
444menu "CPU/Task time and stats accounting"
445
446config VIRT_CPU_ACCOUNTING
447	bool
448
449choice
450	prompt "Cputime accounting"
451	default TICK_CPU_ACCOUNTING if !PPC64
452	default VIRT_CPU_ACCOUNTING_NATIVE if PPC64
453
454# Kind of a stub config for the pure tick based cputime accounting
455config TICK_CPU_ACCOUNTING
456	bool "Simple tick based cputime accounting"
457	depends on !S390 && !NO_HZ_FULL
458	help
459	  This is the basic tick based cputime accounting that maintains
460	  statistics about user, system and idle time spent on per jiffies
461	  granularity.
462
463	  If unsure, say Y.
464
465config VIRT_CPU_ACCOUNTING_NATIVE
466	bool "Deterministic task and CPU time accounting"
467	depends on HAVE_VIRT_CPU_ACCOUNTING && !NO_HZ_FULL
468	select VIRT_CPU_ACCOUNTING
469	help
470	  Select this option to enable more accurate task and CPU time
471	  accounting.  This is done by reading a CPU counter on each
472	  kernel entry and exit and on transitions within the kernel
473	  between system, softirq and hardirq state, so there is a
474	  small performance impact.  In the case of s390 or IBM POWER > 5,
475	  this also enables accounting of stolen time on logically-partitioned
476	  systems.
477
478config VIRT_CPU_ACCOUNTING_GEN
479	bool "Full dynticks CPU time accounting"
480	depends on HAVE_CONTEXT_TRACKING
481	depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
482	depends on GENERIC_CLOCKEVENTS
483	select VIRT_CPU_ACCOUNTING
484	select CONTEXT_TRACKING
485	help
486	  Select this option to enable task and CPU time accounting on full
487	  dynticks systems. This accounting is implemented by watching every
488	  kernel-user boundaries using the context tracking subsystem.
489	  The accounting is thus performed at the expense of some significant
490	  overhead.
491
492	  For now this is only useful if you are working on the full
493	  dynticks subsystem development.
494
495	  If unsure, say N.
496
497endchoice
498
499config IRQ_TIME_ACCOUNTING
500	bool "Fine granularity task level IRQ time accounting"
501	depends on HAVE_IRQ_TIME_ACCOUNTING && !VIRT_CPU_ACCOUNTING_NATIVE
502	help
503	  Select this option to enable fine granularity task irq time
504	  accounting. This is done by reading a timestamp on each
505	  transitions between softirq and hardirq state, so there can be a
506	  small performance impact.
507
508	  If in doubt, say N here.
509
510config HAVE_SCHED_AVG_IRQ
511	def_bool y
512	depends on IRQ_TIME_ACCOUNTING || PARAVIRT_TIME_ACCOUNTING
513	depends on SMP
514
515config SCHED_THERMAL_PRESSURE
516	bool
517	default y if ARM && ARM_CPU_TOPOLOGY
518	default y if ARM64
519	depends on SMP
520	depends on CPU_FREQ_THERMAL
521	help
522	  Select this option to enable thermal pressure accounting in the
523	  scheduler. Thermal pressure is the value conveyed to the scheduler
524	  that reflects the reduction in CPU compute capacity resulted from
525	  thermal throttling. Thermal throttling occurs when the performance of
526	  a CPU is capped due to high operating temperatures.
527
528	  If selected, the scheduler will be able to balance tasks accordingly,
529	  i.e. put less load on throttled CPUs than on non/less throttled ones.
530
531	  This requires the architecture to implement
532	  arch_set_thermal_pressure() and arch_get_thermal_pressure().
533
534config SCHED_WALT
535	bool "Support window based load tracking"
536	depends on SMP
537	help
538	This feature will allow the scheduler to maintain a tunable window
539	based set of metrics for tasks and runqueues. These metrics can be
540	used to guide task placement as well as task frequency requirements
541	for cpufreq governors.
542
543config BSD_PROCESS_ACCT
544	bool "BSD Process Accounting"
545	depends on MULTIUSER
546	help
547	  If you say Y here, a user level program will be able to instruct the
548	  kernel (via a special system call) to write process accounting
549	  information to a file: whenever a process exits, information about
550	  that process will be appended to the file by the kernel.  The
551	  information includes things such as creation time, owning user,
552	  command name, memory usage, controlling terminal etc. (the complete
553	  list is in the struct acct in <file:include/linux/acct.h>).  It is
554	  up to the user level program to do useful things with this
555	  information.  This is generally a good idea, so say Y.
556
557config BSD_PROCESS_ACCT_V3
558	bool "BSD Process Accounting version 3 file format"
559	depends on BSD_PROCESS_ACCT
560	default n
561	help
562	  If you say Y here, the process accounting information is written
563	  in a new file format that also logs the process IDs of each
564	  process and its parent. Note that this file format is incompatible
565	  with previous v0/v1/v2 file formats, so you will need updated tools
566	  for processing it. A preliminary version of these tools is available
567	  at <http://www.gnu.org/software/acct/>.
568
569config TASKSTATS
570	bool "Export task/process statistics through netlink"
571	depends on NET
572	depends on MULTIUSER
573	default n
574	help
575	  Export selected statistics for tasks/processes through the
576	  generic netlink interface. Unlike BSD process accounting, the
577	  statistics are available during the lifetime of tasks/processes as
578	  responses to commands. Like BSD accounting, they are sent to user
579	  space on task exit.
580
581	  Say N if unsure.
582
583config TASK_DELAY_ACCT
584	bool "Enable per-task delay accounting"
585	depends on TASKSTATS
586	select SCHED_INFO
587	help
588	  Collect information on time spent by a task waiting for system
589	  resources like cpu, synchronous block I/O completion and swapping
590	  in pages. Such statistics can help in setting a task's priorities
591	  relative to other tasks for cpu, io, rss limits etc.
592
593	  Say N if unsure.
594
595config TASK_XACCT
596	bool "Enable extended accounting over taskstats"
597	depends on TASKSTATS
598	help
599	  Collect extended task accounting data and send the data
600	  to userland for processing over the taskstats interface.
601
602	  Say N if unsure.
603
604config TASK_IO_ACCOUNTING
605	bool "Enable per-task storage I/O accounting"
606	depends on TASK_XACCT
607	help
608	  Collect information on the number of bytes of storage I/O which this
609	  task has caused.
610
611	  Say N if unsure.
612
613config PSI
614	bool "Pressure stall information tracking"
615	help
616	  Collect metrics that indicate how overcommitted the CPU, memory,
617	  and IO capacity are in the system.
618
619	  If you say Y here, the kernel will create /proc/pressure/ with the
620	  pressure statistics files cpu, memory, and io. These will indicate
621	  the share of walltime in which some or all tasks in the system are
622	  delayed due to contention of the respective resource.
623
624	  In kernels with cgroup support, cgroups (cgroup2 only) will
625	  have cpu.pressure, memory.pressure, and io.pressure files,
626	  which aggregate pressure stalls for the grouped tasks only.
627
628	  For more details see Documentation/accounting/psi.rst.
629
630	  Say N if unsure.
631
632config PSI_DEFAULT_DISABLED
633	bool "Require boot parameter to enable pressure stall information tracking"
634	default n
635	depends on PSI
636	help
637	  If set, pressure stall information tracking will be disabled
638	  per default but can be enabled through passing psi=1 on the
639	  kernel commandline during boot.
640
641	  This feature adds some code to the task wakeup and sleep
642	  paths of the scheduler. The overhead is too low to affect
643	  common scheduling-intense workloads in practice (such as
644	  webservers, memcache), but it does show up in artificial
645	  scheduler stress tests, such as hackbench.
646
647	  If you are paranoid and not sure what the kernel will be
648	  used for, say Y.
649
650	  Say N if unsure.
651
652endmenu # "CPU/Task time and stats accounting"
653
654config CPU_ISOLATION
655	bool "CPU isolation"
656	depends on SMP || COMPILE_TEST
657	default y
658	help
659	  Make sure that CPUs running critical tasks are not disturbed by
660	  any source of "noise" such as unbound workqueues, timers, kthreads...
661	  Unbound jobs get offloaded to housekeeping CPUs. This is driven by
662	  the "isolcpus=" boot parameter.
663
664	  Say Y if unsure.
665
666config SCHED_RUNNING_AVG
667	bool "per-rq and per-cluster running average statistics"
668	default n
669
670config CPU_ISOLATION_OPT
671	bool "CPU isolation optimization"
672	depends on SMP
673	default n
674	help
675	  This option enables cpu isolation optimization, which allows
676	  to isolate cpu dynamically. The isolated cpu will be unavailable
677	  to scheduler and load balancer, and all its non-pinned timers,
678	  IRQs and tasks will be migrated to other cpus, only pinned
679	  kthread and IRQS are still allowed to run, this achieves
680	  similar effect as hotplug but at lower latency cost.
681
682config SCHED_CORE_CTRL
683	bool "Core control"
684	depends on CPU_ISOLATION_OPT
685	select SCHED_RUNNING_AVG
686	default n
687	help
688	  This option enables the core control functionality in
689	  the scheduler. Core control automatically isolate and
690	  unisolate cores based on cpu load and utilization.
691
692source "kernel/rcu/Kconfig"
693
694config BUILD_BIN2C
695	bool
696	default n
697
698config IKCONFIG
699	tristate "Kernel .config support"
700	help
701	  This option enables the complete Linux kernel ".config" file
702	  contents to be saved in the kernel. It provides documentation
703	  of which kernel options are used in a running kernel or in an
704	  on-disk kernel.  This information can be extracted from the kernel
705	  image file with the script scripts/extract-ikconfig and used as
706	  input to rebuild the current kernel or to build another kernel.
707	  It can also be extracted from a running kernel by reading
708	  /proc/config.gz if enabled (below).
709
710config IKCONFIG_PROC
711	bool "Enable access to .config through /proc/config.gz"
712	depends on IKCONFIG && PROC_FS
713	help
714	  This option enables access to the kernel configuration file
715	  through /proc/config.gz.
716
717config IKHEADERS
718	tristate "Enable kernel headers through /sys/kernel/kheaders.tar.xz"
719	depends on SYSFS
720	help
721	  This option enables access to the in-kernel headers that are generated during
722	  the build process. These can be used to build eBPF tracing programs,
723	  or similar programs.  If you build the headers as a module, a module called
724	  kheaders.ko is built which can be loaded on-demand to get access to headers.
725
726config LOG_BUF_SHIFT
727	int "Kernel log buffer size (16 => 64KB, 17 => 128KB)"
728	range 12 25 if !H8300
729	range 12 19 if H8300
730	default 17
731	depends on PRINTK
732	help
733	  Select the minimal kernel log buffer size as a power of 2.
734	  The final size is affected by LOG_CPU_MAX_BUF_SHIFT config
735	  parameter, see below. Any higher size also might be forced
736	  by "log_buf_len" boot parameter.
737
738	  Examples:
739		     17 => 128 KB
740		     16 => 64 KB
741		     15 => 32 KB
742		     14 => 16 KB
743		     13 =>  8 KB
744		     12 =>  4 KB
745
746config LOG_CPU_MAX_BUF_SHIFT
747	int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)"
748	depends on SMP
749	range 0 21
750	default 12 if !BASE_SMALL
751	default 0 if BASE_SMALL
752	depends on PRINTK
753	help
754	  This option allows to increase the default ring buffer size
755	  according to the number of CPUs. The value defines the contribution
756	  of each CPU as a power of 2. The used space is typically only few
757	  lines however it might be much more when problems are reported,
758	  e.g. backtraces.
759
760	  The increased size means that a new buffer has to be allocated and
761	  the original static one is unused. It makes sense only on systems
762	  with more CPUs. Therefore this value is used only when the sum of
763	  contributions is greater than the half of the default kernel ring
764	  buffer as defined by LOG_BUF_SHIFT. The default values are set
765	  so that more than 16 CPUs are needed to trigger the allocation.
766
767	  Also this option is ignored when "log_buf_len" kernel parameter is
768	  used as it forces an exact (power of two) size of the ring buffer.
769
770	  The number of possible CPUs is used for this computation ignoring
771	  hotplugging making the computation optimal for the worst case
772	  scenario while allowing a simple algorithm to be used from bootup.
773
774	  Examples shift values and their meaning:
775		     17 => 128 KB for each CPU
776		     16 =>  64 KB for each CPU
777		     15 =>  32 KB for each CPU
778		     14 =>  16 KB for each CPU
779		     13 =>   8 KB for each CPU
780		     12 =>   4 KB for each CPU
781
782config PRINTK_SAFE_LOG_BUF_SHIFT
783	int "Temporary per-CPU printk log buffer size (12 => 4KB, 13 => 8KB)"
784	range 10 21
785	default 13
786	depends on PRINTK
787	help
788	  Select the size of an alternate printk per-CPU buffer where messages
789	  printed from usafe contexts are temporary stored. One example would
790	  be NMI messages, another one - printk recursion. The messages are
791	  copied to the main log buffer in a safe context to avoid a deadlock.
792	  The value defines the size as a power of 2.
793
794	  Those messages are rare and limited. The largest one is when
795	  a backtrace is printed. It usually fits into 4KB. Select
796	  8KB if you want to be on the safe side.
797
798	  Examples:
799		     17 => 128 KB for each CPU
800		     16 =>  64 KB for each CPU
801		     15 =>  32 KB for each CPU
802		     14 =>  16 KB for each CPU
803		     13 =>   8 KB for each CPU
804		     12 =>   4 KB for each CPU
805
806#
807# Architectures with an unreliable sched_clock() should select this:
808#
809config HAVE_UNSTABLE_SCHED_CLOCK
810	bool
811
812config GENERIC_SCHED_CLOCK
813	bool
814
815menu "Scheduler features"
816
817config UCLAMP_TASK
818	bool "Enable utilization clamping for RT/FAIR tasks"
819	depends on CPU_FREQ_GOV_SCHEDUTIL
820	help
821	  This feature enables the scheduler to track the clamped utilization
822	  of each CPU based on RUNNABLE tasks scheduled on that CPU.
823
824	  With this option, the user can specify the min and max CPU
825	  utilization allowed for RUNNABLE tasks. The max utilization defines
826	  the maximum frequency a task should use while the min utilization
827	  defines the minimum frequency it should use.
828
829	  Both min and max utilization clamp values are hints to the scheduler,
830	  aiming at improving its frequency selection policy, but they do not
831	  enforce or grant any specific bandwidth for tasks.
832
833	  If in doubt, say N.
834
835config UCLAMP_BUCKETS_COUNT
836	int "Number of supported utilization clamp buckets"
837	range 5 20
838	default 5
839	depends on UCLAMP_TASK
840	help
841	  Defines the number of clamp buckets to use. The range of each bucket
842	  will be SCHED_CAPACITY_SCALE/UCLAMP_BUCKETS_COUNT. The higher the
843	  number of clamp buckets the finer their granularity and the higher
844	  the precision of clamping aggregation and tracking at run-time.
845
846	  For example, with the minimum configuration value we will have 5
847	  clamp buckets tracking 20% utilization each. A 25% boosted tasks will
848	  be refcounted in the [20..39]% bucket and will set the bucket clamp
849	  effective value to 25%.
850	  If a second 30% boosted task should be co-scheduled on the same CPU,
851	  that task will be refcounted in the same bucket of the first task and
852	  it will boost the bucket clamp effective value to 30%.
853	  The clamp effective value of a bucket is reset to its nominal value
854	  (20% in the example above) when there are no more tasks refcounted in
855	  that bucket.
856
857	  An additional boost/capping margin can be added to some tasks. In the
858	  example above the 25% task will be boosted to 30% until it exits the
859	  CPU. If that should be considered not acceptable on certain systems,
860	  it's always possible to reduce the margin by increasing the number of
861	  clamp buckets to trade off used memory for run-time tracking
862	  precision.
863
864	  If in doubt, use the default value.
865
866config SCHED_LATENCY_NICE
867	bool "Enable latency feature for FAIR tasks"
868	default n
869	help
870	  This feature use latency nice priority to decide if a cfs task can
871	  preempt the current running task.
872
873source "kernel/sched/rtg/Kconfig"
874
875config SCHED_EAS
876	bool "EAS scheduler optimization"
877	default n
878	help
879	  Check and migrate the CFS process to a more suitable CPU in the tick.
880
881config SCHED_RT_CAS
882	bool "rt-cas optimization"
883	depends on SCHED_EAS
884	default n
885	help
886	  RT task detects capacity during CPU selection
887
888config SCHED_RT_ACTIVE_LB
889	bool "RT Capacity Aware Misfit Task"
890	depends on SCHED_EAS
891	default n
892	help
893	  Check and migrate the RT process to a more suitable CPU in the tick.
894
895endmenu
896
897#
898# For architectures that want to enable the support for NUMA-affine scheduler
899# balancing logic:
900#
901config ARCH_SUPPORTS_NUMA_BALANCING
902	bool
903
904#
905# For architectures that prefer to flush all TLBs after a number of pages
906# are unmapped instead of sending one IPI per page to flush. The architecture
907# must provide guarantees on what happens if a clean TLB cache entry is
908# written after the unmap. Details are in mm/rmap.c near the check for
909# should_defer_flush. The architecture should also consider if the full flush
910# and the refill costs are offset by the savings of sending fewer IPIs.
911config ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
912	bool
913
914config CC_HAS_INT128
915	def_bool !$(cc-option,$(m64-flag) -D__SIZEOF_INT128__=0) && 64BIT
916
917#
918# For architectures that know their GCC __int128 support is sound
919#
920config ARCH_SUPPORTS_INT128
921	bool
922
923# For architectures that (ab)use NUMA to represent different memory regions
924# all cpu-local but of different latencies, such as SuperH.
925#
926config ARCH_WANT_NUMA_VARIABLE_LOCALITY
927	bool
928
929config NUMA_BALANCING
930	bool "Memory placement aware NUMA scheduler"
931	depends on ARCH_SUPPORTS_NUMA_BALANCING
932	depends on !ARCH_WANT_NUMA_VARIABLE_LOCALITY
933	depends on SMP && NUMA && MIGRATION
934	help
935	  This option adds support for automatic NUMA aware memory/task placement.
936	  The mechanism is quite primitive and is based on migrating memory when
937	  it has references to the node the task is running on.
938
939	  This system will be inactive on UMA systems.
940
941config NUMA_BALANCING_DEFAULT_ENABLED
942	bool "Automatically enable NUMA aware memory/task placement"
943	default y
944	depends on NUMA_BALANCING
945	help
946	  If set, automatic NUMA balancing will be enabled if running on a NUMA
947	  machine.
948
949menuconfig CGROUPS
950	bool "Control Group support"
951	select KERNFS
952	help
953	  This option adds support for grouping sets of processes together, for
954	  use with process control subsystems such as Cpusets, CFS, memory
955	  controls or device isolation.
956	  See
957		- Documentation/scheduler/sched-design-CFS.rst	(CFS)
958		- Documentation/admin-guide/cgroup-v1/ (features for grouping, isolation
959					  and resource control)
960
961	  Say N if unsure.
962
963if CGROUPS
964
965config PAGE_COUNTER
966	bool
967
968config MEMCG
969	bool "Memory controller"
970	select PAGE_COUNTER
971	select EVENTFD
972	help
973	  Provides control over the memory footprint of tasks in a cgroup.
974
975config MEMCG_SWAP
976	bool
977	depends on MEMCG && SWAP
978	default y
979
980config MEMCG_KMEM
981	bool
982	depends on MEMCG && !SLOB
983	default y
984
985config BLK_CGROUP
986	bool "IO controller"
987	depends on BLOCK
988	default n
989	help
990	Generic block IO controller cgroup interface. This is the common
991	cgroup interface which should be used by various IO controlling
992	policies.
993
994	Currently, CFQ IO scheduler uses it to recognize task groups and
995	control disk bandwidth allocation (proportional time slice allocation)
996	to such task groups. It is also used by bio throttling logic in
997	block layer to implement upper limit in IO rates on a device.
998
999	This option only enables generic Block IO controller infrastructure.
1000	One needs to also enable actual IO controlling logic/policy. For
1001	enabling proportional weight division of disk bandwidth in CFQ, set
1002	CONFIG_BFQ_GROUP_IOSCHED=y; for enabling throttling policy, set
1003	CONFIG_BLK_DEV_THROTTLING=y.
1004
1005	See Documentation/admin-guide/cgroup-v1/blkio-controller.rst for more information.
1006
1007config CGROUP_WRITEBACK
1008	bool
1009	depends on MEMCG && BLK_CGROUP
1010	default y
1011
1012menuconfig CGROUP_SCHED
1013	bool "CPU controller"
1014	default n
1015	help
1016	  This feature lets CPU scheduler recognize task groups and control CPU
1017	  bandwidth allocation to such task groups. It uses cgroups to group
1018	  tasks.
1019
1020if CGROUP_SCHED
1021config FAIR_GROUP_SCHED
1022	bool "Group scheduling for SCHED_OTHER"
1023	depends on CGROUP_SCHED
1024	default CGROUP_SCHED
1025
1026config CFS_BANDWIDTH
1027	bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
1028	depends on FAIR_GROUP_SCHED
1029	default n
1030	help
1031	  This option allows users to define CPU bandwidth rates (limits) for
1032	  tasks running within the fair group scheduler.  Groups with no limit
1033	  set are considered to be unconstrained and will run with no
1034	  restriction.
1035	  See Documentation/scheduler/sched-bwc.rst for more information.
1036
1037config RT_GROUP_SCHED
1038	bool "Group scheduling for SCHED_RR/FIFO"
1039	depends on CGROUP_SCHED
1040	default n
1041	help
1042	  This feature lets you explicitly allocate real CPU bandwidth
1043	  to task groups. If enabled, it will also make it impossible to
1044	  schedule realtime tasks for non-root users until you allocate
1045	  realtime bandwidth for them.
1046	  See Documentation/scheduler/sched-rt-group.rst for more information.
1047
1048endif #CGROUP_SCHED
1049
1050config UCLAMP_TASK_GROUP
1051	bool "Utilization clamping per group of tasks"
1052	depends on CGROUP_SCHED
1053	depends on UCLAMP_TASK
1054	default n
1055	help
1056	  This feature enables the scheduler to track the clamped utilization
1057	  of each CPU based on RUNNABLE tasks currently scheduled on that CPU.
1058
1059	  When this option is enabled, the user can specify a min and max
1060	  CPU bandwidth which is allowed for each single task in a group.
1061	  The max bandwidth allows to clamp the maximum frequency a task
1062	  can use, while the min bandwidth allows to define a minimum
1063	  frequency a task will always use.
1064
1065	  When task group based utilization clamping is enabled, an eventually
1066	  specified task-specific clamp value is constrained by the cgroup
1067	  specified clamp value. Both minimum and maximum task clamping cannot
1068	  be bigger than the corresponding clamping defined at task group level.
1069
1070	  If in doubt, say N.
1071
1072config CGROUP_PIDS
1073	bool "PIDs controller"
1074	help
1075	  Provides enforcement of process number limits in the scope of a
1076	  cgroup. Any attempt to fork more processes than is allowed in the
1077	  cgroup will fail. PIDs are fundamentally a global resource because it
1078	  is fairly trivial to reach PID exhaustion before you reach even a
1079	  conservative kmemcg limit. As a result, it is possible to grind a
1080	  system to halt without being limited by other cgroup policies. The
1081	  PIDs controller is designed to stop this from happening.
1082
1083	  It should be noted that organisational operations (such as attaching
1084	  to a cgroup hierarchy) will *not* be blocked by the PIDs controller,
1085	  since the PIDs limit only affects a process's ability to fork, not to
1086	  attach to a cgroup.
1087
1088config CGROUP_RDMA
1089	bool "RDMA controller"
1090	help
1091	  Provides enforcement of RDMA resources defined by IB stack.
1092	  It is fairly easy for consumers to exhaust RDMA resources, which
1093	  can result into resource unavailability to other consumers.
1094	  RDMA controller is designed to stop this from happening.
1095	  Attaching processes with active RDMA resources to the cgroup
1096	  hierarchy is allowed even if can cross the hierarchy's limit.
1097
1098config CGROUP_FREEZER
1099	bool "Freezer controller"
1100	help
1101	  Provides a way to freeze and unfreeze all tasks in a
1102	  cgroup.
1103
1104	  This option affects the ORIGINAL cgroup interface. The cgroup2 memory
1105	  controller includes important in-kernel memory consumers per default.
1106
1107	  If you're using cgroup2, say N.
1108
1109config CGROUP_HUGETLB
1110	bool "HugeTLB controller"
1111	depends on HUGETLB_PAGE
1112	select PAGE_COUNTER
1113	default n
1114	help
1115	  Provides a cgroup controller for HugeTLB pages.
1116	  When you enable this, you can put a per cgroup limit on HugeTLB usage.
1117	  The limit is enforced during page fault. Since HugeTLB doesn't
1118	  support page reclaim, enforcing the limit at page fault time implies
1119	  that, the application will get SIGBUS signal if it tries to access
1120	  HugeTLB pages beyond its limit. This requires the application to know
1121	  beforehand how much HugeTLB pages it would require for its use. The
1122	  control group is tracked in the third page lru pointer. This means
1123	  that we cannot use the controller with huge page less than 3 pages.
1124
1125config CPUSETS
1126	bool "Cpuset controller"
1127	depends on SMP
1128	help
1129	  This option will let you create and manage CPUSETs which
1130	  allow dynamically partitioning a system into sets of CPUs and
1131	  Memory Nodes and assigning tasks to run only within those sets.
1132	  This is primarily useful on large SMP or NUMA systems.
1133
1134	  Say N if unsure.
1135
1136config PROC_PID_CPUSET
1137	bool "Include legacy /proc/<pid>/cpuset file"
1138	depends on CPUSETS
1139	default y
1140
1141config CGROUP_DEVICE
1142	bool "Device controller"
1143	help
1144	  Provides a cgroup controller implementing whitelists for
1145	  devices which a process in the cgroup can mknod or open.
1146
1147config CGROUP_CPUACCT
1148	bool "Simple CPU accounting controller"
1149	help
1150	  Provides a simple controller for monitoring the
1151	  total CPU consumed by the tasks in a cgroup.
1152
1153config CGROUP_PERF
1154	bool "Perf controller"
1155	depends on PERF_EVENTS
1156	help
1157	  This option extends the perf per-cpu mode to restrict monitoring
1158	  to threads which belong to the cgroup specified and run on the
1159	  designated cpu.  Or this can be used to have cgroup ID in samples
1160	  so that it can monitor performance events among cgroups.
1161
1162	  Say N if unsure.
1163
1164config CGROUP_BPF
1165	bool "Support for eBPF programs attached to cgroups"
1166	depends on BPF_SYSCALL
1167	select SOCK_CGROUP_DATA
1168	help
1169	  Allow attaching eBPF programs to a cgroup using the bpf(2)
1170	  syscall command BPF_PROG_ATTACH.
1171
1172	  In which context these programs are accessed depends on the type
1173	  of attachment. For instance, programs that are attached using
1174	  BPF_CGROUP_INET_INGRESS will be executed on the ingress path of
1175	  inet sockets.
1176
1177config CGROUP_DEBUG
1178	bool "Debug controller"
1179	default n
1180	depends on DEBUG_KERNEL
1181	help
1182	  This option enables a simple controller that exports
1183	  debugging information about the cgroups framework. This
1184	  controller is for control cgroup debugging only. Its
1185	  interfaces are not stable.
1186
1187	  Say N.
1188
1189config SOCK_CGROUP_DATA
1190	bool
1191	default n
1192
1193endif # CGROUPS
1194
1195menuconfig NAMESPACES
1196	bool "Namespaces support" if EXPERT
1197	depends on MULTIUSER
1198	default !EXPERT
1199	help
1200	  Provides the way to make tasks work with different objects using
1201	  the same id. For example same IPC id may refer to different objects
1202	  or same user id or pid may refer to different tasks when used in
1203	  different namespaces.
1204
1205if NAMESPACES
1206
1207config UTS_NS
1208	bool "UTS namespace"
1209	default y
1210	help
1211	  In this namespace tasks see different info provided with the
1212	  uname() system call
1213
1214config TIME_NS
1215	bool "TIME namespace"
1216	depends on GENERIC_VDSO_TIME_NS
1217	default y
1218	help
1219	  In this namespace boottime and monotonic clocks can be set.
1220	  The time will keep going with the same pace.
1221
1222config IPC_NS
1223	bool "IPC namespace"
1224	depends on (SYSVIPC || POSIX_MQUEUE)
1225	default y
1226	help
1227	  In this namespace tasks work with IPC ids which correspond to
1228	  different IPC objects in different namespaces.
1229
1230config USER_NS
1231	bool "User namespace"
1232	default n
1233	help
1234	  This allows containers, i.e. vservers, to use user namespaces
1235	  to provide different user info for different servers.
1236
1237	  When user namespaces are enabled in the kernel it is
1238	  recommended that the MEMCG option also be enabled and that
1239	  user-space use the memory control groups to limit the amount
1240	  of memory a memory unprivileged users can use.
1241
1242	  If unsure, say N.
1243
1244config PID_NS
1245	bool "PID Namespaces"
1246	default y
1247	help
1248	  Support process id namespaces.  This allows having multiple
1249	  processes with the same pid as long as they are in different
1250	  pid namespaces.  This is a building block of containers.
1251
1252config NET_NS
1253	bool "Network namespace"
1254	depends on NET
1255	default y
1256	help
1257	  Allow user space to create what appear to be multiple instances
1258	  of the network stack.
1259
1260endif # NAMESPACES
1261
1262config CHECKPOINT_RESTORE
1263	bool "Checkpoint/restore support"
1264	select PROC_CHILDREN
1265	select KCMP
1266	default n
1267	help
1268	  Enables additional kernel features in a sake of checkpoint/restore.
1269	  In particular it adds auxiliary prctl codes to setup process text,
1270	  data and heap segment sizes, and a few additional /proc filesystem
1271	  entries.
1272
1273	  If unsure, say N here.
1274
1275config SCHED_AUTOGROUP
1276	bool "Automatic process group scheduling"
1277	select CGROUPS
1278	select CGROUP_SCHED
1279	select FAIR_GROUP_SCHED
1280	help
1281	  This option optimizes the scheduler for common desktop workloads by
1282	  automatically creating and populating task groups.  This separation
1283	  of workloads isolates aggressive CPU burners (like build jobs) from
1284	  desktop applications.  Task group autogeneration is currently based
1285	  upon task session.
1286
1287config SYSFS_DEPRECATED
1288	bool "Enable deprecated sysfs features to support old userspace tools"
1289	depends on SYSFS
1290	default n
1291	help
1292	  This option adds code that switches the layout of the "block" class
1293	  devices, to not show up in /sys/class/block/, but only in
1294	  /sys/block/.
1295
1296	  This switch is only active when the sysfs.deprecated=1 boot option is
1297	  passed or the SYSFS_DEPRECATED_V2 option is set.
1298
1299	  This option allows new kernels to run on old distributions and tools,
1300	  which might get confused by /sys/class/block/. Since 2007/2008 all
1301	  major distributions and tools handle this just fine.
1302
1303	  Recent distributions and userspace tools after 2009/2010 depend on
1304	  the existence of /sys/class/block/, and will not work with this
1305	  option enabled.
1306
1307	  Only if you are using a new kernel on an old distribution, you might
1308	  need to say Y here.
1309
1310config SYSFS_DEPRECATED_V2
1311	bool "Enable deprecated sysfs features by default"
1312	default n
1313	depends on SYSFS
1314	depends on SYSFS_DEPRECATED
1315	help
1316	  Enable deprecated sysfs by default.
1317
1318	  See the CONFIG_SYSFS_DEPRECATED option for more details about this
1319	  option.
1320
1321	  Only if you are using a new kernel on an old distribution, you might
1322	  need to say Y here. Even then, odds are you would not need it
1323	  enabled, you can always pass the boot option if absolutely necessary.
1324
1325config RELAY
1326	bool "Kernel->user space relay support (formerly relayfs)"
1327	select IRQ_WORK
1328	help
1329	  This option enables support for relay interface support in
1330	  certain file systems (such as debugfs).
1331	  It is designed to provide an efficient mechanism for tools and
1332	  facilities to relay large amounts of data from kernel space to
1333	  user space.
1334
1335	  If unsure, say N.
1336
1337config BLK_DEV_INITRD
1338	bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
1339	help
1340	  The initial RAM filesystem is a ramfs which is loaded by the
1341	  boot loader (loadlin or lilo) and that is mounted as root
1342	  before the normal boot procedure. It is typically used to
1343	  load modules needed to mount the "real" root file system,
1344	  etc. See <file:Documentation/admin-guide/initrd.rst> for details.
1345
1346	  If RAM disk support (BLK_DEV_RAM) is also included, this
1347	  also enables initial RAM disk (initrd) support and adds
1348	  15 Kbytes (more on some other architectures) to the kernel size.
1349
1350	  If unsure say Y.
1351
1352if BLK_DEV_INITRD
1353
1354source "usr/Kconfig"
1355
1356endif
1357
1358config BOOT_CONFIG
1359	bool "Boot config support"
1360	select BLK_DEV_INITRD
1361	help
1362	  Extra boot config allows system admin to pass a config file as
1363	  complemental extension of kernel cmdline when booting.
1364	  The boot config file must be attached at the end of initramfs
1365	  with checksum, size and magic word.
1366	  See <file:Documentation/admin-guide/bootconfig.rst> for details.
1367
1368	  If unsure, say Y.
1369
1370choice
1371	prompt "Compiler optimization level"
1372	default CC_OPTIMIZE_FOR_PERFORMANCE
1373
1374config CC_OPTIMIZE_FOR_PERFORMANCE
1375	bool "Optimize for performance (-O2)"
1376	help
1377	  This is the default optimization level for the kernel, building
1378	  with the "-O2" compiler flag for best performance and most
1379	  helpful compile-time warnings.
1380
1381config CC_OPTIMIZE_FOR_PERFORMANCE_O3
1382	bool "Optimize more for performance (-O3)"
1383	depends on ARC
1384	help
1385	  Choosing this option will pass "-O3" to your compiler to optimize
1386	  the kernel yet more for performance.
1387
1388config CC_OPTIMIZE_FOR_SIZE
1389	bool "Optimize for size (-Os)"
1390	help
1391	  Choosing this option will pass "-Os" to your compiler resulting
1392	  in a smaller kernel.
1393
1394endchoice
1395
1396config HAVE_LD_DEAD_CODE_DATA_ELIMINATION
1397	bool
1398	help
1399	  This requires that the arch annotates or otherwise protects
1400	  its external entry points from being discarded. Linker scripts
1401	  must also merge .text.*, .data.*, and .bss.* correctly into
1402	  output sections. Care must be taken not to pull in unrelated
1403	  sections (e.g., '.text.init'). Typically '.' in section names
1404	  is used to distinguish them from label names / C identifiers.
1405
1406config LD_DEAD_CODE_DATA_ELIMINATION
1407	bool "Dead code and data elimination (EXPERIMENTAL)"
1408	depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION
1409	depends on EXPERT
1410	depends on $(cc-option,-ffunction-sections -fdata-sections)
1411	depends on $(ld-option,--gc-sections)
1412	help
1413	  Enable this if you want to do dead code and data elimination with
1414	  the linker by compiling with -ffunction-sections -fdata-sections,
1415	  and linking with --gc-sections.
1416
1417	  This can reduce on disk and in-memory size of the kernel
1418	  code and static data, particularly for small configs and
1419	  on small systems. This has the possibility of introducing
1420	  silently broken kernel if the required annotations are not
1421	  present. This option is not well tested yet, so use at your
1422	  own risk.
1423
1424config LD_ORPHAN_WARN
1425	def_bool y
1426	depends on ARCH_WANT_LD_ORPHAN_WARN
1427	depends on !LD_IS_LLD || LLD_VERSION >= 110000
1428	depends on $(ld-option,--orphan-handling=warn)
1429
1430config SYSCTL
1431	bool
1432
1433config HAVE_UID16
1434	bool
1435
1436config SYSCTL_EXCEPTION_TRACE
1437	bool
1438	help
1439	  Enable support for /proc/sys/debug/exception-trace.
1440
1441config SYSCTL_ARCH_UNALIGN_NO_WARN
1442	bool
1443	help
1444	  Enable support for /proc/sys/kernel/ignore-unaligned-usertrap
1445	  Allows arch to define/use @no_unaligned_warning to possibly warn
1446	  about unaligned access emulation going on under the hood.
1447
1448config SYSCTL_ARCH_UNALIGN_ALLOW
1449	bool
1450	help
1451	  Enable support for /proc/sys/kernel/unaligned-trap
1452	  Allows arches to define/use @unaligned_enabled to runtime toggle
1453	  the unaligned access emulation.
1454	  see arch/parisc/kernel/unaligned.c for reference
1455
1456config HAVE_PCSPKR_PLATFORM
1457	bool
1458
1459# interpreter that classic socket filters depend on
1460config BPF
1461	bool
1462
1463menuconfig EXPERT
1464	bool "Configure standard kernel features (expert users)"
1465	# Unhide debug options, to make the on-by-default options visible
1466	select DEBUG_KERNEL
1467	help
1468	  This option allows certain base kernel options and settings
1469	  to be disabled or tweaked. This is for specialized
1470	  environments which can tolerate a "non-standard" kernel.
1471	  Only use this if you really know what you are doing.
1472
1473config UID16
1474	bool "Enable 16-bit UID system calls" if EXPERT
1475	depends on HAVE_UID16 && MULTIUSER
1476	default y
1477	help
1478	  This enables the legacy 16-bit UID syscall wrappers.
1479
1480config MULTIUSER
1481	bool "Multiple users, groups and capabilities support" if EXPERT
1482	default y
1483	help
1484	  This option enables support for non-root users, groups and
1485	  capabilities.
1486
1487	  If you say N here, all processes will run with UID 0, GID 0, and all
1488	  possible capabilities.  Saying N here also compiles out support for
1489	  system calls related to UIDs, GIDs, and capabilities, such as setuid,
1490	  setgid, and capset.
1491
1492	  If unsure, say Y here.
1493
1494config SGETMASK_SYSCALL
1495	bool "sgetmask/ssetmask syscalls support" if EXPERT
1496	def_bool PARISC || M68K || PPC || MIPS || X86 || SPARC || MICROBLAZE || SUPERH
1497	help
1498	  sys_sgetmask and sys_ssetmask are obsolete system calls
1499	  no longer supported in libc but still enabled by default in some
1500	  architectures.
1501
1502	  If unsure, leave the default option here.
1503
1504config SYSFS_SYSCALL
1505	bool "Sysfs syscall support" if EXPERT
1506	default y
1507	help
1508	  sys_sysfs is an obsolete system call no longer supported in libc.
1509	  Note that disabling this option is more secure but might break
1510	  compatibility with some systems.
1511
1512	  If unsure say Y here.
1513
1514config FHANDLE
1515	bool "open by fhandle syscalls" if EXPERT
1516	select EXPORTFS
1517	default y
1518	help
1519	  If you say Y here, a user level program will be able to map
1520	  file names to handle and then later use the handle for
1521	  different file system operations. This is useful in implementing
1522	  userspace file servers, which now track files using handles instead
1523	  of names. The handle would remain the same even if file names
1524	  get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
1525	  syscalls.
1526
1527config POSIX_TIMERS
1528	bool "Posix Clocks & timers" if EXPERT
1529	default y
1530	help
1531	  This includes native support for POSIX timers to the kernel.
1532	  Some embedded systems have no use for them and therefore they
1533	  can be configured out to reduce the size of the kernel image.
1534
1535	  When this option is disabled, the following syscalls won't be
1536	  available: timer_create, timer_gettime: timer_getoverrun,
1537	  timer_settime, timer_delete, clock_adjtime, getitimer,
1538	  setitimer, alarm. Furthermore, the clock_settime, clock_gettime,
1539	  clock_getres and clock_nanosleep syscalls will be limited to
1540	  CLOCK_REALTIME, CLOCK_MONOTONIC and CLOCK_BOOTTIME only.
1541
1542	  If unsure say y.
1543
1544config PRINTK
1545	default y
1546	bool "Enable support for printk" if EXPERT
1547	select IRQ_WORK
1548	help
1549	  This option enables normal printk support. Removing it
1550	  eliminates most of the message strings from the kernel image
1551	  and makes the kernel more or less silent. As this makes it
1552	  very difficult to diagnose system problems, saying N here is
1553	  strongly discouraged.
1554
1555config PRINTK_NMI
1556	def_bool y
1557	depends on PRINTK
1558	depends on HAVE_NMI
1559
1560config BUG
1561	bool "BUG() support" if EXPERT
1562	default y
1563	help
1564	  Disabling this option eliminates support for BUG and WARN, reducing
1565	  the size of your kernel image and potentially quietly ignoring
1566	  numerous fatal conditions. You should only consider disabling this
1567	  option for embedded systems with no facilities for reporting errors.
1568	  Just say Y.
1569
1570config ELF_CORE
1571	depends on COREDUMP
1572	default y
1573	bool "Enable ELF core dumps" if EXPERT
1574	help
1575	  Enable support for generating core dumps. Disabling saves about 4k.
1576
1577
1578config PCSPKR_PLATFORM
1579	bool "Enable PC-Speaker support" if EXPERT
1580	depends on HAVE_PCSPKR_PLATFORM
1581	select I8253_LOCK
1582	default y
1583	help
1584	  This option allows to disable the internal PC-Speaker
1585	  support, saving some memory.
1586
1587config BASE_FULL
1588	default y
1589	bool "Enable full-sized data structures for core" if EXPERT
1590	help
1591	  Disabling this option reduces the size of miscellaneous core
1592	  kernel data structures. This saves memory on small machines,
1593	  but may reduce performance.
1594
1595config FUTEX
1596	bool "Enable futex support" if EXPERT
1597	default y
1598	imply RT_MUTEXES
1599	help
1600	  Disabling this option will cause the kernel to be built without
1601	  support for "fast userspace mutexes".  The resulting kernel may not
1602	  run glibc-based applications correctly.
1603
1604config FUTEX_PI
1605	bool
1606	depends on FUTEX && RT_MUTEXES
1607	default y
1608
1609config HAVE_FUTEX_CMPXCHG
1610	bool
1611	depends on FUTEX
1612	help
1613	  Architectures should select this if futex_atomic_cmpxchg_inatomic()
1614	  is implemented and always working. This removes a couple of runtime
1615	  checks.
1616
1617config EPOLL
1618	bool "Enable eventpoll support" if EXPERT
1619	default y
1620	help
1621	  Disabling this option will cause the kernel to be built without
1622	  support for epoll family of system calls.
1623
1624config SIGNALFD
1625	bool "Enable signalfd() system call" if EXPERT
1626	default y
1627	help
1628	  Enable the signalfd() system call that allows to receive signals
1629	  on a file descriptor.
1630
1631	  If unsure, say Y.
1632
1633config TIMERFD
1634	bool "Enable timerfd() system call" if EXPERT
1635	default y
1636	help
1637	  Enable the timerfd() system call that allows to receive timer
1638	  events on a file descriptor.
1639
1640	  If unsure, say Y.
1641
1642config EVENTFD
1643	bool "Enable eventfd() system call" if EXPERT
1644	default y
1645	help
1646	  Enable the eventfd() system call that allows to receive both
1647	  kernel notification (ie. KAIO) or userspace notifications.
1648
1649	  If unsure, say Y.
1650
1651config SHMEM
1652	bool "Use full shmem filesystem" if EXPERT
1653	default y
1654	depends on MMU
1655	help
1656	  The shmem is an internal filesystem used to manage shared memory.
1657	  It is backed by swap and manages resource limits. It is also exported
1658	  to userspace as tmpfs if TMPFS is enabled. Disabling this
1659	  option replaces shmem and tmpfs with the much simpler ramfs code,
1660	  which may be appropriate on small systems without swap.
1661
1662config AIO
1663	bool "Enable AIO support" if EXPERT
1664	default y
1665	help
1666	  This option enables POSIX asynchronous I/O which may by used
1667	  by some high performance threaded applications. Disabling
1668	  this option saves about 7k.
1669
1670config IO_URING
1671	bool "Enable IO uring support" if EXPERT
1672	select IO_WQ
1673	default y
1674	help
1675	  This option enables support for the io_uring interface, enabling
1676	  applications to submit and complete IO through submission and
1677	  completion rings that are shared between the kernel and application.
1678
1679config ADVISE_SYSCALLS
1680	bool "Enable madvise/fadvise syscalls" if EXPERT
1681	default y
1682	help
1683	  This option enables the madvise and fadvise syscalls, used by
1684	  applications to advise the kernel about their future memory or file
1685	  usage, improving performance. If building an embedded system where no
1686	  applications use these syscalls, you can disable this option to save
1687	  space.
1688
1689config HAVE_ARCH_USERFAULTFD_WP
1690	bool
1691	help
1692	  Arch has userfaultfd write protection support
1693
1694config MEMBARRIER
1695	bool "Enable membarrier() system call" if EXPERT
1696	default y
1697	help
1698	  Enable the membarrier() system call that allows issuing memory
1699	  barriers across all running threads, which can be used to distribute
1700	  the cost of user-space memory barriers asymmetrically by transforming
1701	  pairs of memory barriers into pairs consisting of membarrier() and a
1702	  compiler barrier.
1703
1704	  If unsure, say Y.
1705
1706config KALLSYMS
1707	bool "Load all symbols for debugging/ksymoops" if EXPERT
1708	default y
1709	help
1710	  Say Y here to let the kernel print out symbolic crash information and
1711	  symbolic stack backtraces. This increases the size of the kernel
1712	  somewhat, as all symbols have to be loaded into the kernel image.
1713
1714config KALLSYMS_ALL
1715	bool "Include all symbols in kallsyms"
1716	depends on DEBUG_KERNEL && KALLSYMS
1717	help
1718	  Normally kallsyms only contains the symbols of functions for nicer
1719	  OOPS messages and backtraces (i.e., symbols from the text and inittext
1720	  sections). This is sufficient for most cases. And only in very rare
1721	  cases (e.g., when a debugger is used) all symbols are required (e.g.,
1722	  names of variables from the data sections, etc).
1723
1724	  This option makes sure that all symbols are loaded into the kernel
1725	  image (i.e., symbols from all sections) in cost of increased kernel
1726	  size (depending on the kernel configuration, it may be 300KiB or
1727	  something like this).
1728
1729	  Say N unless you really need all symbols.
1730
1731config KALLSYMS_ABSOLUTE_PERCPU
1732	bool
1733	depends on KALLSYMS
1734	default X86_64 && SMP
1735
1736config KALLSYMS_BASE_RELATIVE
1737	bool
1738	depends on KALLSYMS
1739	default !IA64
1740	help
1741	  Instead of emitting them as absolute values in the native word size,
1742	  emit the symbol references in the kallsyms table as 32-bit entries,
1743	  each containing a relative value in the range [base, base + U32_MAX]
1744	  or, when KALLSYMS_ABSOLUTE_PERCPU is in effect, each containing either
1745	  an absolute value in the range [0, S32_MAX] or a relative value in the
1746	  range [base, base + S32_MAX], where base is the lowest relative symbol
1747	  address encountered in the image.
1748
1749	  On 64-bit builds, this reduces the size of the address table by 50%,
1750	  but more importantly, it results in entries whose values are build
1751	  time constants, and no relocation pass is required at runtime to fix
1752	  up the entries based on the runtime load address of the kernel.
1753
1754# end of the "standard kernel features (expert users)" menu
1755
1756# syscall, maps, verifier
1757
1758config BPF_LSM
1759	bool "LSM Instrumentation with BPF"
1760	depends on BPF_EVENTS
1761	depends on BPF_SYSCALL
1762	depends on SECURITY
1763	depends on BPF_JIT
1764	help
1765	  Enables instrumentation of the security hooks with eBPF programs for
1766	  implementing dynamic MAC and Audit Policies.
1767
1768	  If you are unsure how to answer this question, answer N.
1769
1770config BPF_SYSCALL
1771	bool "Enable bpf() system call"
1772	select BPF
1773	select IRQ_WORK
1774	select TASKS_TRACE_RCU
1775	default n
1776	help
1777	  Enable the bpf() system call that allows to manipulate eBPF
1778	  programs and maps via file descriptors.
1779
1780config ARCH_WANT_DEFAULT_BPF_JIT
1781	bool
1782
1783config BPF_JIT_ALWAYS_ON
1784	bool "Permanently enable BPF JIT and remove BPF interpreter"
1785	depends on BPF_SYSCALL && HAVE_EBPF_JIT && BPF_JIT
1786	help
1787	  Enables BPF JIT and removes BPF interpreter to avoid
1788	  speculative execution of BPF instructions by the interpreter
1789
1790config BPF_JIT_DEFAULT_ON
1791	def_bool ARCH_WANT_DEFAULT_BPF_JIT || BPF_JIT_ALWAYS_ON
1792	depends on HAVE_EBPF_JIT && BPF_JIT
1793
1794config BPF_UNPRIV_DEFAULT_OFF
1795	bool "Disable unprivileged BPF by default"
1796	depends on BPF_SYSCALL
1797	help
1798	  Disables unprivileged BPF by default by setting the corresponding
1799	  /proc/sys/kernel/unprivileged_bpf_disabled knob to 2. An admin can
1800	  still reenable it by setting it to 0 later on, or permanently
1801	  disable it by setting it to 1 (from which no other transition to
1802	  0 is possible anymore).
1803
1804source "kernel/bpf/preload/Kconfig"
1805
1806config USERFAULTFD
1807	bool "Enable userfaultfd() system call"
1808	depends on MMU
1809	help
1810	  Enable the userfaultfd() system call that allows to intercept and
1811	  handle page faults in userland.
1812
1813config ARCH_HAS_MEMBARRIER_CALLBACKS
1814	bool
1815
1816config ARCH_HAS_MEMBARRIER_SYNC_CORE
1817	bool
1818
1819config KCMP
1820	bool "Enable kcmp() system call" if EXPERT
1821	help
1822	  Enable the kernel resource comparison system call. It provides
1823	  user-space with the ability to compare two processes to see if they
1824	  share a common resource, such as a file descriptor or even virtual
1825	  memory space.
1826
1827	  If unsure, say N.
1828
1829config RSEQ
1830	bool "Enable rseq() system call" if EXPERT
1831	default y
1832	depends on HAVE_RSEQ
1833	select MEMBARRIER
1834	help
1835	  Enable the restartable sequences system call. It provides a
1836	  user-space cache for the current CPU number value, which
1837	  speeds up getting the current CPU number from user-space,
1838	  as well as an ABI to speed up user-space operations on
1839	  per-CPU data.
1840
1841	  If unsure, say Y.
1842
1843config DEBUG_RSEQ
1844	default n
1845	bool "Enabled debugging of rseq() system call" if EXPERT
1846	depends on RSEQ && DEBUG_KERNEL
1847	help
1848	  Enable extra debugging checks for the rseq system call.
1849
1850	  If unsure, say N.
1851
1852config EMBEDDED
1853	bool "Embedded system"
1854	option allnoconfig_y
1855	select EXPERT
1856	help
1857	  This option should be enabled if compiling the kernel for
1858	  an embedded system so certain expert options are available
1859	  for configuration.
1860
1861config HAVE_PERF_EVENTS
1862	bool
1863	help
1864	  See tools/perf/design.txt for details.
1865
1866config PERF_USE_VMALLOC
1867	bool
1868	help
1869	  See tools/perf/design.txt for details
1870
1871config PC104
1872	bool "PC/104 support" if EXPERT
1873	help
1874	  Expose PC/104 form factor device drivers and options available for
1875	  selection and configuration. Enable this option if your target
1876	  machine has a PC/104 bus.
1877
1878menu "Kernel Performance Events And Counters"
1879
1880config PERF_EVENTS
1881	bool "Kernel performance events and counters"
1882	default y if PROFILING
1883	depends on HAVE_PERF_EVENTS
1884	select IRQ_WORK
1885	select SRCU
1886	help
1887	  Enable kernel support for various performance events provided
1888	  by software and hardware.
1889
1890	  Software events are supported either built-in or via the
1891	  use of generic tracepoints.
1892
1893	  Most modern CPUs support performance events via performance
1894	  counter registers. These registers count the number of certain
1895	  types of hw events: such as instructions executed, cachemisses
1896	  suffered, or branches mis-predicted - without slowing down the
1897	  kernel or applications. These registers can also trigger interrupts
1898	  when a threshold number of events have passed - and can thus be
1899	  used to profile the code that runs on that CPU.
1900
1901	  The Linux Performance Event subsystem provides an abstraction of
1902	  these software and hardware event capabilities, available via a
1903	  system call and used by the "perf" utility in tools/perf/. It
1904	  provides per task and per CPU counters, and it provides event
1905	  capabilities on top of those.
1906
1907	  Say Y if unsure.
1908
1909config DEBUG_PERF_USE_VMALLOC
1910	default n
1911	bool "Debug: use vmalloc to back perf mmap() buffers"
1912	depends on PERF_EVENTS && DEBUG_KERNEL && !PPC
1913	select PERF_USE_VMALLOC
1914	help
1915	  Use vmalloc memory to back perf mmap() buffers.
1916
1917	  Mostly useful for debugging the vmalloc code on platforms
1918	  that don't require it.
1919
1920	  Say N if unsure.
1921
1922endmenu
1923
1924config VM_EVENT_COUNTERS
1925	default y
1926	bool "Enable VM event counters for /proc/vmstat" if EXPERT
1927	help
1928	  VM event counters are needed for event counts to be shown.
1929	  This option allows the disabling of the VM event counters
1930	  on EXPERT systems.  /proc/vmstat will only show page counts
1931	  if VM event counters are disabled.
1932
1933config SLUB_DEBUG
1934	default y
1935	bool "Enable SLUB debugging support" if EXPERT
1936	depends on SLUB && SYSFS
1937	help
1938	  SLUB has extensive debug support features. Disabling these can
1939	  result in significant savings in code size. This also disables
1940	  SLUB sysfs support. /sys/slab will not exist and there will be
1941	  no support for cache validation etc.
1942
1943config SLUB_MEMCG_SYSFS_ON
1944	default n
1945	bool "Enable memcg SLUB sysfs support by default" if EXPERT
1946	depends on SLUB && SYSFS && MEMCG
1947	help
1948	  SLUB creates a directory under /sys/kernel/slab for each
1949	  allocation cache to host info and debug files. If memory
1950	  cgroup is enabled, each cache can have per memory cgroup
1951	  caches. SLUB can create the same sysfs directories for these
1952	  caches under /sys/kernel/slab/CACHE/cgroup but it can lead
1953	  to a very high number of debug files being created. This is
1954	  controlled by slub_memcg_sysfs boot parameter and this
1955	  config option determines the parameter's default value.
1956
1957config COMPAT_BRK
1958	bool "Disable heap randomization"
1959	default y
1960	help
1961	  Randomizing heap placement makes heap exploits harder, but it
1962	  also breaks ancient binaries (including anything libc5 based).
1963	  This option changes the bootup default to heap randomization
1964	  disabled, and can be overridden at runtime by setting
1965	  /proc/sys/kernel/randomize_va_space to 2.
1966
1967	  On non-ancient distros (post-2000 ones) N is usually a safe choice.
1968
1969choice
1970	prompt "Choose SLAB allocator"
1971	default SLUB
1972	help
1973	   This option allows to select a slab allocator.
1974
1975config SLAB
1976	bool "SLAB"
1977	select HAVE_HARDENED_USERCOPY_ALLOCATOR
1978	help
1979	  The regular slab allocator that is established and known to work
1980	  well in all environments. It organizes cache hot objects in
1981	  per cpu and per node queues.
1982
1983config SLUB
1984	bool "SLUB (Unqueued Allocator)"
1985	select HAVE_HARDENED_USERCOPY_ALLOCATOR
1986	help
1987	   SLUB is a slab allocator that minimizes cache line usage
1988	   instead of managing queues of cached objects (SLAB approach).
1989	   Per cpu caching is realized using slabs of objects instead
1990	   of queues of objects. SLUB can use memory efficiently
1991	   and has enhanced diagnostics. SLUB is the default choice for
1992	   a slab allocator.
1993
1994config SLOB
1995	depends on EXPERT
1996	bool "SLOB (Simple Allocator)"
1997	help
1998	   SLOB replaces the stock allocator with a drastically simpler
1999	   allocator. SLOB is generally more space efficient but
2000	   does not perform as well on large systems.
2001
2002endchoice
2003
2004config SLAB_MERGE_DEFAULT
2005	bool "Allow slab caches to be merged"
2006	default y
2007	help
2008	  For reduced kernel memory fragmentation, slab caches can be
2009	  merged when they share the same size and other characteristics.
2010	  This carries a risk of kernel heap overflows being able to
2011	  overwrite objects from merged caches (and more easily control
2012	  cache layout), which makes such heap attacks easier to exploit
2013	  by attackers. By keeping caches unmerged, these kinds of exploits
2014	  can usually only damage objects in the same cache. To disable
2015	  merging at runtime, "slab_nomerge" can be passed on the kernel
2016	  command line.
2017
2018config SLAB_FREELIST_RANDOM
2019	bool "Randomize slab freelist"
2020	depends on SLAB || SLUB
2021	help
2022	  Randomizes the freelist order used on creating new pages. This
2023	  security feature reduces the predictability of the kernel slab
2024	  allocator against heap overflows.
2025
2026config SLAB_FREELIST_HARDENED
2027	bool "Harden slab freelist metadata"
2028	depends on SLAB || SLUB
2029	help
2030	  Many kernel heap attacks try to target slab cache metadata and
2031	  other infrastructure. This options makes minor performance
2032	  sacrifices to harden the kernel slab allocator against common
2033	  freelist exploit methods. Some slab implementations have more
2034	  sanity-checking than others. This option is most effective with
2035	  CONFIG_SLUB.
2036
2037config SHUFFLE_PAGE_ALLOCATOR
2038	bool "Page allocator randomization"
2039	default SLAB_FREELIST_RANDOM && ACPI_NUMA
2040	help
2041	  Randomization of the page allocator improves the average
2042	  utilization of a direct-mapped memory-side-cache. See section
2043	  5.2.27 Heterogeneous Memory Attribute Table (HMAT) in the ACPI
2044	  6.2a specification for an example of how a platform advertises
2045	  the presence of a memory-side-cache. There are also incidental
2046	  security benefits as it reduces the predictability of page
2047	  allocations to compliment SLAB_FREELIST_RANDOM, but the
2048	  default granularity of shuffling on the "MAX_ORDER - 1" i.e,
2049	  10th order of pages is selected based on cache utilization
2050	  benefits on x86.
2051
2052	  While the randomization improves cache utilization it may
2053	  negatively impact workloads on platforms without a cache. For
2054	  this reason, by default, the randomization is enabled only
2055	  after runtime detection of a direct-mapped memory-side-cache.
2056	  Otherwise, the randomization may be force enabled with the
2057	  'page_alloc.shuffle' kernel command line parameter.
2058
2059	  Say Y if unsure.
2060
2061config SLUB_CPU_PARTIAL
2062	default y
2063	depends on SLUB && SMP
2064	bool "SLUB per cpu partial cache"
2065	help
2066	  Per cpu partial caches accelerate objects allocation and freeing
2067	  that is local to a processor at the price of more indeterminism
2068	  in the latency of the free. On overflow these caches will be cleared
2069	  which requires the taking of locks that may cause latency spikes.
2070	  Typically one would choose no for a realtime system.
2071
2072config MMAP_ALLOW_UNINITIALIZED
2073	bool "Allow mmapped anonymous memory to be uninitialized"
2074	depends on EXPERT && !MMU
2075	default n
2076	help
2077	  Normally, and according to the Linux spec, anonymous memory obtained
2078	  from mmap() has its contents cleared before it is passed to
2079	  userspace.  Enabling this config option allows you to request that
2080	  mmap() skip that if it is given an MAP_UNINITIALIZED flag, thus
2081	  providing a huge performance boost.  If this option is not enabled,
2082	  then the flag will be ignored.
2083
2084	  This is taken advantage of by uClibc's malloc(), and also by
2085	  ELF-FDPIC binfmt's brk and stack allocator.
2086
2087	  Because of the obvious security issues, this option should only be
2088	  enabled on embedded devices where you control what is run in
2089	  userspace.  Since that isn't generally a problem on no-MMU systems,
2090	  it is normally safe to say Y here.
2091
2092	  See Documentation/admin-guide/mm/nommu-mmap.rst for more information.
2093
2094config SYSTEM_DATA_VERIFICATION
2095	def_bool n
2096	select SYSTEM_TRUSTED_KEYRING
2097	select KEYS
2098	select CRYPTO
2099	select CRYPTO_RSA
2100	select ASYMMETRIC_KEY_TYPE
2101	select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
2102	select ASN1
2103	select OID_REGISTRY
2104	select X509_CERTIFICATE_PARSER
2105	select PKCS7_MESSAGE_PARSER
2106	help
2107	  Provide PKCS#7 message verification using the contents of the system
2108	  trusted keyring to provide public keys.  This then can be used for
2109	  module verification, kexec image verification and firmware blob
2110	  verification.
2111
2112config PROFILING
2113	bool "Profiling support"
2114	help
2115	  Say Y here to enable the extended profiling support mechanisms used
2116	  by profilers such as OProfile.
2117
2118#
2119# Place an empty function call at each tracepoint site. Can be
2120# dynamically changed for a probe function.
2121#
2122config TRACEPOINTS
2123	bool
2124
2125endmenu		# General setup
2126
2127source "arch/Kconfig"
2128
2129config RT_MUTEXES
2130	bool
2131
2132config BASE_SMALL
2133	int
2134	default 0 if BASE_FULL
2135	default 1 if !BASE_FULL
2136
2137config MODULE_SIG_FORMAT
2138	def_bool n
2139	select SYSTEM_DATA_VERIFICATION
2140
2141menuconfig MODULES
2142	bool "Enable loadable module support"
2143	option modules
2144	help
2145	  Kernel modules are small pieces of compiled code which can
2146	  be inserted in the running kernel, rather than being
2147	  permanently built into the kernel.  You use the "modprobe"
2148	  tool to add (and sometimes remove) them.  If you say Y here,
2149	  many parts of the kernel can be built as modules (by
2150	  answering M instead of Y where indicated): this is most
2151	  useful for infrequently used options which are not required
2152	  for booting.  For more information, see the man pages for
2153	  modprobe, lsmod, modinfo, insmod and rmmod.
2154
2155	  If you say Y here, you will need to run "make
2156	  modules_install" to put the modules under /lib/modules/
2157	  where modprobe can find them (you may need to be root to do
2158	  this).
2159
2160	  If unsure, say Y.
2161
2162if MODULES
2163
2164config MODULE_FORCE_LOAD
2165	bool "Forced module loading"
2166	default n
2167	help
2168	  Allow loading of modules without version information (ie. modprobe
2169	  --force).  Forced module loading sets the 'F' (forced) taint flag and
2170	  is usually a really bad idea.
2171
2172config MODULE_UNLOAD
2173	bool "Module unloading"
2174	help
2175	  Without this option you will not be able to unload any
2176	  modules (note that some modules may not be unloadable
2177	  anyway), which makes your kernel smaller, faster
2178	  and simpler.  If unsure, say Y.
2179
2180config MODULE_FORCE_UNLOAD
2181	bool "Forced module unloading"
2182	depends on MODULE_UNLOAD
2183	help
2184	  This option allows you to force a module to unload, even if the
2185	  kernel believes it is unsafe: the kernel will remove the module
2186	  without waiting for anyone to stop using it (using the -f option to
2187	  rmmod).  This is mainly for kernel developers and desperate users.
2188	  If unsure, say N.
2189
2190config MODVERSIONS
2191	bool "Module versioning support"
2192	help
2193	  Usually, you have to use modules compiled with your kernel.
2194	  Saying Y here makes it sometimes possible to use modules
2195	  compiled for different kernels, by adding enough information
2196	  to the modules to (hopefully) spot any changes which would
2197	  make them incompatible with the kernel you are running.  If
2198	  unsure, say N.
2199
2200config ASM_MODVERSIONS
2201	bool
2202	default HAVE_ASM_MODVERSIONS && MODVERSIONS
2203	help
2204	  This enables module versioning for exported symbols also from
2205	  assembly. This can be enabled only when the target architecture
2206	  supports it.
2207
2208config MODULE_REL_CRCS
2209	bool
2210	depends on MODVERSIONS
2211
2212config MODULE_SRCVERSION_ALL
2213	bool "Source checksum for all modules"
2214	help
2215	  Modules which contain a MODULE_VERSION get an extra "srcversion"
2216	  field inserted into their modinfo section, which contains a
2217    	  sum of the source files which made it.  This helps maintainers
2218	  see exactly which source was used to build a module (since
2219	  others sometimes change the module source without updating
2220	  the version).  With this option, such a "srcversion" field
2221	  will be created for all modules.  If unsure, say N.
2222
2223config MODULE_SIG
2224	bool "Module signature verification"
2225	select MODULE_SIG_FORMAT
2226	help
2227	  Check modules for valid signatures upon load: the signature
2228	  is simply appended to the module. For more information see
2229	  <file:Documentation/admin-guide/module-signing.rst>.
2230
2231	  Note that this option adds the OpenSSL development packages as a
2232	  kernel build dependency so that the signing tool can use its crypto
2233	  library.
2234
2235	  You should enable this option if you wish to use either
2236	  CONFIG_SECURITY_LOCKDOWN_LSM or lockdown functionality imposed via
2237	  another LSM - otherwise unsigned modules will be loadable regardless
2238	  of the lockdown policy.
2239
2240	  !!!WARNING!!!  If you enable this option, you MUST make sure that the
2241	  module DOES NOT get stripped after being signed.  This includes the
2242	  debuginfo strip done by some packagers (such as rpmbuild) and
2243	  inclusion into an initramfs that wants the module size reduced.
2244
2245config MODULE_SIG_FORCE
2246	bool "Require modules to be validly signed"
2247	depends on MODULE_SIG
2248	help
2249	  Reject unsigned modules or signed modules for which we don't have a
2250	  key.  Without this, such modules will simply taint the kernel.
2251
2252config MODULE_SIG_ALL
2253	bool "Automatically sign all modules"
2254	default y
2255	depends on MODULE_SIG
2256	help
2257	  Sign all modules during make modules_install. Without this option,
2258	  modules must be signed manually, using the scripts/sign-file tool.
2259
2260comment "Do not forget to sign required modules with scripts/sign-file"
2261	depends on MODULE_SIG_FORCE && !MODULE_SIG_ALL
2262
2263choice
2264	prompt "Which hash algorithm should modules be signed with?"
2265	depends on MODULE_SIG
2266	help
2267	  This determines which sort of hashing algorithm will be used during
2268	  signature generation.  This algorithm _must_ be built into the kernel
2269	  directly so that signature verification can take place.  It is not
2270	  possible to load a signed module containing the algorithm to check
2271	  the signature on that module.
2272
2273config MODULE_SIG_SHA1
2274	bool "Sign modules with SHA-1"
2275	select CRYPTO_SHA1
2276
2277config MODULE_SIG_SHA224
2278	bool "Sign modules with SHA-224"
2279	select CRYPTO_SHA256
2280
2281config MODULE_SIG_SHA256
2282	bool "Sign modules with SHA-256"
2283	select CRYPTO_SHA256
2284
2285config MODULE_SIG_SHA384
2286	bool "Sign modules with SHA-384"
2287	select CRYPTO_SHA512
2288
2289config MODULE_SIG_SHA512
2290	bool "Sign modules with SHA-512"
2291	select CRYPTO_SHA512
2292
2293endchoice
2294
2295config MODULE_SIG_HASH
2296	string
2297	depends on MODULE_SIG
2298	default "sha1" if MODULE_SIG_SHA1
2299	default "sha224" if MODULE_SIG_SHA224
2300	default "sha256" if MODULE_SIG_SHA256
2301	default "sha384" if MODULE_SIG_SHA384
2302	default "sha512" if MODULE_SIG_SHA512
2303
2304config MODULE_COMPRESS
2305	bool "Compress modules on installation"
2306	help
2307
2308	  Compresses kernel modules when 'make modules_install' is run; gzip or
2309	  xz depending on "Compression algorithm" below.
2310
2311	  module-init-tools MAY support gzip, and kmod MAY support gzip and xz.
2312
2313	  Out-of-tree kernel modules installed using Kbuild will also be
2314	  compressed upon installation.
2315
2316	  Note: for modules inside an initrd or initramfs, it's more efficient
2317	  to compress the whole initrd or initramfs instead.
2318
2319	  Note: This is fully compatible with signed modules.
2320
2321	  If in doubt, say N.
2322
2323choice
2324	prompt "Compression algorithm"
2325	depends on MODULE_COMPRESS
2326	default MODULE_COMPRESS_GZIP
2327	help
2328	  This determines which sort of compression will be used during
2329	  'make modules_install'.
2330
2331	  GZIP (default) and XZ are supported.
2332
2333config MODULE_COMPRESS_GZIP
2334	bool "GZIP"
2335
2336config MODULE_COMPRESS_XZ
2337	bool "XZ"
2338
2339endchoice
2340
2341config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
2342	bool "Allow loading of modules with missing namespace imports"
2343	help
2344	  Symbols exported with EXPORT_SYMBOL_NS*() are considered exported in
2345	  a namespace. A module that makes use of a symbol exported with such a
2346	  namespace is required to import the namespace via MODULE_IMPORT_NS().
2347	  There is no technical reason to enforce correct namespace imports,
2348	  but it creates consistency between symbols defining namespaces and
2349	  users importing namespaces they make use of. This option relaxes this
2350	  requirement and lifts the enforcement when loading a module.
2351
2352	  If unsure, say N.
2353
2354config UNUSED_SYMBOLS
2355	bool "Enable unused/obsolete exported symbols"
2356	default y if X86
2357	help
2358	  Unused but exported symbols make the kernel needlessly bigger.  For
2359	  that reason most of these unused exports will soon be removed.  This
2360	  option is provided temporarily to provide a transition period in case
2361	  some external kernel module needs one of these symbols anyway. If you
2362	  encounter such a case in your module, consider if you are actually
2363	  using the right API.  (rationale: since nobody in the kernel is using
2364	  this in a module, there is a pretty good chance it's actually the
2365	  wrong interface to use).  If you really need the symbol, please send a
2366	  mail to the linux kernel mailing list mentioning the symbol and why
2367	  you really need it, and what the merge plan to the mainline kernel for
2368	  your module is.
2369
2370config TRIM_UNUSED_KSYMS
2371	bool "Trim unused exported kernel symbols"
2372	depends on !UNUSED_SYMBOLS
2373	help
2374	  The kernel and some modules make many symbols available for
2375	  other modules to use via EXPORT_SYMBOL() and variants. Depending
2376	  on the set of modules being selected in your kernel configuration,
2377	  many of those exported symbols might never be used.
2378
2379	  This option allows for unused exported symbols to be dropped from
2380	  the build. In turn, this provides the compiler more opportunities
2381	  (especially when using LTO) for optimizing the code and reducing
2382	  binary size.  This might have some security advantages as well.
2383
2384	  If unsure, or if you need to build out-of-tree modules, say N.
2385
2386config UNUSED_KSYMS_WHITELIST
2387	string "Whitelist of symbols to keep in ksymtab"
2388	depends on TRIM_UNUSED_KSYMS
2389	help
2390	  By default, all unused exported symbols will be un-exported from the
2391	  build when TRIM_UNUSED_KSYMS is selected.
2392
2393	  UNUSED_KSYMS_WHITELIST allows to whitelist symbols that must be kept
2394	  exported at all times, even in absence of in-tree users. The value to
2395	  set here is the path to a text file containing the list of symbols,
2396	  one per line. The path can be absolute, or relative to the kernel
2397	  source tree.
2398
2399endif # MODULES
2400
2401config MODULES_TREE_LOOKUP
2402	def_bool y
2403	depends on PERF_EVENTS || TRACING || CFI_CLANG
2404
2405config INIT_ALL_POSSIBLE
2406	bool
2407	help
2408	  Back when each arch used to define their own cpu_online_mask and
2409	  cpu_possible_mask, some of them chose to initialize cpu_possible_mask
2410	  with all 1s, and others with all 0s.  When they were centralised,
2411	  it was better to provide this option than to break all the archs
2412	  and have several arch maintainers pursuing me down dark alleys.
2413
2414source "block/Kconfig"
2415
2416config PREEMPT_NOTIFIERS
2417	bool
2418
2419config PADATA
2420	depends on SMP
2421	bool
2422
2423config ASN1
2424	tristate
2425	help
2426	  Build a simple ASN.1 grammar compiler that produces a bytecode output
2427	  that can be interpreted by the ASN.1 stream decoder and used to
2428	  inform it as to what tags are to be expected in a stream and what
2429	  functions to call on what tags.
2430
2431source "kernel/Kconfig.locks"
2432
2433config ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
2434	bool
2435
2436config ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
2437	bool
2438
2439# It may be useful for an architecture to override the definitions of the
2440# SYSCALL_DEFINE() and __SYSCALL_DEFINEx() macros in <linux/syscalls.h>
2441# and the COMPAT_ variants in <linux/compat.h>, in particular to use a
2442# different calling convention for syscalls. They can also override the
2443# macros for not-implemented syscalls in kernel/sys_ni.c and
2444# kernel/time/posix-stubs.c. All these overrides need to be available in
2445# <asm/syscall_wrapper.h>.
2446config ARCH_HAS_SYSCALL_WRAPPER
2447	def_bool n
2448