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
68 select HAVE_ARCH_KGDB_QXFER_PKT
69 select HAVE_ARCH_MMAP_RND_BITS if MMU
70 select HAVE_ARCH_SECCOMP_FILTER
71 select HAVE_ARCH_TRACEHOOK
72 select HAVE_ASM_MODVERSIONS
73 select HAVE_CONTEXT_TRACKING
74 select HAVE_DEBUG_KMEMLEAK
75 select HAVE_DMA_CONTIGUOUS if MMU
76 select HAVE_EBPF_JIT if MMU
77 select HAVE_FUNCTION_ERROR_INJECTION
78 select HAVE_FUTEX_CMPXCHG if FUTEX
79 select HAVE_GCC_PLUGINS
80 select HAVE_GENERIC_VDSO if MMU && 64BIT
81 select HAVE_IRQ_TIME_ACCOUNTING
83 select HAVE_KPROBES_ON_FTRACE
84 select HAVE_KRETPROBES
86 select HAVE_PERF_EVENTS
88 select HAVE_PERF_USER_STACK_DUMP
89 select HAVE_REGS_AND_STACK_ACCESS_API
90 select HAVE_STACKPROTECTOR
91 select HAVE_SYSCALL_TRACEPOINTS
93 select MODULES_USE_ELF_RELA if MODULES
94 select MODULE_SECTIONS if MODULES
96 select OF_EARLY_FLATTREE
98 select PCI_DOMAINS_GENERIC if PCI
101 select RISCV_TIMER if RISCV_SBI
103 select SYSCTL_EXCEPTION_TRACE
104 select THREAD_INFO_IN_TASK
105 select UACCESS_MEMCPY if !MMU
107 config ARCH_MMAP_RND_BITS_MIN
111 # max bits determined by the following formula:
112 # VA_BITS - PAGE_SHIFT - 3
113 config ARCH_MMAP_RND_BITS_MAX
114 default 24 if 64BIT # SV39 based
117 # set if we run in machine mode, cleared if we run in supervisor mode
122 # set if we are running in S-mode and can use SBI calls
125 depends on !RISCV_M_MODE
129 bool "MMU-based Paged Memory Management Support"
132 Select if you want MMU-based virtualised addressing space
133 support by paged memory management. If unsure, say 'Y'.
151 default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
152 default 0x80000000 if 64BIT && !MMU
153 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
154 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
156 config ARCH_FLATMEM_ENABLE
159 config ARCH_SPARSEMEM_ENABLE
162 select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
163 select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
165 config ARCH_SELECT_MEMORY_MODEL
166 def_bool ARCH_SPARSEMEM_ENABLE
168 config ARCH_WANT_GENERAL_HUGETLB
171 config ARCH_SUPPORTS_UPROBES
174 config STACKTRACE_SUPPORT
177 config TRACE_IRQFLAGS_SUPPORT
183 select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
185 config GENERIC_BUG_RELATIVE_POINTERS
188 config GENERIC_CALIBRATE_DELAY
194 config GENERIC_HWEIGHT
197 config FIX_EARLYCON_MEM
200 config PGTABLE_LEVELS
205 config LOCKDEP_SUPPORT
208 source "arch/riscv/Kconfig.socs"
209 source "arch/riscv/Kconfig.erratas"
217 This selects the base ISA that this kernel will target and must match
223 select GENERIC_LIB_ASHLDI3
224 select GENERIC_LIB_ASHRDI3
225 select GENERIC_LIB_LSHRDI3
226 select GENERIC_LIB_UCMPDI2
232 select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
233 select HAVE_DYNAMIC_FTRACE if MMU && $(cc-option,-fpatchable-function-entry=8)
234 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
235 select HAVE_FTRACE_MCOUNT_RECORD
236 select HAVE_FUNCTION_GRAPH_TRACER
237 select HAVE_FUNCTION_TRACER
238 select SWIOTLB if MMU
242 # We must be able to map all physical memory into the kernel, but the compiler
243 # is still a bit more efficient when generating code if it's setup in a manner
244 # such that it can only map 2GiB of memory.
246 prompt "Kernel Code Model"
247 default CMODEL_MEDLOW if 32BIT
248 default CMODEL_MEDANY if 64BIT
251 bool "medium low code model"
253 bool "medium any code model"
256 config MODULE_SECTIONS
258 select HAVE_MOD_ARCH_SPECIFIC
261 prompt "Maximum Physical Memory"
262 default MAXPHYSMEM_1GB if 32BIT
263 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
264 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
266 config MAXPHYSMEM_1GB
269 config MAXPHYSMEM_2GB
270 depends on 64BIT && CMODEL_MEDLOW
272 config MAXPHYSMEM_128GB
273 depends on 64BIT && CMODEL_MEDANY
279 bool "Symmetric Multi-Processing"
281 This enables support for systems with more than one CPU. If
282 you say N here, the kernel will run on single and
283 multiprocessor machines, but will use only one CPU of a
284 multiprocessor machine. If you say Y here, the kernel will run
285 on many, but not all, single processor machines. On a single
286 processor machine, the kernel will run faster if you say N
289 If you don't know what to do here, say N.
292 int "Maximum number of CPUs (2-32)"
298 bool "Support for hot-pluggable CPUs"
300 select GENERIC_IRQ_MIGRATION
303 Say Y here to experiment with turning CPUs off and on. CPUs
304 can be controlled through /sys/devices/system/cpu.
306 Say N if you want to disable CPU hotplug.
317 # Common NUMA Features
319 bool "NUMA Memory Allocation and Scheduler Support"
320 depends on SMP && MMU
321 select GENERIC_ARCH_NUMA
323 select ARCH_SUPPORTS_NUMA_BALANCING
325 Enable NUMA (Non-Uniform Memory Access) support.
327 The kernel will try to allocate memory used by a CPU on the
328 local memory of the CPU and add some more NUMA awareness to the kernel.
331 int "Maximum NUMA Nodes (as a power of 2)"
334 depends on NEED_MULTIPLE_NODES
336 Specify the maximum number of NUMA Nodes available on the target
337 system. Increases memory reserved to accommodate various tables.
339 config USE_PERCPU_NUMA_NODE_ID
343 config NEED_PER_CPU_EMBED_FIRST_CHUNK
348 bool "Emit compressed instructions when building Linux"
351 Adds "C" to the ISA subsets that the toolchain is allowed to emit
352 when building Linux, which results in compressed instructions in the
355 If you don't know what to do here, say Y.
357 menu "supported PMU type"
358 depends on PERF_EVENTS
360 config RISCV_BASE_PMU
361 bool "Base Performance Monitoring Unit"
364 A base PMU that serves as a reference implementation and has limited
365 feature of perf. It can run on any RISC-V machines so serves as the
366 fallback, but this option can also be disable to reduce kernel size.
374 Say N here if you want to disable all floating-point related procedure
377 If you don't know what to do here, say Y.
381 menu "Kernel features"
383 source "kernel/Kconfig.hz"
386 bool "SBI v0.1 support"
390 This config allows kernel to use SBI v0.1 APIs. This will be
391 deprecated in future once legacy M-mode software are no longer in use.
394 bool "Kexec system call"
396 select HOTPLUG_CPU if SMP
399 kexec is a system call that implements the ability to shutdown your
400 current kernel, and to start another kernel. It is like a reboot
401 but it is independent of the system firmware. And like a reboot
402 you can start any kernel with it, not just Linux.
404 The name comes from the similarity to the exec system call.
407 bool "Build kdump crash kernel"
409 Generate crash dump after being started by kexec. This should
410 be normally only set in special crash dump kernels which are
411 loaded in the main kernel with kexec-tools into a specially
412 reserved region and then later executed after a crash by
415 For more details see Documentation/admin-guide/kdump/kdump.rst
422 string "Built-in kernel command line"
424 For most platforms, the arguments for the kernel's command line
425 are provided at run-time, during boot. However, there are cases
426 where either no arguments are being provided or the provided
427 arguments are insufficient or even invalid.
429 When that occurs, it is possible to define a built-in command
430 line here and choose how the kernel should use it later on.
433 prompt "Built-in command line usage" if CMDLINE != ""
434 default CMDLINE_FALLBACK
436 Choose how the kernel will handle the provided built-in command
439 config CMDLINE_FALLBACK
440 bool "Use bootloader kernel arguments if available"
442 Use the built-in command line as fallback in case we get nothing
443 during boot. This is the default behaviour.
445 config CMDLINE_EXTEND
446 bool "Extend bootloader kernel arguments"
448 The command-line arguments provided during boot will be
449 appended to the built-in command line. This is useful in
450 cases where the provided arguments are insufficient and
451 you don't want to or cannot modify them.
455 bool "Always use the default kernel command string"
457 Always use the built-in command line, even if we get one during
458 boot. This is useful in case you need to override the provided
459 command line on systems where you don't have or want control
468 bool "UEFI runtime support"
469 depends on OF && !XIP_KERNEL
472 select EFI_PARAMS_FROM_FDT
474 select EFI_GENERIC_STUB
475 select EFI_RUNTIME_WRAPPERS
480 This option provides support for runtime services provided
481 by UEFI firmware (such as non-volatile variables, realtime
482 clock, and platform reset). A UEFI stub is also provided to
483 allow the kernel to be booted as an EFI application. This
484 is only useful on systems that have UEFI firmware.
486 config CC_HAVE_STACKPROTECTOR_TLS
487 def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
489 config STACKPROTECTOR_PER_TASK
491 depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
493 config PHYS_RAM_BASE_FIXED
494 bool "Explicitly specified physical RAM address"
498 hex "Platform Physical RAM address"
499 depends on PHYS_RAM_BASE_FIXED
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
512 select PHYS_RAM_BASE_FIXED
514 Execute-In-Place allows the kernel to run from non-volatile storage
515 directly addressable by the CPU, such as NOR flash. This saves RAM
516 space since the text section of the kernel is not loaded from flash
517 to RAM. Read-write sections, such as the data section and stack,
518 are still copied to RAM. The XIP kernel is not compressed since
519 it has to run directly from flash, so it will take more space to
520 store it. The flash address used to link the kernel object files,
521 and for storing it, is configuration dependent. Therefore, if you
522 say Y here, you must know the proper physical address where to
523 store the kernel image depending on your own flash memory usage.
525 Also note that the make target becomes "make xipImage" rather than
526 "make zImage" or "make Image". The final kernel binary to put in
527 ROM memory will be arch/riscv/boot/xipImage.
529 SPARSEMEM is required because the kernel text and rodata that are
530 flash resident are not backed by memmap, then any attempt to get
531 a struct page on those regions will trigger a fault.
536 hex "XIP Kernel Physical Location"
537 depends on XIP_KERNEL
540 This is the physical address in your flash memory the kernel will
541 be linked for and stored to. This address is dependent on your
549 default y if XIP_KERNEL
551 menu "Power management options"
553 source "kernel/power/Kconfig"
557 source "drivers/firmware/Kconfig"