1 # SPDX-License-Identifier: GPL-2.0-only
3 # For a description of the syntax of this configuration file,
4 # see Documentation/kbuild/kconfig-language.rst.
15 select ARCH_CLOCKSOURCE_INIT
16 select ARCH_SUPPORTS_ATOMIC_RMW
17 select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
19 select ARCH_HAS_BINFMT_FLAT
20 select ARCH_HAS_DEBUG_VM_PGTABLE
21 select ARCH_HAS_DEBUG_VIRTUAL if MMU
22 select ARCH_HAS_DEBUG_WX
23 select ARCH_HAS_FORTIFY_SOURCE
24 select ARCH_HAS_GCOV_PROFILE_ALL
25 select ARCH_HAS_GIGANTIC_PAGE
27 select ARCH_HAS_MMIOWB
28 select ARCH_HAS_PTE_SPECIAL
29 select ARCH_HAS_SET_DIRECT_MAP
30 select ARCH_HAS_SET_MEMORY
31 select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
32 select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
33 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
34 select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
35 select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
36 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
37 select ARCH_WANT_FRAME_POINTERS
38 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
39 select CLONE_BACKWARDS
40 select CLINT_TIMER if !MMU
43 select GENERIC_ARCH_TOPOLOGY if SMP
44 select GENERIC_ATOMIC64 if !64BIT
45 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
46 select GENERIC_EARLY_IOREMAP
47 select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
48 select GENERIC_IOREMAP
49 select GENERIC_IRQ_MULTI_HANDLER
50 select GENERIC_IRQ_SHOW
51 select GENERIC_LIB_DEVMEM_IS_ALLOWED
52 select GENERIC_PCI_IOMAP
53 select GENERIC_PTDUMP if MMU
54 select GENERIC_SCHED_CLOCK
55 select GENERIC_SMP_IDLE_THREAD
56 select GENERIC_STRNCPY_FROM_USER if MMU
57 select GENERIC_STRNLEN_USER if MMU
58 select GENERIC_TIME_VSYSCALL if MMU && 64BIT
59 select HANDLE_DOMAIN_IRQ
60 select HAVE_ARCH_AUDITSYSCALL
61 select HAVE_ARCH_JUMP_LABEL
62 select HAVE_ARCH_JUMP_LABEL_RELATIVE
63 select HAVE_ARCH_KASAN if MMU && 64BIT
64 select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT
66 select HAVE_ARCH_KGDB_QXFER_PKT
67 select HAVE_ARCH_MMAP_RND_BITS if MMU
68 select HAVE_ARCH_SECCOMP_FILTER
69 select HAVE_ARCH_TRACEHOOK
70 select HAVE_ASM_MODVERSIONS
71 select HAVE_CONTEXT_TRACKING
72 select HAVE_DEBUG_KMEMLEAK
73 select HAVE_DMA_CONTIGUOUS if MMU
74 select HAVE_EBPF_JIT if MMU
75 select HAVE_FUNCTION_ERROR_INJECTION
76 select HAVE_FUTEX_CMPXCHG if FUTEX
77 select HAVE_GCC_PLUGINS
78 select HAVE_GENERIC_VDSO if MMU && 64BIT
79 select HAVE_IRQ_TIME_ACCOUNTING
81 select HAVE_KPROBES_ON_FTRACE
82 select HAVE_KRETPROBES
84 select HAVE_PERF_EVENTS
86 select HAVE_PERF_USER_STACK_DUMP
87 select HAVE_REGS_AND_STACK_ACCESS_API
88 select HAVE_STACKPROTECTOR
89 select HAVE_SYSCALL_TRACEPOINTS
91 select MODULES_USE_ELF_RELA if MODULES
92 select MODULE_SECTIONS if MODULES
94 select OF_EARLY_FLATTREE
96 select PCI_DOMAINS_GENERIC if PCI
99 select RISCV_TIMER if RISCV_SBI
100 select SPARSEMEM_STATIC if 32BIT
102 select SYSCTL_EXCEPTION_TRACE
103 select THREAD_INFO_IN_TASK
104 select UACCESS_MEMCPY if !MMU
106 config ARCH_MMAP_RND_BITS_MIN
110 # max bits determined by the following formula:
111 # VA_BITS - PAGE_SHIFT - 3
112 config ARCH_MMAP_RND_BITS_MAX
113 default 24 if 64BIT # SV39 based
116 # set if we run in machine mode, cleared if we run in supervisor mode
121 # set if we are running in S-mode and can use SBI calls
124 depends on !RISCV_M_MODE
128 bool "MMU-based Paged Memory Management Support"
131 Select if you want MMU-based virtualised addressing space
132 support by paged memory management. If unsure, say 'Y'.
150 default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
151 default 0x80000000 if 64BIT && !MMU
152 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
153 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
155 config ARCH_FLATMEM_ENABLE
158 config ARCH_SPARSEMEM_ENABLE
161 select SPARSEMEM_VMEMMAP_ENABLE
163 config ARCH_SELECT_MEMORY_MODEL
164 def_bool ARCH_SPARSEMEM_ENABLE
166 config ARCH_WANT_GENERAL_HUGETLB
169 config ARCH_SUPPORTS_UPROBES
172 config SYS_SUPPORTS_HUGETLBFS
176 config STACKTRACE_SUPPORT
179 config TRACE_IRQFLAGS_SUPPORT
185 select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
187 config GENERIC_BUG_RELATIVE_POINTERS
190 config GENERIC_CALIBRATE_DELAY
196 config GENERIC_HWEIGHT
199 config FIX_EARLYCON_MEM
202 config PGTABLE_LEVELS
207 config LOCKDEP_SUPPORT
210 source "arch/riscv/Kconfig.socs"
211 source "arch/riscv/Kconfig.erratas"
219 This selects the base ISA that this kernel will target and must match
225 select GENERIC_LIB_ASHLDI3
226 select GENERIC_LIB_ASHRDI3
227 select GENERIC_LIB_LSHRDI3
228 select GENERIC_LIB_UCMPDI2
234 select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
235 select HAVE_DYNAMIC_FTRACE if MMU && $(cc-option,-fpatchable-function-entry=8)
236 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
237 select HAVE_FTRACE_MCOUNT_RECORD
238 select HAVE_FUNCTION_GRAPH_TRACER
239 select HAVE_FUNCTION_TRACER
240 select SWIOTLB if MMU
244 # We must be able to map all physical memory into the kernel, but the compiler
245 # is still a bit more efficient when generating code if it's setup in a manner
246 # such that it can only map 2GiB of memory.
248 prompt "Kernel Code Model"
249 default CMODEL_MEDLOW if 32BIT
250 default CMODEL_MEDANY if 64BIT
253 bool "medium low code model"
255 bool "medium any code model"
258 config MODULE_SECTIONS
260 select HAVE_MOD_ARCH_SPECIFIC
263 prompt "Maximum Physical Memory"
264 default MAXPHYSMEM_1GB if 32BIT
265 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
266 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
268 config MAXPHYSMEM_1GB
271 config MAXPHYSMEM_2GB
272 depends on 64BIT && CMODEL_MEDLOW
274 config MAXPHYSMEM_128GB
275 depends on 64BIT && CMODEL_MEDANY
281 bool "Symmetric Multi-Processing"
283 This enables support for systems with more than one CPU. If
284 you say N here, the kernel will run on single and
285 multiprocessor machines, but will use only one CPU of a
286 multiprocessor machine. If you say Y here, the kernel will run
287 on many, but not all, single processor machines. On a single
288 processor machine, the kernel will run faster if you say N
291 If you don't know what to do here, say N.
294 int "Maximum number of CPUs (2-32)"
300 bool "Support for hot-pluggable CPUs"
302 select GENERIC_IRQ_MIGRATION
305 Say Y here to experiment with turning CPUs off and on. CPUs
306 can be controlled through /sys/devices/system/cpu.
308 Say N if you want to disable CPU hotplug.
319 # Common NUMA Features
321 bool "NUMA Memory Allocation and Scheduler Support"
323 select GENERIC_ARCH_NUMA
325 select ARCH_SUPPORTS_NUMA_BALANCING
327 Enable NUMA (Non-Uniform Memory Access) support.
329 The kernel will try to allocate memory used by a CPU on the
330 local memory of the CPU and add some more NUMA awareness to the kernel.
333 int "Maximum NUMA Nodes (as a power of 2)"
336 depends on NEED_MULTIPLE_NODES
338 Specify the maximum number of NUMA Nodes available on the target
339 system. Increases memory reserved to accommodate various tables.
341 config USE_PERCPU_NUMA_NODE_ID
345 config NEED_PER_CPU_EMBED_FIRST_CHUNK
350 bool "Emit compressed instructions when building Linux"
353 Adds "C" to the ISA subsets that the toolchain is allowed to emit
354 when building Linux, which results in compressed instructions in the
357 If you don't know what to do here, say Y.
359 menu "supported PMU type"
360 depends on PERF_EVENTS
362 config RISCV_BASE_PMU
363 bool "Base Performance Monitoring Unit"
366 A base PMU that serves as a reference implementation and has limited
367 feature of perf. It can run on any RISC-V machines so serves as the
368 fallback, but this option can also be disable to reduce kernel size.
376 Say N here if you want to disable all floating-point related procedure
379 If you don't know what to do here, say Y.
383 menu "Kernel features"
385 source "kernel/Kconfig.hz"
388 bool "SBI v0.1 support"
392 This config allows kernel to use SBI v0.1 APIs. This will be
393 deprecated in future once legacy M-mode software are no longer in use.
396 bool "Kexec system call"
398 select HOTPLUG_CPU if SMP
401 kexec is a system call that implements the ability to shutdown your
402 current kernel, and to start another kernel. It is like a reboot
403 but it is independent of the system firmware. And like a reboot
404 you can start any kernel with it, not just Linux.
406 The name comes from the similarity to the exec system call.
409 bool "Build kdump crash kernel"
411 Generate crash dump after being started by kexec. This should
412 be normally only set in special crash dump kernels which are
413 loaded in the main kernel with kexec-tools into a specially
414 reserved region and then later executed after a crash by
417 For more details see Documentation/admin-guide/kdump/kdump.rst
424 string "Built-in kernel command line"
426 For most platforms, the arguments for the kernel's command line
427 are provided at run-time, during boot. However, there are cases
428 where either no arguments are being provided or the provided
429 arguments are insufficient or even invalid.
431 When that occurs, it is possible to define a built-in command
432 line here and choose how the kernel should use it later on.
435 prompt "Built-in command line usage" if CMDLINE != ""
436 default CMDLINE_FALLBACK
438 Choose how the kernel will handle the provided built-in command
441 config CMDLINE_FALLBACK
442 bool "Use bootloader kernel arguments if available"
444 Use the built-in command line as fallback in case we get nothing
445 during boot. This is the default behaviour.
447 config CMDLINE_EXTEND
448 bool "Extend bootloader kernel arguments"
450 The command-line arguments provided during boot will be
451 appended to the built-in command line. This is useful in
452 cases where the provided arguments are insufficient and
453 you don't want to or cannot modify them.
457 bool "Always use the default kernel command string"
459 Always use the built-in command line, even if we get one during
460 boot. This is useful in case you need to override the provided
461 command line on systems where you don't have or want control
470 bool "UEFI runtime support"
471 depends on OF && !XIP_KERNEL
474 select EFI_PARAMS_FROM_FDT
476 select EFI_GENERIC_STUB
477 select EFI_RUNTIME_WRAPPERS
482 This option provides support for runtime services provided
483 by UEFI firmware (such as non-volatile variables, realtime
484 clock, and platform reset). A UEFI stub is also provided to
485 allow the kernel to be booted as an EFI application. This
486 is only useful on systems that have UEFI firmware.
488 config CC_HAVE_STACKPROTECTOR_TLS
489 def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
491 config STACKPROTECTOR_PER_TASK
493 depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
495 config PHYS_RAM_BASE_FIXED
496 bool "Explicitly specified physical RAM address"
500 hex "Platform Physical RAM address"
501 depends on PHYS_RAM_BASE_FIXED
504 This is the physical address of RAM in the system. It has to be
505 explicitly specified to run early relocations of read-write data
509 bool "Kernel Execute-In-Place from ROM"
510 depends on MMU && SPARSEMEM
511 # This prevents XIP from being enabled by all{yes,mod}config, which
512 # fail to build since XIP doesn't support large kernels.
513 depends on !COMPILE_TEST
514 select PHYS_RAM_BASE_FIXED
516 Execute-In-Place allows the kernel to run from non-volatile storage
517 directly addressable by the CPU, such as NOR flash. This saves RAM
518 space since the text section of the kernel is not loaded from flash
519 to RAM. Read-write sections, such as the data section and stack,
520 are still copied to RAM. The XIP kernel is not compressed since
521 it has to run directly from flash, so it will take more space to
522 store it. The flash address used to link the kernel object files,
523 and for storing it, is configuration dependent. Therefore, if you
524 say Y here, you must know the proper physical address where to
525 store the kernel image depending on your own flash memory usage.
527 Also note that the make target becomes "make xipImage" rather than
528 "make zImage" or "make Image". The final kernel binary to put in
529 ROM memory will be arch/riscv/boot/xipImage.
531 SPARSEMEM is required because the kernel text and rodata that are
532 flash resident are not backed by memmap, then any attempt to get
533 a struct page on those regions will trigger a fault.
538 hex "XIP Kernel Physical Location"
539 depends on XIP_KERNEL
542 This is the physical address in your flash memory the kernel will
543 be linked for and stored to. This address is dependent on your
551 default y if XIP_KERNEL
553 menu "Power management options"
555 source "kernel/power/Kconfig"
559 source "drivers/firmware/Kconfig"