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