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