]>
Commit | Line | Data |
---|---|---|
ec8f24b7 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
fbe934d6 PD |
2 | # |
3 | # For a description of the syntax of this configuration file, | |
cd238eff | 4 | # see Documentation/kbuild/kconfig-language.rst. |
fbe934d6 PD |
5 | # |
6 | ||
c3e4ed01 CH |
7 | config 64BIT |
8 | bool | |
9 | ||
10 | config 32BIT | |
11 | bool | |
12 | ||
fbe934d6 PD |
13 | config RISCV |
14 | def_bool y | |
a91a9ffb S |
15 | select ACPI_GENERIC_GSI if ACPI |
16 | select ACPI_REDUCED_HARDWARE_ONLY if ACPI | |
c00a60d6 | 17 | select ARCH_DMA_DEFAULT_COHERENT |
c24a1967 | 18 | select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION |
5a7ac592 | 19 | select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 |
5f365c13 | 20 | select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE |
ad97f9df | 21 | select ARCH_HAS_BINFMT_FLAT |
fdecfea0 | 22 | select ARCH_HAS_CURRENT_STACK_POINTER |
e8c7ef7d | 23 | select ARCH_HAS_DEBUG_VIRTUAL if MMU |
5f365c13 | 24 | select ARCH_HAS_DEBUG_VM_PGTABLE |
b422d28b | 25 | select ARCH_HAS_DEBUG_WX |
48b4fc66 | 26 | select ARCH_HAS_FAST_MULTIPLIER |
95301414 | 27 | select ARCH_HAS_FORTIFY_SOURCE |
e8c7ef7d PD |
28 | select ARCH_HAS_GCOV_PROFILE_ALL |
29 | select ARCH_HAS_GIGANTIC_PAGE | |
20d38f7c | 30 | select ARCH_HAS_KCOV |
d6cfd177 | 31 | select ARCH_HAS_MEMBARRIER_CALLBACKS |
cd9b2901 | 32 | select ARCH_HAS_MEMBARRIER_SYNC_CORE |
e8c7ef7d | 33 | select ARCH_HAS_MMIOWB |
99a670b2 | 34 | select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE |
a49ab905 | 35 | select ARCH_HAS_PMEM_API |
cd9b2901 | 36 | select ARCH_HAS_PREPARE_SYNC_CORE_CMD |
e8c7ef7d | 37 | select ARCH_HAS_PTE_SPECIAL |
10cc3278 MR |
38 | select ARCH_HAS_SET_DIRECT_MAP if MMU |
39 | select ARCH_HAS_SET_MEMORY if MMU | |
44c92257 VW |
40 | select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL |
41 | select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL | |
cd9b2901 | 42 | select ARCH_HAS_SYNC_CORE_BEFORE_USERMODE |
08d0ce30 | 43 | select ARCH_HAS_SYSCALL_WRAPPER |
2f100585 | 44 | select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST |
918327e9 | 45 | select ARCH_HAS_UBSAN |
aa5af0aa | 46 | select ARCH_HAS_VDSO_DATA |
e8065df5 | 47 | select ARCH_KEEP_MEMBLOCK if ACPI |
fc0c769f VC |
48 | select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX |
49 | select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT | |
7f85b04b JZ |
50 | select ARCH_STACKWALK |
51 | select ARCH_SUPPORTS_ATOMIC_RMW | |
74f8fc31 | 52 | select ARCH_SUPPORTS_CFI_CLANG |
7f85b04b | 53 | select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU |
855f9a8e | 54 | select ARCH_SUPPORTS_HUGETLBFS if MMU |
021d2342 WT |
55 | # LLD >= 14: https://github.com/llvm/llvm-project/issues/50505 |
56 | select ARCH_SUPPORTS_LTO_CLANG if LLD_VERSION >= 140000 | |
57 | select ARCH_SUPPORTS_LTO_CLANG_THIN if LLD_VERSION >= 140000 | |
34c0a5b0 | 58 | select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU |
648321fa | 59 | select ARCH_SUPPORTS_PER_VMA_LOCK if MMU |
d1584d79 | 60 | select ARCH_SUPPORTS_SHADOW_CALL_STACK if HAVE_SHADOW_CALL_STACK |
eb1e5037 | 61 | select ARCH_USE_CMPXCHG_LOCKREF if 64BIT |
97a03108 | 62 | select ARCH_USE_MEMTEST |
c9c0b0ba | 63 | select ARCH_USE_QUEUED_RWLOCKS |
af0ead42 | 64 | select ARCH_USES_CFI_TRAPS if CFI_CLANG |
c6026d35 | 65 | select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH if MMU |
e8c7ef7d | 66 | select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU |
fbe934d6 | 67 | select ARCH_WANT_FRAME_POINTERS |
82a1a1f3 | 68 | select ARCH_WANT_GENERAL_HUGETLB if !RISCV_ISA_SVNAPOT |
e8c7ef7d | 69 | select ARCH_WANT_HUGE_PMD_SHARE if 64BIT |
f4b71bff | 70 | select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL |
0b6f1582 | 71 | select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP |
cfbc4f81 | 72 | select ARCH_WANTS_NO_INSTR |
87f81e66 | 73 | select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE |
09accc3a | 74 | select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU |
54fed35f | 75 | select BUILDTIME_TABLE_SORT if MMU |
f862bbf4 | 76 | select CLINT_TIMER if RISCV_M_MODE |
5f365c13 | 77 | select CLONE_BACKWARDS |
fbe934d6 | 78 | select COMMON_CLK |
4dc4af9c | 79 | select CPU_PM if CPU_IDLE || HIBERNATION || SUSPEND |
e8c7ef7d | 80 | select EDAC_SUPPORT |
9f944d2e | 81 | select FRAME_POINTER if PERF_EVENTS || (FUNCTION_TRACER && !DYNAMIC_FTRACE) |
b546d636 | 82 | select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY if DYNAMIC_FTRACE |
fbd92809 | 83 | select GENERIC_ARCH_TOPOLOGY |
e8c7ef7d | 84 | select GENERIC_ATOMIC64 if !64BIT |
2f100585 | 85 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP |
96cf2036 | 86 | select GENERIC_CPU_DEVICES |
6262f661 | 87 | select GENERIC_EARLY_IOREMAP |
f0bddf50 | 88 | select GENERIC_ENTRY |
ad5d1122 | 89 | select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO |
bcf11b5e | 90 | select GENERIC_IDLE_POLL_SETUP |
8350229f | 91 | select GENERIC_IOREMAP if MMU |
832f15f4 AP |
92 | select GENERIC_IRQ_IPI if SMP |
93 | select GENERIC_IRQ_IPI_MUX if SMP | |
e8c7ef7d | 94 | select GENERIC_IRQ_MULTI_HANDLER |
fbe934d6 | 95 | select GENERIC_IRQ_SHOW |
ecd4916c | 96 | select GENERIC_IRQ_SHOW_LEVEL |
78ed473c | 97 | select GENERIC_LIB_DEVMEM_IS_ALLOWED |
fbe934d6 | 98 | select GENERIC_PCI_IOMAP |
e8c7ef7d | 99 | select GENERIC_PTDUMP if MMU |
9b9afe4a | 100 | select GENERIC_SCHED_CLOCK |
e8c7ef7d | 101 | select GENERIC_SMP_IDLE_THREAD |
ad5d1122 | 102 | select GENERIC_TIME_VSYSCALL if MMU && 64BIT |
dffe11e2 | 103 | select GENERIC_VDSO_TIME_NS if HAVE_GENERIC_VDSO |
c45fc916 | 104 | select HARDIRQS_SW_RESEND |
fcbfe812 | 105 | select HAS_IOPORT if MMU |
efe75c49 | 106 | select HAVE_ARCH_AUDITSYSCALL |
be79afc7 | 107 | select HAVE_ARCH_HUGE_VMALLOC if HAVE_ARCH_HUGE_VMAP |
310f541a | 108 | select HAVE_ARCH_HUGE_VMAP if MMU && 64BIT && !XIP_KERNEL |
42e0e0b4 JZ |
109 | select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL |
110 | select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL | |
e8c7ef7d | 111 | select HAVE_ARCH_KASAN if MMU && 64BIT |
e178d670 | 112 | select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT |
47513f24 | 113 | select HAVE_ARCH_KFENCE if MMU && 64BIT |
42e0e0b4 | 114 | select HAVE_ARCH_KGDB if !XIP_KERNEL |
e8c7ef7d PD |
115 | select HAVE_ARCH_KGDB_QXFER_PKT |
116 | select HAVE_ARCH_MMAP_RND_BITS if MMU | |
9be84592 | 117 | select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT |
05d450aa | 118 | select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET |
5340627e | 119 | select HAVE_ARCH_SECCOMP_FILTER |
5f365c13 | 120 | select HAVE_ARCH_THREAD_STRUCT_WHITELIST |
e8c7ef7d | 121 | select HAVE_ARCH_TRACEHOOK |
9b76d71f | 122 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU |
a2492ca8 | 123 | select HAVE_ARCH_USERFAULTFD_MINOR if 64BIT && USERFAULTFD |
31da94c2 | 124 | select HAVE_ARCH_VMAP_STACK if MMU && 64BIT |
2ff2b7ec | 125 | select HAVE_ASM_MODVERSIONS |
24a9c541 | 126 | select HAVE_CONTEXT_TRACKING_USER |
cbb3d91d | 127 | select HAVE_DEBUG_KMEMLEAK |
6bd33e1e | 128 | select HAVE_DMA_CONTIGUOUS if MMU |
ab7fa6b0 | 129 | select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && (CLANG_SUPPORTS_DYNAMIC_FTRACE || GCC_SUPPORTS_DYNAMIC_FTRACE) |
196c79f1 | 130 | select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS |
7caa9765 | 131 | select HAVE_DYNAMIC_FTRACE_WITH_ARGS if HAVE_DYNAMIC_FTRACE |
ab7fa6b0 JZ |
132 | select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL |
133 | select HAVE_FUNCTION_GRAPH_TRACER | |
4f6b6c2b | 134 | select HAVE_FUNCTION_GRAPH_RETVAL if HAVE_FUNCTION_GRAPH_TRACER |
ab7fa6b0 | 135 | select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !PREEMPTION |
e8c7ef7d | 136 | select HAVE_EBPF_JIT if MMU |
25176ad0 | 137 | select HAVE_GUP_FAST if MMU |
5f365c13 | 138 | select HAVE_FUNCTION_ARG_ACCESS_API |
ee55ff80 | 139 | select HAVE_FUNCTION_ERROR_INJECTION |
20d38f7c | 140 | select HAVE_GCC_PLUGINS |
ad5d1122 | 141 | select HAVE_GENERIC_VDSO if MMU && 64BIT |
31564b8b | 142 | select HAVE_IRQ_TIME_ACCOUNTING |
e79dfcbf ERB |
143 | select HAVE_KERNEL_BZIP2 if !XIP_KERNEL && !EFI_ZBOOT |
144 | select HAVE_KERNEL_GZIP if !XIP_KERNEL && !EFI_ZBOOT | |
145 | select HAVE_KERNEL_LZ4 if !XIP_KERNEL && !EFI_ZBOOT | |
146 | select HAVE_KERNEL_LZMA if !XIP_KERNEL && !EFI_ZBOOT | |
147 | select HAVE_KERNEL_LZO if !XIP_KERNEL && !EFI_ZBOOT | |
148 | select HAVE_KERNEL_UNCOMPRESSED if !XIP_KERNEL && !EFI_ZBOOT | |
149 | select HAVE_KERNEL_ZSTD if !XIP_KERNEL && !EFI_ZBOOT | |
42e0e0b4 JZ |
150 | select HAVE_KPROBES if !XIP_KERNEL |
151 | select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL | |
152 | select HAVE_KRETPROBES if !XIP_KERNEL | |
f7584322 ND |
153 | # https://github.com/ClangBuiltLinux/linux/issues/1881 |
154 | select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !LD_IS_LLD | |
3332f419 JZ |
155 | select HAVE_MOVE_PMD |
156 | select HAVE_MOVE_PUD | |
5394f1e9 | 157 | select HAVE_PAGE_SIZE_4KB |
e8c7ef7d | 158 | select HAVE_PCI |
178e9fc4 | 159 | select HAVE_PERF_EVENTS |
98a93b0b MH |
160 | select HAVE_PERF_REGS |
161 | select HAVE_PERF_USER_STACK_DUMP | |
b60ca697 | 162 | select HAVE_POSIX_CPU_TIMERS_TASK_WORK |
4e90d052 | 163 | select HAVE_PREEMPT_DYNAMIC_KEY if !XIP_KERNEL |
dcdc7a53 | 164 | select HAVE_REGS_AND_STACK_ACCESS_API |
ab7fa6b0 | 165 | select HAVE_RETHOOK if !XIP_KERNEL |
5f365c13 | 166 | select HAVE_RSEQ |
70a57b24 | 167 | select HAVE_RUST if 64BIT |
629291dd SS |
168 | select HAVE_SAMPLE_FTRACE_DIRECT |
169 | select HAVE_SAMPLE_FTRACE_DIRECT_MULTI | |
f2c9699f | 170 | select HAVE_STACKPROTECTOR |
5aeb1b36 | 171 | select HAVE_SYSCALL_TRACEPOINTS |
72b11aa7 | 172 | select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU |
fbe934d6 | 173 | select IRQ_DOMAIN |
8165c6ae | 174 | select IRQ_FORCED_THREADING |
864046c5 | 175 | select KASAN_VMALLOC if KASAN |
7267ef7b | 176 | select LOCK_MM_AND_FIND_VMA |
69be3fb1 | 177 | select MMU_GATHER_RCU_TABLE_FREE if SMP && MMU |
fbe934d6 | 178 | select MODULES_USE_ELF_RELA if MODULES |
e8c7ef7d PD |
179 | select OF |
180 | select OF_EARLY_FLATTREE | |
181 | select OF_IRQ | |
2eac9c2d | 182 | select PCI_DOMAINS_GENERIC if PCI |
eb01d42a | 183 | select PCI_MSI if PCI |
1ee7fc3f | 184 | select RISCV_ALTERNATIVE if !XIP_KERNEL |
0eebc69d AP |
185 | select RISCV_APLIC |
186 | select RISCV_IMSIC | |
e71ee06e | 187 | select RISCV_INTC |
2bc3fc87 | 188 | select RISCV_TIMER if RISCV_SBI |
bf3d7b1d | 189 | select SIFIVE_PLIC |
e8c7ef7d PD |
190 | select SPARSE_IRQ |
191 | select SYSCTL_EXCEPTION_TRACE | |
192 | select THREAD_INFO_IN_TASK | |
4aae683f | 193 | select TRACE_IRQFLAGS_SUPPORT |
11129e8e | 194 | select UACCESS_MEMCPY if !MMU |
63703f37 | 195 | select ZONE_DMA32 if 64BIT |
54c95a11 | 196 | |
b3d6bdfe NC |
197 | config CLANG_SUPPORTS_DYNAMIC_FTRACE |
198 | def_bool CC_IS_CLANG | |
b3d6bdfe NC |
199 | # https://github.com/ClangBuiltLinux/linux/issues/1817 |
200 | depends on AS_IS_GNU || (AS_IS_LLVM && (LD_IS_LLD || LD_VERSION >= 23600)) | |
201 | ||
202 | config GCC_SUPPORTS_DYNAMIC_FTRACE | |
203 | def_bool CC_IS_GCC | |
204 | depends on $(cc-option,-fpatchable-function-entry=8) | |
205 | ||
d1584d79 ST |
206 | config HAVE_SHADOW_CALL_STACK |
207 | def_bool $(cc-option,-fsanitize=shadow-call-stack) | |
208 | # https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a484e843e6eeb51f0cb7b8819e50da6d2444d769 | |
209 | depends on $(ld-option,--no-relax-gp) | |
210 | ||
55b71d2c NC |
211 | config RISCV_USE_LINKER_RELAXATION |
212 | def_bool y | |
213 | # https://github.com/llvm/llvm-project/commit/6611d58f5bbcbec77262d392e2923e1d680f6985 | |
214 | depends on !LD_IS_LLD || LLD_VERSION >= 150000 | |
215 | ||
ae84ff9a NC |
216 | # https://github.com/llvm/llvm-project/commit/bbc0f99f3bc96f1db16f649fc21dd18e5b0918f6 |
217 | config ARCH_HAS_BROKEN_DWARF5 | |
218 | def_bool y | |
219 | depends on RISCV_USE_LINKER_RELAXATION | |
220 | # https://github.com/llvm/llvm-project/commit/1df5ea29b43690b6622db2cad7b745607ca4de6a | |
221 | depends on AS_IS_LLVM && AS_VERSION < 180000 | |
222 | # https://github.com/llvm/llvm-project/commit/7ffabb61a5569444b5ac9322e22e5471cc5e4a77 | |
223 | depends on LD_IS_LLD && LLD_VERSION < 180000 | |
224 | ||
54c95a11 AG |
225 | config ARCH_MMAP_RND_BITS_MIN |
226 | default 18 if 64BIT | |
227 | default 8 | |
228 | ||
9be84592 GR |
229 | config ARCH_MMAP_RND_COMPAT_BITS_MIN |
230 | default 8 | |
231 | ||
54c95a11 AG |
232 | # max bits determined by the following formula: |
233 | # VA_BITS - PAGE_SHIFT - 3 | |
234 | config ARCH_MMAP_RND_BITS_MAX | |
235 | default 24 if 64BIT # SV39 based | |
236 | default 17 | |
fbe934d6 | 237 | |
9be84592 GR |
238 | config ARCH_MMAP_RND_COMPAT_BITS_MAX |
239 | default 17 | |
240 | ||
a4c3733d CH |
241 | # set if we run in machine mode, cleared if we run in supervisor mode |
242 | config RISCV_M_MODE | |
f862bbf4 SH |
243 | bool "Build a kernel that runs in machine mode" |
244 | depends on !MMU | |
245 | default y | |
246 | help | |
247 | Select this option if you want to run the kernel in M-mode, | |
248 | without the assistance of any other firmware. | |
a4c3733d | 249 | |
eded8bc6 DLM |
250 | # set if we are running in S-mode and can use SBI calls |
251 | config RISCV_SBI | |
252 | bool | |
253 | depends on !RISCV_M_MODE | |
254 | default y | |
255 | ||
fbe934d6 | 256 | config MMU |
6bd33e1e CH |
257 | bool "MMU-based Paged Memory Management Support" |
258 | default y | |
259 | help | |
260 | Select if you want MMU-based virtualised addressing space | |
261 | support by paged memory management. If unsure, say 'Y'. | |
fbe934d6 | 262 | |
fbe934d6 PD |
263 | config PAGE_OFFSET |
264 | hex | |
f862bbf4 SH |
265 | default 0x80000000 if !MMU && RISCV_M_MODE |
266 | default 0x80200000 if !MMU | |
267 | default 0xc0000000 if 32BIT | |
011f09d1 | 268 | default 0xff60000000000000 if 64BIT |
fbe934d6 | 269 | |
54c5639d AG |
270 | config KASAN_SHADOW_OFFSET |
271 | hex | |
272 | depends on KASAN_GENERIC | |
f7ae0233 | 273 | default 0xdfffffff00000000 if 64BIT |
54c5639d AG |
274 | default 0xffffffff if 32BIT |
275 | ||
d95f1a54 | 276 | config ARCH_FLATMEM_ENABLE |
4f0e8eef | 277 | def_bool !NUMA |
d95f1a54 LG |
278 | |
279 | config ARCH_SPARSEMEM_ENABLE | |
280 | def_bool y | |
aa273420 | 281 | depends on MMU |
199fc6b8 | 282 | select SPARSEMEM_STATIC if 32BIT && SPARSEMEM |
a5406a7f | 283 | select SPARSEMEM_VMEMMAP_ENABLE if 64BIT |
d95f1a54 LG |
284 | |
285 | config ARCH_SELECT_MEMORY_MODEL | |
286 | def_bool ARCH_SPARSEMEM_ENABLE | |
287 | ||
74784081 GR |
288 | config ARCH_SUPPORTS_UPROBES |
289 | def_bool y | |
290 | ||
fbe934d6 PD |
291 | config STACKTRACE_SUPPORT |
292 | def_bool y | |
293 | ||
fbe934d6 PD |
294 | config GENERIC_BUG |
295 | def_bool y | |
296 | depends on BUG | |
297 | select GENERIC_BUG_RELATIVE_POINTERS if 64BIT | |
298 | ||
299 | config GENERIC_BUG_RELATIVE_POINTERS | |
300 | bool | |
301 | ||
302 | config GENERIC_CALIBRATE_DELAY | |
303 | def_bool y | |
304 | ||
305 | config GENERIC_CSUM | |
306 | def_bool y | |
307 | ||
308 | config GENERIC_HWEIGHT | |
309 | def_bool y | |
310 | ||
f2c17aab | 311 | config FIX_EARLYCON_MEM |
0312a3d4 | 312 | def_bool MMU |
f2c17aab | 313 | |
fbe934d6 PD |
314 | config PGTABLE_LEVELS |
315 | int | |
011f09d1 | 316 | default 5 if 64BIT |
fbe934d6 PD |
317 | default 2 |
318 | ||
3c469798 GR |
319 | config LOCKDEP_SUPPORT |
320 | def_bool y | |
321 | ||
1631ba12 HS |
322 | config RISCV_DMA_NONCOHERENT |
323 | bool | |
324 | select ARCH_HAS_DMA_PREP_COHERENT | |
1631ba12 | 325 | select ARCH_HAS_SETUP_DMA_OPS |
5f365c13 CD |
326 | select ARCH_HAS_SYNC_DMA_FOR_CPU |
327 | select ARCH_HAS_SYNC_DMA_FOR_DEVICE | |
f51f7a0f | 328 | select DMA_BOUNCE_UNALIGNED_KMALLOC if SWIOTLB |
1631ba12 | 329 | |
b79f300c LP |
330 | config RISCV_NONSTANDARD_CACHE_OPS |
331 | bool | |
b79f300c LP |
332 | help |
333 | This enables function pointer support for non-standard noncoherent | |
334 | systems to handle cache management. | |
335 | ||
5ac43ab2 AJ |
336 | config AS_HAS_INSN |
337 | def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero) | |
338 | ||
e4bb020f | 339 | config AS_HAS_OPTION_ARCH |
fafdea34 | 340 | # https://github.com/llvm/llvm-project/commit/9e8ed3403c191ab9c4903e8eeb8f732ff8a43cb4 |
e4bb020f AC |
341 | def_bool y |
342 | depends on $(as-instr, .option arch$(comma) +m) | |
e4bb020f | 343 | |
0cbb8a32 | 344 | source "arch/riscv/Kconfig.socs" |
a3d095ac | 345 | source "arch/riscv/Kconfig.errata" |
0cbb8a32 | 346 | |
fbe934d6 PD |
347 | menu "Platform type" |
348 | ||
44c1e84a PD |
349 | config NONPORTABLE |
350 | bool "Allow configurations that result in non-portable kernels" | |
351 | help | |
352 | RISC-V kernel binaries are compatible between all known systems | |
353 | whenever possible, but there are some use cases that can only be | |
354 | satisfied by configurations that result in kernel binaries that are | |
355 | not portable between systems. | |
356 | ||
357 | Selecting N does not guarantee kernels will be portable to all known | |
358 | systems. Selecting any of the options guarded by NONPORTABLE will | |
359 | result in kernel binaries that are unlikely to be portable between | |
360 | systems. | |
361 | ||
362 | If unsure, say N. | |
363 | ||
fbe934d6 PD |
364 | choice |
365 | prompt "Base ISA" | |
366 | default ARCH_RV64I | |
367 | help | |
86cca81a | 368 | This selects the base ISA that this kernel will target and must match |
fbe934d6 PD |
369 | the target platform. |
370 | ||
371 | config ARCH_RV32I | |
372 | bool "RV32I" | |
44c1e84a | 373 | depends on NONPORTABLE |
fbe934d6 | 374 | select 32BIT |
e3d59805 MR |
375 | select GENERIC_LIB_ASHLDI3 |
376 | select GENERIC_LIB_ASHRDI3 | |
377 | select GENERIC_LIB_LSHRDI3 | |
8f79125d | 378 | select GENERIC_LIB_UCMPDI2 |
fbe934d6 PD |
379 | |
380 | config ARCH_RV64I | |
381 | bool "RV64I" | |
fbe934d6 | 382 | select 64BIT |
d2075895 | 383 | select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 |
6bd33e1e | 384 | select SWIOTLB if MMU |
fbe934d6 PD |
385 | |
386 | endchoice | |
387 | ||
388 | # We must be able to map all physical memory into the kernel, but the compiler | |
389 | # is still a bit more efficient when generating code if it's setup in a manner | |
390 | # such that it can only map 2GiB of memory. | |
391 | choice | |
392 | prompt "Kernel Code Model" | |
393 | default CMODEL_MEDLOW if 32BIT | |
394 | default CMODEL_MEDANY if 64BIT | |
395 | ||
396 | config CMODEL_MEDLOW | |
397 | bool "medium low code model" | |
398 | config CMODEL_MEDANY | |
399 | bool "medium any code model" | |
400 | endchoice | |
401 | ||
ab1ef68e ZL |
402 | config MODULE_SECTIONS |
403 | bool | |
404 | select HAVE_MOD_ARCH_SPECIFIC | |
405 | ||
fbe934d6 PD |
406 | config SMP |
407 | bool "Symmetric Multi-Processing" | |
408 | help | |
409 | This enables support for systems with more than one CPU. If | |
410 | you say N here, the kernel will run on single and | |
411 | multiprocessor machines, but will use only one CPU of a | |
412 | multiprocessor machine. If you say Y here, the kernel will run | |
413 | on many, but not all, single processor machines. On a single | |
414 | processor machine, the kernel will run faster if you say N | |
415 | here. | |
416 | ||
417 | If you don't know what to do here, say N. | |
418 | ||
8bf7b3b6 SS |
419 | config SCHED_MC |
420 | bool "Multi-core scheduler support" | |
421 | depends on SMP | |
422 | help | |
423 | Multi-core scheduler support improves the CPU scheduler's decision | |
424 | making when dealing with multi-core CPU chips at a cost of slightly | |
425 | increased overhead in some places. If unsure say N here. | |
426 | ||
fbe934d6 | 427 | config NR_CPUS |
e623715f | 428 | int "Maximum number of CPUs (2-512)" |
fbe934d6 | 429 | depends on SMP |
1d6b5ed4 SH |
430 | range 2 512 if !RISCV_SBI_V01 |
431 | range 2 32 if RISCV_SBI_V01 && 32BIT | |
432 | range 2 64 if RISCV_SBI_V01 && 64BIT | |
e623715f AP |
433 | default "32" if 32BIT |
434 | default "64" if 64BIT | |
fbe934d6 | 435 | |
f1e58583 AP |
436 | config HOTPLUG_CPU |
437 | bool "Support for hot-pluggable CPUs" | |
438 | depends on SMP | |
439 | select GENERIC_IRQ_MIGRATION | |
440 | help | |
441 | ||
442 | Say Y here to experiment with turning CPUs off and on. CPUs | |
443 | can be controlled through /sys/devices/system/cpu. | |
444 | ||
445 | Say N if you want to disable CPU hotplug. | |
446 | ||
fbe934d6 PD |
447 | choice |
448 | prompt "CPU Tuning" | |
449 | default TUNE_GENERIC | |
450 | ||
451 | config TUNE_GENERIC | |
452 | bool "generic" | |
453 | ||
454 | endchoice | |
455 | ||
4f0e8eef AP |
456 | # Common NUMA Features |
457 | config NUMA | |
458 | bool "NUMA Memory Allocation and Scheduler Support" | |
1adbc294 | 459 | depends on SMP && MMU |
5f365c13 | 460 | select ARCH_SUPPORTS_NUMA_BALANCING |
4f0e8eef | 461 | select GENERIC_ARCH_NUMA |
6b9f29b8 | 462 | select HAVE_SETUP_PER_CPU_AREA |
5f365c13 | 463 | select NEED_PER_CPU_EMBED_FIRST_CHUNK |
6b9f29b8 | 464 | select NEED_PER_CPU_PAGE_FIRST_CHUNK |
4f0e8eef | 465 | select OF_NUMA |
7ecd19cf | 466 | select USE_PERCPU_NUMA_NODE_ID |
4f0e8eef AP |
467 | help |
468 | Enable NUMA (Non-Uniform Memory Access) support. | |
469 | ||
470 | The kernel will try to allocate memory used by a CPU on the | |
471 | local memory of the CPU and add some more NUMA awareness to the kernel. | |
472 | ||
473 | config NODES_SHIFT | |
474 | int "Maximum NUMA Nodes (as a power of 2)" | |
475 | range 1 10 | |
476 | default "2" | |
a9ee6cf5 | 477 | depends on NUMA |
4f0e8eef AP |
478 | help |
479 | Specify the maximum number of NUMA Nodes available on the target | |
480 | system. Increases memory reserved to accommodate various tables. | |
481 | ||
e64f737a HS |
482 | config RISCV_ALTERNATIVE |
483 | bool | |
484 | depends on !XIP_KERNEL | |
485 | help | |
486 | This Kconfig allows the kernel to automatically patch the | |
ff19a8de AJ |
487 | erratum or cpufeature required by the execution platform at run |
488 | time. The code patching overhead is minimal, as it's only done | |
489 | once at boot and once on each module load. | |
e64f737a | 490 | |
a35707c3 HS |
491 | config RISCV_ALTERNATIVE_EARLY |
492 | bool | |
493 | depends on RISCV_ALTERNATIVE | |
494 | help | |
495 | Allows early patching of the kernel for special errata | |
496 | ||
fbe934d6 PD |
497 | config RISCV_ISA_C |
498 | bool "Emit compressed instructions when building Linux" | |
499 | default y | |
500 | help | |
2f66a3d0 JH |
501 | Adds "C" to the ISA subsets that the toolchain is allowed to emit |
502 | when building Linux, which results in compressed instructions in the | |
503 | Linux binary. | |
fbe934d6 | 504 | |
2f66a3d0 | 505 | If you don't know what to do here, say Y. |
fbe934d6 | 506 | |
23ad288a | 507 | config RISCV_ISA_SVNAPOT |
5464912c | 508 | bool "Svnapot extension support for supervisor mode NAPOT pages" |
23ad288a | 509 | depends on 64BIT && MMU |
d34a6b71 | 510 | depends on RISCV_ALTERNATIVE |
23ad288a | 511 | default y |
23ad288a | 512 | help |
5464912c | 513 | Allow kernel to detect the Svnapot ISA-extension dynamically at boot |
23ad288a QP |
514 | time and enable its usage. |
515 | ||
5464912c | 516 | The Svnapot extension is used to mark contiguous PTEs as a range |
23ad288a QP |
517 | of contiguous virtual-to-physical translations for a naturally |
518 | aligned power-of-2 (NAPOT) granularity larger than the base 4KB page | |
519 | size. When HUGETLBFS is also selected this option unconditionally | |
520 | allocates some memory for each NAPOT page size supported by the kernel. | |
521 | When optimizing for low memory consumption and for platforms without | |
5464912c | 522 | the Svnapot extension, it may be better to say N here. |
23ad288a QP |
523 | |
524 | If you don't know what to do here, say Y. | |
525 | ||
ff689fd2 | 526 | config RISCV_ISA_SVPBMT |
5464912c | 527 | bool "Svpbmt extension support for supervisor mode page-based memory types" |
ff689fd2 | 528 | depends on 64BIT && MMU |
1ee7fc3f | 529 | depends on RISCV_ALTERNATIVE |
ff689fd2 HS |
530 | default y |
531 | help | |
5464912c | 532 | Adds support to dynamically detect the presence of the Svpbmt |
924cbb8c HS |
533 | ISA-extension (Supervisor-mode: page-based memory types) and |
534 | enable its usage. | |
535 | ||
536 | The memory type for a page contains a combination of attributes | |
537 | that indicate the cacheability, idempotency, and ordering | |
538 | properties for access to that page. | |
ff689fd2 | 539 | |
5464912c | 540 | The Svpbmt extension is only available on 64-bit cpus. |
ff689fd2 HS |
541 | |
542 | If you don't know what to do here, say Y. | |
543 | ||
fa8e7cce GR |
544 | config TOOLCHAIN_HAS_V |
545 | bool | |
546 | default y | |
547 | depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64iv) | |
548 | depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32iv) | |
549 | depends on LLD_VERSION >= 140000 || LD_VERSION >= 23800 | |
550 | depends on AS_HAS_OPTION_ARCH | |
551 | ||
552 | config RISCV_ISA_V | |
553 | bool "VECTOR extension support" | |
554 | depends on TOOLCHAIN_HAS_V | |
555 | depends on FPU | |
556 | select DYNAMIC_SIGFRAME | |
557 | default y | |
558 | help | |
559 | Say N here if you want to disable all vector related procedure | |
560 | in the kernel. | |
561 | ||
562 | If you don't know what to do here, say Y. | |
563 | ||
564 | config RISCV_ISA_V_DEFAULT_ENABLE | |
565 | bool "Enable userspace Vector by default" | |
566 | depends on RISCV_ISA_V | |
567 | default y | |
568 | help | |
569 | Say Y here if you want to enable Vector in userspace by default. | |
570 | Otherwise, userspace has to make explicit prctl() call to enable | |
571 | Vector, or enable it via the sysctl interface. | |
572 | ||
573 | If you don't know what to do here, say Y. | |
574 | ||
c2a658d4 AC |
575 | config RISCV_ISA_V_UCOPY_THRESHOLD |
576 | int "Threshold size for vectorized user copies" | |
577 | depends on RISCV_ISA_V | |
578 | default 768 | |
579 | help | |
580 | Prefer using vectorized copy_to_user()/copy_from_user() when the | |
581 | workload size exceeds this value. | |
582 | ||
2080ff94 AC |
583 | config RISCV_ISA_V_PREEMPTIVE |
584 | bool "Run kernel-mode Vector with kernel preemption" | |
585 | depends on PREEMPTION | |
586 | depends on RISCV_ISA_V | |
587 | default y | |
588 | help | |
589 | Usually, in-kernel SIMD routines are run with preemption disabled. | |
590 | Functions which envoke long running SIMD thus must yield core's | |
591 | vector unit to prevent blocking other tasks for too long. | |
592 | ||
593 | This config allows kernel to run SIMD without explicitly disable | |
594 | preemption. Enabling this config will result in higher memory | |
595 | consumption due to the allocation of per-task's kernel Vector context. | |
596 | ||
b6fcdb19 | 597 | config TOOLCHAIN_HAS_ZBB |
1631ba12 | 598 | bool |
b8c86872 | 599 | default y |
b6fcdb19 HS |
600 | depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb) |
601 | depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb) | |
602 | depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900 | |
e4bb020f | 603 | depends on AS_HAS_OPTION_ARCH |
b6fcdb19 | 604 | |
34ca4ec6 EB |
605 | # This symbol indicates that the toolchain supports all v1.0 vector crypto |
606 | # extensions, including Zvk*, Zvbb, and Zvbc. LLVM added all of these at once. | |
607 | # binutils added all except Zvkb, then added Zvkb. So we just check for Zvkb. | |
608 | config TOOLCHAIN_HAS_VECTOR_CRYPTO | |
886516fa | 609 | def_bool $(as-instr, .option arch$(comma) +v$(comma) +zvkb) |
34ca4ec6 EB |
610 | depends on AS_HAS_OPTION_ARCH |
611 | ||
b6fcdb19 HS |
612 | config RISCV_ISA_ZBB |
613 | bool "Zbb extension support for bit manipulation instructions" | |
614 | depends on TOOLCHAIN_HAS_ZBB | |
1ee7fc3f | 615 | depends on RISCV_ALTERNATIVE |
b6fcdb19 HS |
616 | default y |
617 | help | |
618 | Adds support to dynamically detect the presence of the ZBB | |
619 | extension (basic bit manipulation) and enable its usage. | |
620 | ||
621 | The Zbb extension provides instructions to accelerate a number | |
622 | of bit-specific operations (count bit population, sign extending, | |
623 | bitrotation, etc). | |
624 | ||
625 | If you don't know what to do here, say Y. | |
1631ba12 HS |
626 | |
627 | config RISCV_ISA_ZICBOM | |
628 | bool "Zicbom extension support for non-coherent DMA operation" | |
1ee7fc3f CD |
629 | depends on MMU |
630 | depends on RISCV_ALTERNATIVE | |
1631ba12 | 631 | default y |
5f365c13 | 632 | select RISCV_DMA_NONCOHERENT |
381cae16 | 633 | select DMA_DIRECT_REMAP |
1631ba12 HS |
634 | help |
635 | Adds support to dynamically detect the presence of the ZICBOM | |
636 | extension (Cache Block Management Operations) and enable its | |
637 | usage. | |
638 | ||
639 | The Zicbom extension can be used to handle for example | |
640 | non-coherent DMA support on devices that need it. | |
641 | ||
642 | If you don't know what to do here, say Y. | |
643 | ||
ab0f7746 AJ |
644 | config RISCV_ISA_ZICBOZ |
645 | bool "Zicboz extension support for faster zeroing of memory" | |
d34a6b71 | 646 | depends on RISCV_ALTERNATIVE |
ab0f7746 AJ |
647 | default y |
648 | help | |
5464912c | 649 | Enable the use of the Zicboz extension (cbo.zero instruction) |
ab0f7746 AJ |
650 | when available. |
651 | ||
652 | The Zicboz extension is used for faster zeroing of memory. | |
653 | ||
654 | If you don't know what to do here, say Y. | |
655 | ||
aae538cd CD |
656 | config TOOLCHAIN_HAS_ZIHINTPAUSE |
657 | bool | |
658 | default y | |
659 | depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zihintpause) | |
660 | depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zihintpause) | |
661 | depends on LLD_VERSION >= 150000 || LD_VERSION >= 23600 | |
662 | ||
e89c2e81 NC |
663 | config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI |
664 | def_bool y | |
665 | # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc | |
ca09f772 MX |
666 | # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd |
667 | depends on AS_IS_GNU && AS_VERSION >= 23600 | |
e89c2e81 | 668 | help |
ca09f772 MX |
669 | Binutils-2.38 and GCC-12.1.0 bumped the default ISA spec to the newer |
670 | 20191213 version, which moves some instructions from the I extension to | |
671 | the Zicsr and Zifencei extensions. This requires explicitly specifying | |
672 | Zicsr and Zifencei when binutils >= 2.38 or GCC >= 12.1.0. Zicsr | |
673 | and Zifencei are supported in binutils from version 2.36 onwards. | |
674 | To make life easier, and avoid forcing toolchains that default to a | |
675 | newer ISA spec to version 2.2, relax the check to binutils >= 2.36. | |
ef21fa7c MX |
676 | For clang < 17 or GCC < 11.3.0, for which this is not possible or need |
677 | special treatment, this is dealt with in TOOLCHAIN_NEEDS_OLD_ISA_SPEC. | |
e89c2e81 NC |
678 | |
679 | config TOOLCHAIN_NEEDS_OLD_ISA_SPEC | |
680 | def_bool y | |
681 | depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI | |
682 | # https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16 | |
ef21fa7c MX |
683 | # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d29f5d6ab513c52fd872f532c492e35ae9fd6671 |
684 | depends on (CC_IS_CLANG && CLANG_VERSION < 170000) || (CC_IS_GCC && GCC_VERSION < 110300) | |
e89c2e81 | 685 | help |
ca09f772 MX |
686 | Certain versions of clang and GCC do not support zicsr and zifencei via |
687 | -march. This option causes an older ISA spec compatible with these older | |
688 | versions of clang and GCC to be passed to GAS, which has the same result | |
689 | as passing zicsr and zifencei to -march. | |
e89c2e81 | 690 | |
9671f706 AK |
691 | config FPU |
692 | bool "FPU support" | |
693 | default y | |
694 | help | |
695 | Say N here if you want to disable all floating-point related procedure | |
696 | in the kernel. | |
697 | ||
698 | If you don't know what to do here, say Y. | |
699 | ||
163e76cc | 700 | config IRQ_STACKS |
dd69d07a | 701 | bool "Independent irq & softirq stacks" if EXPERT |
163e76cc GR |
702 | default y |
703 | select HAVE_IRQ_EXIT_ON_IRQ_STACK | |
dd69d07a | 704 | select HAVE_SOFTIRQ_ON_OWN_STACK |
163e76cc | 705 | help |
dd69d07a GR |
706 | Add independent irq & softirq stacks for percpu to prevent kernel stack |
707 | overflows. We may save some memory footprint by disabling IRQ_STACKS. | |
163e76cc | 708 | |
a7555f6b GR |
709 | config THREAD_SIZE_ORDER |
710 | int "Kernel stack size (in power-of-two numbers of page size)" if VMAP_STACK && EXPERT | |
711 | range 0 4 | |
712 | default 1 if 32BIT && !KASAN | |
713 | default 3 if 64BIT && KASAN | |
714 | default 2 | |
715 | help | |
716 | Specify the Pages of thread stack size (from 4KB to 64KB), which also | |
717 | affects irq stack size, which is equal to thread stack size. | |
718 | ||
7c832321 | 719 | config RISCV_MISALIGNED |
f413aae9 | 720 | bool |
bc38f613 | 721 | select SYSCTL_ARCH_UNALIGN_ALLOW |
7c832321 | 722 | help |
f413aae9 CJ |
723 | Embed support for emulating misaligned loads and stores. |
724 | ||
725 | choice | |
726 | prompt "Unaligned Accesses Support" | |
727 | default RISCV_PROBE_UNALIGNED_ACCESS | |
728 | help | |
729 | This determines the level of support for unaligned accesses. This | |
730 | information is used by the kernel to perform optimizations. It is also | |
731 | exposed to user space via the hwprobe syscall. The hardware will be | |
732 | probed at boot by default. | |
733 | ||
734 | config RISCV_PROBE_UNALIGNED_ACCESS | |
735 | bool "Probe for hardware unaligned access support" | |
736 | select RISCV_MISALIGNED | |
737 | help | |
738 | During boot, the kernel will run a series of tests to determine the | |
739 | speed of unaligned accesses. This probing will dynamically determine | |
740 | the speed of unaligned accesses on the underlying system. If unaligned | |
741 | memory accesses trap into the kernel as they are not supported by the | |
742 | system, the kernel will emulate the unaligned accesses to preserve the | |
743 | UABI. | |
744 | ||
745 | config RISCV_EMULATED_UNALIGNED_ACCESS | |
746 | bool "Emulate unaligned access where system support is missing" | |
747 | select RISCV_MISALIGNED | |
748 | help | |
749 | If unaligned memory accesses trap into the kernel as they are not | |
750 | supported by the system, the kernel will emulate the unaligned | |
751 | accesses to preserve the UABI. When the underlying system does support | |
752 | unaligned accesses, the unaligned accesses are assumed to be slow. | |
753 | ||
754 | config RISCV_SLOW_UNALIGNED_ACCESS | |
755 | bool "Assume the system supports slow unaligned memory accesses" | |
756 | depends on NONPORTABLE | |
757 | help | |
758 | Assume that the system supports slow unaligned memory accesses. The | |
759 | kernel and userspace programs may not be able to run at all on systems | |
760 | that do not support unaligned memory accesses. | |
7c832321 | 761 | |
b6da6cbe | 762 | config RISCV_EFFICIENT_UNALIGNED_ACCESS |
f413aae9 | 763 | bool "Assume the system supports fast unaligned memory accesses" |
b6da6cbe | 764 | depends on NONPORTABLE |
d0fdc20b | 765 | select DCACHE_WORD_ACCESS if MMU |
b6da6cbe JZ |
766 | select HAVE_EFFICIENT_UNALIGNED_ACCESS |
767 | help | |
f413aae9 CJ |
768 | Assume that the system supports fast unaligned memory accesses. When |
769 | enabled, this option improves the performance of the kernel on such | |
770 | systems. However, the kernel and userspace programs will run much more | |
771 | slowly, or will not be able to run at all, on systems that do not | |
772 | support efficient unaligned memory accesses. | |
b6da6cbe | 773 | |
f413aae9 | 774 | endchoice |
b6da6cbe | 775 | |
2f66a3d0 | 776 | endmenu # "Platform type" |
fbe934d6 | 777 | |
aef53f97 | 778 | menu "Kernel features" |
fbe934d6 | 779 | |
fbe934d6 PD |
780 | source "kernel/Kconfig.hz" |
781 | ||
efca1398 AP |
782 | config RISCV_SBI_V01 |
783 | bool "SBI v0.1 support" | |
efca1398 AP |
784 | depends on RISCV_SBI |
785 | help | |
786 | This config allows kernel to use SBI v0.1 APIs. This will be | |
787 | deprecated in future once legacy M-mode software are no longer in use. | |
fba8a867 | 788 | |
2ffc48fc AP |
789 | config RISCV_BOOT_SPINWAIT |
790 | bool "Spinwait booting method" | |
791 | depends on SMP | |
77d707a3 | 792 | default y if RISCV_SBI_V01 || RISCV_M_MODE |
2ffc48fc AP |
793 | help |
794 | This enables support for booting Linux via spinwait method. In the | |
795 | spinwait method, all cores randomly jump to Linux. One of the cores | |
796 | gets chosen via lottery and all other keep spinning on a percpu | |
797 | variable. This method cannot support CPU hotplug and sparse hartid | |
798 | scheme. It should be only enabled for M-mode Linux or platforms relying | |
799 | on older firmware without SBI HSM extension. All other platforms should | |
800 | rely on ordered booting via SBI HSM extension which gets chosen | |
801 | dynamically at runtime if the firmware supports it. | |
802 | ||
77d707a3 PD |
803 | Since spinwait is incompatible with sparse hart IDs, it requires |
804 | NR_CPUS be large enough to contain the physical hart ID of the first | |
805 | hart to enter Linux. | |
806 | ||
807 | If unsure what to do here, say N. | |
808 | ||
1f0d6efe | 809 | config ARCH_SUPPORTS_KEXEC |
c41bd251 | 810 | def_bool y |
1f0d6efe ED |
811 | |
812 | config ARCH_SELECTS_KEXEC | |
813 | def_bool y | |
814 | depends on KEXEC | |
5f365c13 | 815 | select HOTPLUG_CPU if SMP |
fba8a867 | 816 | |
1f0d6efe | 817 | config ARCH_SUPPORTS_KEXEC_FILE |
c41bd251 | 818 | def_bool 64BIT |
fba8a867 | 819 | |
1f0d6efe ED |
820 | config ARCH_SELECTS_KEXEC_FILE |
821 | def_bool y | |
822 | depends on KEXEC_FILE | |
5f365c13 | 823 | select HAVE_IMA_KEXEC if IMA |
6261586e | 824 | select KEXEC_ELF |
6261586e | 825 | |
e6265fe7 | 826 | config ARCH_SUPPORTS_KEXEC_PURGATORY |
c1ad12ee | 827 | def_bool ARCH_SUPPORTS_KEXEC_FILE |
736e30af | 828 | |
1f0d6efe ED |
829 | config ARCH_SUPPORTS_CRASH_DUMP |
830 | def_bool y | |
fba8a867 | 831 | |
39365395 | 832 | config ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION |
85fcde40 | 833 | def_bool CRASH_RESERVE |
39365395 | 834 | |
9be84592 GR |
835 | config COMPAT |
836 | bool "Kernel support for 32-bit U-mode" | |
837 | default 64BIT | |
838 | depends on 64BIT && MMU | |
839 | help | |
840 | This option enables support for a 32-bit U-mode running under a 64-bit | |
841 | kernel at S-mode. riscv32-specific components such as system calls, | |
842 | the user helper functions (vdso), signal rt_frame functions and the | |
843 | ptrace interface are handled appropriately by the kernel. | |
844 | ||
845 | If you want to execute 32-bit userspace applications, say Y. | |
846 | ||
fdf68acc AJ |
847 | config PARAVIRT |
848 | bool "Enable paravirtualization code" | |
849 | depends on RISCV_SBI | |
850 | help | |
851 | This changes the kernel so it can modify itself when it is run | |
852 | under a hypervisor, potentially improving performance significantly | |
853 | over full virtualization. | |
854 | ||
855 | config PARAVIRT_TIME_ACCOUNTING | |
856 | bool "Paravirtual steal time accounting" | |
857 | depends on PARAVIRT | |
858 | help | |
859 | Select this option to enable fine granularity task steal time | |
860 | accounting. Time spent executing other tasks in parallel with | |
861 | the current vCPU is discounted from the vCPU power. To account for | |
862 | that, there can be a small performance impact. | |
863 | ||
864 | If in doubt, say N here. | |
865 | ||
39b33072 AG |
866 | config RELOCATABLE |
867 | bool "Build a relocatable kernel" | |
868 | depends on MMU && 64BIT && !XIP_KERNEL | |
2aff5f95 | 869 | select MODULE_SECTIONS if MODULES |
39b33072 AG |
870 | help |
871 | This builds a kernel as a Position Independent Executable (PIE), | |
872 | which retains all relocation metadata required to relocate the | |
873 | kernel binary at runtime to a different virtual address than the | |
874 | address it was linked at. | |
875 | Since RISCV uses the RELA relocation format, this requires a | |
876 | relocation pass at runtime even if the kernel is loaded at the | |
877 | same address it was linked at. | |
878 | ||
879 | If unsure, say N. | |
880 | ||
84fe419d AG |
881 | config RANDOMIZE_BASE |
882 | bool "Randomize the address of the kernel image" | |
883 | select RELOCATABLE | |
884 | depends on MMU && 64BIT && !XIP_KERNEL | |
885 | help | |
886 | Randomizes the virtual address at which the kernel image is | |
887 | loaded, as a security feature that deters exploit attempts | |
888 | relying on knowledge of the location of kernel internals. | |
889 | ||
890 | It is the bootloader's job to provide entropy, by passing a | |
891 | random u64 value in /chosen/kaslr-seed at kernel entry. | |
892 | ||
893 | When booting via the UEFI stub, it will invoke the firmware's | |
894 | EFI_RNG_PROTOCOL implementation (if available) to supply entropy | |
895 | to the kernel proper. In addition, it will randomise the physical | |
896 | location of the kernel Image as well. | |
897 | ||
898 | If unsure, say N. | |
899 | ||
2f66a3d0 | 900 | endmenu # "Kernel features" |
fbe934d6 | 901 | |
aef53f97 NK |
902 | menu "Boot options" |
903 | ||
3aed8c43 NK |
904 | config CMDLINE |
905 | string "Built-in kernel command line" | |
aef53f97 | 906 | help |
3aed8c43 NK |
907 | For most platforms, the arguments for the kernel's command line |
908 | are provided at run-time, during boot. However, there are cases | |
909 | where either no arguments are being provided or the provided | |
910 | arguments are insufficient or even invalid. | |
aef53f97 | 911 | |
3aed8c43 NK |
912 | When that occurs, it is possible to define a built-in command |
913 | line here and choose how the kernel should use it later on. | |
aef53f97 | 914 | |
3aed8c43 NK |
915 | choice |
916 | prompt "Built-in command line usage" if CMDLINE != "" | |
917 | default CMDLINE_FALLBACK | |
918 | help | |
919 | Choose how the kernel will handle the provided built-in command | |
920 | line. | |
aef53f97 | 921 | |
3aed8c43 NK |
922 | config CMDLINE_FALLBACK |
923 | bool "Use bootloader kernel arguments if available" | |
aef53f97 | 924 | help |
3aed8c43 NK |
925 | Use the built-in command line as fallback in case we get nothing |
926 | during boot. This is the default behaviour. | |
927 | ||
928 | config CMDLINE_EXTEND | |
929 | bool "Extend bootloader kernel arguments" | |
930 | help | |
931 | The command-line arguments provided during boot will be | |
932 | appended to the built-in command line. This is useful in | |
933 | cases where the provided arguments are insufficient and | |
934 | you don't want to or cannot modify them. | |
935 | ||
aef53f97 | 936 | config CMDLINE_FORCE |
3aed8c43 | 937 | bool "Always use the default kernel command string" |
aef53f97 | 938 | help |
3aed8c43 NK |
939 | Always use the built-in command line, even if we get one during |
940 | boot. This is useful in case you need to override the provided | |
941 | command line on systems where you don't have or want control | |
942 | over it. | |
aef53f97 | 943 | |
3aed8c43 | 944 | endchoice |
aef53f97 | 945 | |
d7071743 AP |
946 | config EFI_STUB |
947 | bool | |
948 | ||
949 | config EFI | |
950 | bool "UEFI runtime support" | |
44c92257 | 951 | depends on OF && !XIP_KERNEL |
5f365c13 CD |
952 | depends on MMU |
953 | default y | |
a91a9ffb | 954 | select ARCH_SUPPORTS_ACPI if 64BIT |
d7071743 | 955 | select EFI_GENERIC_STUB |
5f365c13 | 956 | select EFI_PARAMS_FROM_FDT |
b91540d5 | 957 | select EFI_RUNTIME_WRAPPERS |
5f365c13 CD |
958 | select EFI_STUB |
959 | select LIBFDT | |
d7071743 | 960 | select RISCV_ISA_C |
5f365c13 | 961 | select UCS2_STRING |
d7071743 AP |
962 | help |
963 | This option provides support for runtime services provided | |
964 | by UEFI firmware (such as non-volatile variables, realtime | |
965 | clock, and platform reset). A UEFI stub is also provided to | |
966 | allow the kernel to be booted as an EFI application. This | |
967 | is only useful on systems that have UEFI firmware. | |
968 | ||
fea2fed2 GR |
969 | config CC_HAVE_STACKPROTECTOR_TLS |
970 | def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0) | |
971 | ||
972 | config STACKPROTECTOR_PER_TASK | |
973 | def_bool y | |
595b893e | 974 | depends on !RANDSTRUCT |
fea2fed2 GR |
975 | depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS |
976 | ||
867432be AG |
977 | config PHYS_RAM_BASE_FIXED |
978 | bool "Explicitly specified physical RAM address" | |
44c1e84a | 979 | depends on NONPORTABLE |
867432be AG |
980 | default n |
981 | ||
44c92257 VW |
982 | config PHYS_RAM_BASE |
983 | hex "Platform Physical RAM address" | |
867432be | 984 | depends on PHYS_RAM_BASE_FIXED |
44c92257 VW |
985 | default "0x80000000" |
986 | help | |
987 | This is the physical address of RAM in the system. It has to be | |
988 | explicitly specified to run early relocations of read-write data | |
989 | from flash to RAM. | |
990 | ||
991 | config XIP_KERNEL | |
992 | bool "Kernel Execute-In-Place from ROM" | |
44c1e84a | 993 | depends on MMU && SPARSEMEM && NONPORTABLE |
44c92257 VW |
994 | # This prevents XIP from being enabled by all{yes,mod}config, which |
995 | # fail to build since XIP doesn't support large kernels. | |
996 | depends on !COMPILE_TEST | |
867432be | 997 | select PHYS_RAM_BASE_FIXED |
44c92257 VW |
998 | help |
999 | Execute-In-Place allows the kernel to run from non-volatile storage | |
1000 | directly addressable by the CPU, such as NOR flash. This saves RAM | |
1001 | space since the text section of the kernel is not loaded from flash | |
1002 | to RAM. Read-write sections, such as the data section and stack, | |
1003 | are still copied to RAM. The XIP kernel is not compressed since | |
1004 | it has to run directly from flash, so it will take more space to | |
1005 | store it. The flash address used to link the kernel object files, | |
1006 | and for storing it, is configuration dependent. Therefore, if you | |
1007 | say Y here, you must know the proper physical address where to | |
1008 | store the kernel image depending on your own flash memory usage. | |
1009 | ||
1010 | Also note that the make target becomes "make xipImage" rather than | |
1011 | "make zImage" or "make Image". The final kernel binary to put in | |
1012 | ROM memory will be arch/riscv/boot/xipImage. | |
1013 | ||
1014 | SPARSEMEM is required because the kernel text and rodata that are | |
1015 | flash resident are not backed by memmap, then any attempt to get | |
1016 | a struct page on those regions will trigger a fault. | |
1017 | ||
1018 | If unsure, say N. | |
1019 | ||
1020 | config XIP_PHYS_ADDR | |
1021 | hex "XIP Kernel Physical Location" | |
1022 | depends on XIP_KERNEL | |
1023 | default "0x21000000" | |
1024 | help | |
1025 | This is the physical address in your flash memory the kernel will | |
1026 | be linked for and stored to. This address is dependent on your | |
1027 | own flash usage. | |
1028 | ||
496ea826 CD |
1029 | config RISCV_ISA_FALLBACK |
1030 | bool "Permit falling back to parsing riscv,isa for extension support by default" | |
1031 | default y | |
1032 | help | |
1033 | Parsing the "riscv,isa" devicetree property has been deprecated and | |
1034 | replaced by a list of explicitly defined strings. For compatibility | |
1035 | with existing platforms, the kernel will fall back to parsing the | |
1036 | "riscv,isa" property if the replacements are not found. | |
1037 | ||
1038 | Selecting N here will result in a kernel that does not use the | |
1039 | fallback, unless the commandline "riscv_isa_fallback" parameter is | |
1040 | present. | |
1041 | ||
1042 | Please see the dt-binding, located at | |
1043 | Documentation/devicetree/bindings/riscv/extensions.yaml for details | |
1044 | on the replacement properties, "riscv,isa-base" and | |
1045 | "riscv,isa-extensions". | |
1046 | ||
2d268251 | 1047 | config BUILTIN_DTB |
6c4a2f63 | 1048 | bool "Built-in device tree" |
44c1e84a | 1049 | depends on OF && NONPORTABLE |
2672031b YC |
1050 | help |
1051 | Build a device tree into the Linux image. | |
1052 | This option should be selected if no bootloader is being used. | |
1053 | If unsure, say N. | |
1054 | ||
1055 | ||
1056 | config BUILTIN_DTB_SOURCE | |
1057 | string "Built-in device tree source" | |
1058 | depends on BUILTIN_DTB | |
1059 | help | |
1060 | DTS file path (without suffix, relative to arch/riscv/boot/dts) | |
1061 | for the DTS file that will be used to produce the DTB linked into the | |
1062 | kernel. | |
2d268251 | 1063 | |
6c4a2f63 FH |
1064 | endmenu # "Boot options" |
1065 | ||
44c1e84a PD |
1066 | config PORTABLE |
1067 | bool | |
1068 | default !NONPORTABLE | |
1069 | select EFI | |
44c1e84a | 1070 | select MMU |
5f365c13 | 1071 | select OF |
44c1e84a | 1072 | |
e0c0a7c3 AS |
1073 | config ARCH_PROC_KCORE_TEXT |
1074 | def_bool y | |
1075 | ||
fbe934d6 PD |
1076 | menu "Power management options" |
1077 | ||
8636a1f9 | 1078 | source "kernel/power/Kconfig" |
fbe934d6 | 1079 | |
c0317210 | 1080 | config ARCH_HIBERNATION_POSSIBLE |
e2d6b54b | 1081 | def_bool y |
c0317210 SJH |
1082 | |
1083 | config ARCH_HIBERNATION_HEADER | |
1084 | def_bool HIBERNATION | |
1085 | ||
c1f048a6 SS |
1086 | config ARCH_SUSPEND_POSSIBLE |
1087 | def_bool y | |
1088 | ||
2f66a3d0 | 1089 | endmenu # "Power management options" |
d7071743 | 1090 | |
f6e64b66 AP |
1091 | menu "CPU Power Management" |
1092 | ||
1093 | source "drivers/cpuidle/Kconfig" | |
1094 | ||
effae0e3 LP |
1095 | source "drivers/cpufreq/Kconfig" |
1096 | ||
2f66a3d0 | 1097 | endmenu # "CPU Power Management" |
f6e64b66 | 1098 | |
99cdc6c1 | 1099 | source "arch/riscv/kvm/Kconfig" |
a91a9ffb S |
1100 | |
1101 | source "drivers/acpi/Kconfig" |