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_SUPPORTS_HUGETLBFS if MMU
37 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
38 select ARCH_WANT_FRAME_POINTERS
39 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
40 select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
41 select CLONE_BACKWARDS
42 select CLINT_TIMER if !MMU
45 select GENERIC_ARCH_TOPOLOGY if SMP
46 select GENERIC_ATOMIC64 if !64BIT
47 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
48 select GENERIC_EARLY_IOREMAP
49 select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
50 select GENERIC_IOREMAP
51 select GENERIC_IRQ_MULTI_HANDLER
52 select GENERIC_IRQ_SHOW
53 select GENERIC_LIB_DEVMEM_IS_ALLOWED
54 select GENERIC_PCI_IOMAP
55 select GENERIC_PTDUMP if MMU
56 select GENERIC_SCHED_CLOCK
57 select GENERIC_SMP_IDLE_THREAD
58 select GENERIC_STRNCPY_FROM_USER if MMU
59 select GENERIC_STRNLEN_USER if MMU
60 select GENERIC_TIME_VSYSCALL if MMU && 64BIT
61 select HANDLE_DOMAIN_IRQ
62 select HAVE_ARCH_AUDITSYSCALL
63 select HAVE_ARCH_JUMP_LABEL
64 select HAVE_ARCH_JUMP_LABEL_RELATIVE
65 select HAVE_ARCH_KASAN if MMU && 64BIT
66 select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT
67 select HAVE_ARCH_KFENCE if MMU && 64BIT
69 select HAVE_ARCH_KGDB_QXFER_PKT
70 select HAVE_ARCH_MMAP_RND_BITS if MMU
71 select HAVE_ARCH_SECCOMP_FILTER
72 select HAVE_ARCH_TRACEHOOK
73 select HAVE_ASM_MODVERSIONS
74 select HAVE_CONTEXT_TRACKING
75 select HAVE_DEBUG_KMEMLEAK
76 select HAVE_DMA_CONTIGUOUS if MMU
77 select HAVE_EBPF_JIT if MMU
78 select HAVE_FUNCTION_ERROR_INJECTION
79 select HAVE_FUTEX_CMPXCHG if FUTEX
80 select HAVE_GCC_PLUGINS
81 select HAVE_GENERIC_VDSO if MMU && 64BIT
82 select HAVE_IRQ_TIME_ACCOUNTING
84 select HAVE_KPROBES_ON_FTRACE
85 select HAVE_KRETPROBES
89 select HAVE_PERF_EVENTS
91 select HAVE_PERF_USER_STACK_DUMP
92 select HAVE_REGS_AND_STACK_ACCESS_API
93 select HAVE_FUNCTION_ARG_ACCESS_API
94 select HAVE_STACKPROTECTOR
95 select HAVE_SYSCALL_TRACEPOINTS
97 select MODULES_USE_ELF_RELA if MODULES
98 select MODULE_SECTIONS if MODULES
100 select OF_EARLY_FLATTREE
102 select PCI_DOMAINS_GENERIC if PCI
103 select PCI_MSI if PCI
105 select RISCV_TIMER if RISCV_SBI
107 select SYSCTL_EXCEPTION_TRACE
108 select THREAD_INFO_IN_TASK
109 select UACCESS_MEMCPY if !MMU
110 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU
112 config ARCH_MMAP_RND_BITS_MIN
116 # max bits determined by the following formula:
117 # VA_BITS - PAGE_SHIFT - 3
118 config ARCH_MMAP_RND_BITS_MAX
119 default 24 if 64BIT # SV39 based
122 # set if we run in machine mode, cleared if we run in supervisor mode
127 # set if we are running in S-mode and can use SBI calls
130 depends on !RISCV_M_MODE
134 bool "MMU-based Paged Memory Management Support"
137 Select if you want MMU-based virtualised addressing space
138 support by paged memory management. If unsure, say 'Y'.
156 default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
157 default 0x80000000 if 64BIT && !MMU
158 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
159 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
161 config ARCH_FLATMEM_ENABLE
164 config ARCH_SPARSEMEM_ENABLE
167 select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
168 select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
170 config ARCH_SELECT_MEMORY_MODEL
171 def_bool ARCH_SPARSEMEM_ENABLE
173 config ARCH_WANT_GENERAL_HUGETLB
176 config ARCH_SUPPORTS_UPROBES
179 config STACKTRACE_SUPPORT
182 config TRACE_IRQFLAGS_SUPPORT
188 select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
190 config GENERIC_BUG_RELATIVE_POINTERS
193 config GENERIC_CALIBRATE_DELAY
199 config GENERIC_HWEIGHT
202 config FIX_EARLYCON_MEM
205 config PGTABLE_LEVELS
210 config LOCKDEP_SUPPORT
213 source "arch/riscv/Kconfig.socs"
214 source "arch/riscv/Kconfig.erratas"
222 This selects the base ISA that this kernel will target and must match
228 select GENERIC_LIB_ASHLDI3
229 select GENERIC_LIB_ASHRDI3
230 select GENERIC_LIB_LSHRDI3
231 select GENERIC_LIB_UCMPDI2
237 select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
238 select HAVE_DYNAMIC_FTRACE if MMU && $(cc-option,-fpatchable-function-entry=8)
239 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
240 select HAVE_FTRACE_MCOUNT_RECORD
241 select HAVE_FUNCTION_GRAPH_TRACER
242 select HAVE_FUNCTION_TRACER
243 select SWIOTLB if MMU
247 # We must be able to map all physical memory into the kernel, but the compiler
248 # is still a bit more efficient when generating code if it's setup in a manner
249 # such that it can only map 2GiB of memory.
251 prompt "Kernel Code Model"
252 default CMODEL_MEDLOW if 32BIT
253 default CMODEL_MEDANY if 64BIT
256 bool "medium low code model"
258 bool "medium any code model"
261 config MODULE_SECTIONS
263 select HAVE_MOD_ARCH_SPECIFIC
266 prompt "Maximum Physical Memory"
267 default MAXPHYSMEM_1GB if 32BIT
268 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
269 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
271 config MAXPHYSMEM_1GB
274 config MAXPHYSMEM_2GB
275 depends on 64BIT && CMODEL_MEDLOW
277 config MAXPHYSMEM_128GB
278 depends on 64BIT && CMODEL_MEDANY
284 bool "Symmetric Multi-Processing"
286 This enables support for systems with more than one CPU. If
287 you say N here, the kernel will run on single and
288 multiprocessor machines, but will use only one CPU of a
289 multiprocessor machine. If you say Y here, the kernel will run
290 on many, but not all, single processor machines. On a single
291 processor machine, the kernel will run faster if you say N
294 If you don't know what to do here, say N.
297 int "Maximum number of CPUs (2-32)"
303 bool "Support for hot-pluggable CPUs"
305 select GENERIC_IRQ_MIGRATION
308 Say Y here to experiment with turning CPUs off and on. CPUs
309 can be controlled through /sys/devices/system/cpu.
311 Say N if you want to disable CPU hotplug.
322 # Common NUMA Features
324 bool "NUMA Memory Allocation and Scheduler Support"
325 depends on SMP && MMU
326 select GENERIC_ARCH_NUMA
328 select ARCH_SUPPORTS_NUMA_BALANCING
330 Enable NUMA (Non-Uniform Memory Access) support.
332 The kernel will try to allocate memory used by a CPU on the
333 local memory of the CPU and add some more NUMA awareness to the kernel.
336 int "Maximum NUMA Nodes (as a power of 2)"
339 depends on NEED_MULTIPLE_NODES
341 Specify the maximum number of NUMA Nodes available on the target
342 system. Increases memory reserved to accommodate various tables.
344 config USE_PERCPU_NUMA_NODE_ID
348 config NEED_PER_CPU_EMBED_FIRST_CHUNK
353 bool "Emit compressed instructions when building Linux"
356 Adds "C" to the ISA subsets that the toolchain is allowed to emit
357 when building Linux, which results in compressed instructions in the
360 If you don't know what to do here, say Y.
362 menu "supported PMU type"
363 depends on PERF_EVENTS
365 config RISCV_BASE_PMU
366 bool "Base Performance Monitoring Unit"
369 A base PMU that serves as a reference implementation and has limited
370 feature of perf. It can run on any RISC-V machines so serves as the
371 fallback, but this option can also be disable to reduce kernel size.
379 Say N here if you want to disable all floating-point related procedure
382 If you don't know what to do here, say Y.
386 menu "Kernel features"
388 source "kernel/Kconfig.hz"
391 bool "SBI v0.1 support"
395 This config allows kernel to use SBI v0.1 APIs. This will be
396 deprecated in future once legacy M-mode software are no longer in use.
399 bool "Kexec system call"
401 select HOTPLUG_CPU if SMP
404 kexec is a system call that implements the ability to shutdown your
405 current kernel, and to start another kernel. It is like a reboot
406 but it is independent of the system firmware. And like a reboot
407 you can start any kernel with it, not just Linux.
409 The name comes from the similarity to the exec system call.
412 bool "Build kdump crash kernel"
414 Generate crash dump after being started by kexec. This should
415 be normally only set in special crash dump kernels which are
416 loaded in the main kernel with kexec-tools into a specially
417 reserved region and then later executed after a crash by
420 For more details see Documentation/admin-guide/kdump/kdump.rst
427 string "Built-in kernel command line"
429 For most platforms, the arguments for the kernel's command line
430 are provided at run-time, during boot. However, there are cases
431 where either no arguments are being provided or the provided
432 arguments are insufficient or even invalid.
434 When that occurs, it is possible to define a built-in command
435 line here and choose how the kernel should use it later on.
438 prompt "Built-in command line usage" if CMDLINE != ""
439 default CMDLINE_FALLBACK
441 Choose how the kernel will handle the provided built-in command
444 config CMDLINE_FALLBACK
445 bool "Use bootloader kernel arguments if available"
447 Use the built-in command line as fallback in case we get nothing
448 during boot. This is the default behaviour.
450 config CMDLINE_EXTEND
451 bool "Extend bootloader kernel arguments"
453 The command-line arguments provided during boot will be
454 appended to the built-in command line. This is useful in
455 cases where the provided arguments are insufficient and
456 you don't want to or cannot modify them.
460 bool "Always use the default kernel command string"
462 Always use the built-in command line, even if we get one during
463 boot. This is useful in case you need to override the provided
464 command line on systems where you don't have or want control
473 bool "UEFI runtime support"
474 depends on OF && !XIP_KERNEL
477 select EFI_PARAMS_FROM_FDT
479 select EFI_GENERIC_STUB
480 select EFI_RUNTIME_WRAPPERS
485 This option provides support for runtime services provided
486 by UEFI firmware (such as non-volatile variables, realtime
487 clock, and platform reset). A UEFI stub is also provided to
488 allow the kernel to be booted as an EFI application. This
489 is only useful on systems that have UEFI firmware.
491 config CC_HAVE_STACKPROTECTOR_TLS
492 def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
494 config STACKPROTECTOR_PER_TASK
496 depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
499 hex "Platform Physical RAM address"
502 This is the physical address of RAM in the system. It has to be
503 explicitly specified to run early relocations of read-write data
507 bool "Kernel Execute-In-Place from ROM"
508 depends on MMU && SPARSEMEM
509 # This prevents XIP from being enabled by all{yes,mod}config, which
510 # fail to build since XIP doesn't support large kernels.
511 depends on !COMPILE_TEST
513 Execute-In-Place allows the kernel to run from non-volatile storage
514 directly addressable by the CPU, such as NOR flash. This saves RAM
515 space since the text section of the kernel is not loaded from flash
516 to RAM. Read-write sections, such as the data section and stack,
517 are still copied to RAM. The XIP kernel is not compressed since
518 it has to run directly from flash, so it will take more space to
519 store it. The flash address used to link the kernel object files,
520 and for storing it, is configuration dependent. Therefore, if you
521 say Y here, you must know the proper physical address where to
522 store the kernel image depending on your own flash memory usage.
524 Also note that the make target becomes "make xipImage" rather than
525 "make zImage" or "make Image". The final kernel binary to put in
526 ROM memory will be arch/riscv/boot/xipImage.
528 SPARSEMEM is required because the kernel text and rodata that are
529 flash resident are not backed by memmap, then any attempt to get
530 a struct page on those regions will trigger a fault.
535 hex "XIP Kernel Physical Location"
536 depends on XIP_KERNEL
539 This is the physical address in your flash memory the kernel will
540 be linked for and stored to. This address is dependent on your
548 default y if XIP_KERNEL
550 menu "Power management options"
552 source "kernel/power/Kconfig"
556 source "drivers/firmware/Kconfig"