Kconfig 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # For a description of the syntax of this configuration file,
  4. # see Documentation/kbuild/kconfig-language.rst.
  5. #
  6. config 64BIT
  7. bool
  8. config 32BIT
  9. bool
  10. config RISCV
  11. def_bool y
  12. select ARCH_CLOCKSOURCE_INIT
  13. select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
  14. select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
  15. select ARCH_HAS_BINFMT_FLAT
  16. select ARCH_HAS_CURRENT_STACK_POINTER
  17. select ARCH_HAS_DEBUG_VM_PGTABLE
  18. select ARCH_HAS_DEBUG_VIRTUAL if MMU
  19. select ARCH_HAS_DEBUG_WX
  20. select ARCH_HAS_FORTIFY_SOURCE
  21. select ARCH_HAS_GCOV_PROFILE_ALL
  22. select ARCH_HAS_GIGANTIC_PAGE
  23. select ARCH_HAS_KCOV
  24. select ARCH_HAS_MMIOWB
  25. select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
  26. select ARCH_HAS_PTE_SPECIAL
  27. select ARCH_HAS_SET_DIRECT_MAP if MMU
  28. select ARCH_HAS_SET_MEMORY if MMU
  29. select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
  30. select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
  31. select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
  32. select ARCH_HAS_UBSAN_SANITIZE_ALL
  33. select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
  34. select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  35. select ARCH_STACKWALK
  36. select ARCH_SUPPORTS_ATOMIC_RMW
  37. select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
  38. select ARCH_SUPPORTS_HUGETLBFS if MMU
  39. select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU
  40. select ARCH_SUPPORTS_PER_VMA_LOCK if MMU
  41. select ARCH_USE_MEMTEST
  42. select ARCH_USE_QUEUED_RWLOCKS
  43. select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
  44. select ARCH_WANT_FRAME_POINTERS
  45. select ARCH_WANT_GENERAL_HUGETLB
  46. select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
  47. select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
  48. select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
  49. select BUILDTIME_TABLE_SORT if MMU
  50. select CLONE_BACKWARDS
  51. select CLINT_TIMER if !MMU
  52. select COMMON_CLK
  53. select CPU_PM if CPU_IDLE
  54. select EDAC_SUPPORT
  55. select GENERIC_ARCH_TOPOLOGY
  56. select GENERIC_ATOMIC64 if !64BIT
  57. select GENERIC_CLOCKEVENTS_BROADCAST if SMP
  58. select GENERIC_EARLY_IOREMAP
  59. select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
  60. select GENERIC_IDLE_POLL_SETUP
  61. select GENERIC_IOREMAP if MMU
  62. select GENERIC_IRQ_MULTI_HANDLER
  63. select GENERIC_IRQ_SHOW
  64. select GENERIC_IRQ_SHOW_LEVEL
  65. select GENERIC_LIB_DEVMEM_IS_ALLOWED
  66. select GENERIC_PCI_IOMAP
  67. select GENERIC_PTDUMP if MMU
  68. select GENERIC_SCHED_CLOCK
  69. select GENERIC_SMP_IDLE_THREAD
  70. select GENERIC_TIME_VSYSCALL if MMU && 64BIT
  71. select GENERIC_VDSO_TIME_NS if HAVE_GENERIC_VDSO
  72. select HARDIRQS_SW_RESEND
  73. select HAVE_ARCH_AUDITSYSCALL
  74. select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
  75. select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
  76. select HAVE_ARCH_KASAN if MMU && 64BIT
  77. select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT
  78. select HAVE_ARCH_KFENCE if MMU && 64BIT
  79. select HAVE_ARCH_KGDB if !XIP_KERNEL
  80. select HAVE_ARCH_KGDB_QXFER_PKT
  81. select HAVE_ARCH_MMAP_RND_BITS if MMU
  82. select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
  83. select HAVE_ARCH_SECCOMP_FILTER
  84. select HAVE_ARCH_TRACEHOOK
  85. select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU
  86. select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
  87. select HAVE_ARCH_THREAD_STRUCT_WHITELIST
  88. select HAVE_ARCH_VMAP_STACK if MMU && 64BIT
  89. select HAVE_ASM_MODVERSIONS
  90. select HAVE_CONTEXT_TRACKING_USER
  91. select HAVE_DEBUG_KMEMLEAK
  92. select HAVE_DMA_CONTIGUOUS if MMU
  93. select HAVE_EBPF_JIT if MMU
  94. select HAVE_FUNCTION_ERROR_INJECTION
  95. select HAVE_GCC_PLUGINS
  96. select HAVE_GENERIC_VDSO if MMU && 64BIT
  97. select HAVE_IRQ_TIME_ACCOUNTING
  98. select HAVE_KPROBES if !XIP_KERNEL
  99. select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
  100. select HAVE_KRETPROBES if !XIP_KERNEL
  101. select HAVE_MOVE_PMD
  102. select HAVE_MOVE_PUD
  103. select HAVE_PCI
  104. select HAVE_PERF_EVENTS
  105. select HAVE_PERF_REGS
  106. select HAVE_PERF_USER_STACK_DUMP
  107. select HAVE_POSIX_CPU_TIMERS_TASK_WORK
  108. select HAVE_REGS_AND_STACK_ACCESS_API
  109. select HAVE_FUNCTION_ARG_ACCESS_API
  110. select HAVE_STACKPROTECTOR
  111. select HAVE_SYSCALL_TRACEPOINTS
  112. select HAVE_RSEQ
  113. select IRQ_DOMAIN
  114. select IRQ_FORCED_THREADING
  115. select LOCK_MM_AND_FIND_VMA
  116. select MODULES_USE_ELF_RELA if MODULES
  117. select MODULE_SECTIONS if MODULES
  118. select OF
  119. select OF_DMA_DEFAULT_COHERENT
  120. select OF_EARLY_FLATTREE
  121. select OF_IRQ
  122. select PCI_DOMAINS_GENERIC if PCI
  123. select PCI_MSI if PCI
  124. select RISCV_INTC
  125. select RISCV_TIMER if RISCV_SBI
  126. select SPARSE_IRQ
  127. select SYSCTL_EXCEPTION_TRACE
  128. select THREAD_INFO_IN_TASK
  129. select TRACE_IRQFLAGS_SUPPORT
  130. select UACCESS_MEMCPY if !MMU
  131. select ZONE_DMA32 if 64BIT
  132. config ARCH_MMAP_RND_BITS_MIN
  133. default 18 if 64BIT
  134. default 8
  135. config ARCH_MMAP_RND_COMPAT_BITS_MIN
  136. default 8
  137. # max bits determined by the following formula:
  138. # VA_BITS - PAGE_SHIFT - 3
  139. config ARCH_MMAP_RND_BITS_MAX
  140. default 24 if 64BIT # SV39 based
  141. default 17
  142. config ARCH_MMAP_RND_COMPAT_BITS_MAX
  143. default 17
  144. # set if we run in machine mode, cleared if we run in supervisor mode
  145. config RISCV_M_MODE
  146. bool
  147. default !MMU
  148. # set if we are running in S-mode and can use SBI calls
  149. config RISCV_SBI
  150. bool
  151. depends on !RISCV_M_MODE
  152. default y
  153. config MMU
  154. bool "MMU-based Paged Memory Management Support"
  155. default y
  156. help
  157. Select if you want MMU-based virtualised addressing space
  158. support by paged memory management. If unsure, say 'Y'.
  159. config PAGE_OFFSET
  160. hex
  161. default 0xC0000000 if 32BIT
  162. default 0x80000000 if 64BIT && !MMU
  163. default 0xff60000000000000 if 64BIT
  164. config KASAN_SHADOW_OFFSET
  165. hex
  166. depends on KASAN_GENERIC
  167. default 0xdfffffff00000000 if 64BIT
  168. default 0xffffffff if 32BIT
  169. config ARCH_FLATMEM_ENABLE
  170. def_bool !NUMA
  171. config ARCH_SPARSEMEM_ENABLE
  172. def_bool y
  173. depends on MMU
  174. select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
  175. select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
  176. config ARCH_SELECT_MEMORY_MODEL
  177. def_bool ARCH_SPARSEMEM_ENABLE
  178. config ARCH_SUPPORTS_UPROBES
  179. def_bool y
  180. config STACKTRACE_SUPPORT
  181. def_bool y
  182. config GENERIC_BUG
  183. def_bool y
  184. depends on BUG
  185. select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
  186. config GENERIC_BUG_RELATIVE_POINTERS
  187. bool
  188. config GENERIC_CALIBRATE_DELAY
  189. def_bool y
  190. config GENERIC_CSUM
  191. def_bool y
  192. config GENERIC_HWEIGHT
  193. def_bool y
  194. config FIX_EARLYCON_MEM
  195. def_bool MMU
  196. config PGTABLE_LEVELS
  197. int
  198. default 5 if 64BIT
  199. default 2
  200. config LOCKDEP_SUPPORT
  201. def_bool y
  202. config RISCV_DMA_NONCOHERENT
  203. bool
  204. select ARCH_HAS_DMA_PREP_COHERENT
  205. select ARCH_HAS_SYNC_DMA_FOR_DEVICE
  206. select ARCH_HAS_SYNC_DMA_FOR_CPU
  207. select ARCH_HAS_SETUP_DMA_OPS
  208. select DMA_DIRECT_REMAP
  209. config AS_HAS_INSN
  210. def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero)
  211. source "arch/riscv/Kconfig.socs"
  212. source "arch/riscv/Kconfig.erratas"
  213. menu "Platform type"
  214. config NONPORTABLE
  215. bool "Allow configurations that result in non-portable kernels"
  216. help
  217. RISC-V kernel binaries are compatible between all known systems
  218. whenever possible, but there are some use cases that can only be
  219. satisfied by configurations that result in kernel binaries that are
  220. not portable between systems.
  221. Selecting N does not guarantee kernels will be portable to all known
  222. systems. Selecting any of the options guarded by NONPORTABLE will
  223. result in kernel binaries that are unlikely to be portable between
  224. systems.
  225. If unsure, say N.
  226. choice
  227. prompt "Base ISA"
  228. default ARCH_RV64I
  229. help
  230. This selects the base ISA that this kernel will target and must match
  231. the target platform.
  232. config ARCH_RV32I
  233. bool "RV32I"
  234. depends on NONPORTABLE
  235. select 32BIT
  236. select GENERIC_LIB_ASHLDI3
  237. select GENERIC_LIB_ASHRDI3
  238. select GENERIC_LIB_LSHRDI3
  239. select GENERIC_LIB_UCMPDI2
  240. select MMU
  241. config ARCH_RV64I
  242. bool "RV64I"
  243. select 64BIT
  244. select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
  245. select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
  246. select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
  247. select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
  248. select HAVE_FUNCTION_GRAPH_TRACER
  249. select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !PREEMPTION
  250. select SWIOTLB if MMU
  251. endchoice
  252. # We must be able to map all physical memory into the kernel, but the compiler
  253. # is still a bit more efficient when generating code if it's setup in a manner
  254. # such that it can only map 2GiB of memory.
  255. choice
  256. prompt "Kernel Code Model"
  257. default CMODEL_MEDLOW if 32BIT
  258. default CMODEL_MEDANY if 64BIT
  259. config CMODEL_MEDLOW
  260. bool "medium low code model"
  261. config CMODEL_MEDANY
  262. bool "medium any code model"
  263. endchoice
  264. config MODULE_SECTIONS
  265. bool
  266. select HAVE_MOD_ARCH_SPECIFIC
  267. config SMP
  268. bool "Symmetric Multi-Processing"
  269. help
  270. This enables support for systems with more than one CPU. If
  271. you say N here, the kernel will run on single and
  272. multiprocessor machines, but will use only one CPU of a
  273. multiprocessor machine. If you say Y here, the kernel will run
  274. on many, but not all, single processor machines. On a single
  275. processor machine, the kernel will run faster if you say N
  276. here.
  277. If you don't know what to do here, say N.
  278. config NR_CPUS
  279. int "Maximum number of CPUs (2-512)"
  280. depends on SMP
  281. range 2 512 if !RISCV_SBI_V01
  282. range 2 32 if RISCV_SBI_V01 && 32BIT
  283. range 2 64 if RISCV_SBI_V01 && 64BIT
  284. default "32" if 32BIT
  285. default "64" if 64BIT
  286. config HOTPLUG_CPU
  287. bool "Support for hot-pluggable CPUs"
  288. depends on SMP
  289. select GENERIC_IRQ_MIGRATION
  290. help
  291. Say Y here to experiment with turning CPUs off and on. CPUs
  292. can be controlled through /sys/devices/system/cpu.
  293. Say N if you want to disable CPU hotplug.
  294. choice
  295. prompt "CPU Tuning"
  296. default TUNE_GENERIC
  297. config TUNE_GENERIC
  298. bool "generic"
  299. endchoice
  300. # Common NUMA Features
  301. config NUMA
  302. bool "NUMA Memory Allocation and Scheduler Support"
  303. depends on SMP && MMU
  304. select GENERIC_ARCH_NUMA
  305. select OF_NUMA
  306. select ARCH_SUPPORTS_NUMA_BALANCING
  307. select USE_PERCPU_NUMA_NODE_ID
  308. select NEED_PER_CPU_EMBED_FIRST_CHUNK
  309. help
  310. Enable NUMA (Non-Uniform Memory Access) support.
  311. The kernel will try to allocate memory used by a CPU on the
  312. local memory of the CPU and add some more NUMA awareness to the kernel.
  313. config NODES_SHIFT
  314. int "Maximum NUMA Nodes (as a power of 2)"
  315. range 1 10
  316. default "2"
  317. depends on NUMA
  318. help
  319. Specify the maximum number of NUMA Nodes available on the target
  320. system. Increases memory reserved to accommodate various tables.
  321. config RISCV_ALTERNATIVE
  322. bool
  323. depends on !XIP_KERNEL
  324. help
  325. This Kconfig allows the kernel to automatically patch the
  326. errata required by the execution platform at run time. The
  327. code patching is performed once in the boot stages. It means
  328. that the overhead from this mechanism is just taken once.
  329. config RISCV_ALTERNATIVE_EARLY
  330. bool
  331. depends on RISCV_ALTERNATIVE
  332. help
  333. Allows early patching of the kernel for special errata
  334. config RISCV_ISA_C
  335. bool "Emit compressed instructions when building Linux"
  336. default y
  337. help
  338. Adds "C" to the ISA subsets that the toolchain is allowed to emit
  339. when building Linux, which results in compressed instructions in the
  340. Linux binary.
  341. If you don't know what to do here, say Y.
  342. config RISCV_ISA_SVPBMT
  343. bool "SVPBMT extension support"
  344. depends on 64BIT && MMU
  345. depends on !XIP_KERNEL
  346. select RISCV_ALTERNATIVE
  347. default y
  348. help
  349. Adds support to dynamically detect the presence of the SVPBMT
  350. ISA-extension (Supervisor-mode: page-based memory types) and
  351. enable its usage.
  352. The memory type for a page contains a combination of attributes
  353. that indicate the cacheability, idempotency, and ordering
  354. properties for access to that page.
  355. The SVPBMT extension is only available on 64Bit cpus.
  356. If you don't know what to do here, say Y.
  357. config TOOLCHAIN_HAS_ZICBOM
  358. bool
  359. default y
  360. depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zicbom)
  361. depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zicbom)
  362. depends on LLD_VERSION >= 150000 || LD_VERSION >= 23800
  363. config RISCV_ISA_ZICBOM
  364. bool "Zicbom extension support for non-coherent DMA operation"
  365. depends on TOOLCHAIN_HAS_ZICBOM
  366. depends on !XIP_KERNEL && MMU
  367. select RISCV_DMA_NONCOHERENT
  368. select RISCV_ALTERNATIVE
  369. default y
  370. help
  371. Adds support to dynamically detect the presence of the ZICBOM
  372. extension (Cache Block Management Operations) and enable its
  373. usage.
  374. The Zicbom extension can be used to handle for example
  375. non-coherent DMA support on devices that need it.
  376. If you don't know what to do here, say Y.
  377. config TOOLCHAIN_HAS_ZIHINTPAUSE
  378. bool
  379. default y
  380. depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zihintpause)
  381. depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zihintpause)
  382. depends on LLD_VERSION >= 150000 || LD_VERSION >= 23600
  383. config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
  384. def_bool y
  385. # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc
  386. # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=98416dbb0a62579d4a7a4a76bab51b5b52fec2cd
  387. depends on AS_IS_GNU && AS_VERSION >= 23600
  388. help
  389. Binutils-2.38 and GCC-12.1.0 bumped the default ISA spec to the newer
  390. 20191213 version, which moves some instructions from the I extension to
  391. the Zicsr and Zifencei extensions. This requires explicitly specifying
  392. Zicsr and Zifencei when binutils >= 2.38 or GCC >= 12.1.0. Zicsr
  393. and Zifencei are supported in binutils from version 2.36 onwards.
  394. To make life easier, and avoid forcing toolchains that default to a
  395. newer ISA spec to version 2.2, relax the check to binutils >= 2.36.
  396. For clang < 17 or GCC < 11.3.0, for which this is not possible or need
  397. special treatment, this is dealt with in TOOLCHAIN_NEEDS_OLD_ISA_SPEC.
  398. config TOOLCHAIN_NEEDS_OLD_ISA_SPEC
  399. def_bool y
  400. depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
  401. # https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16
  402. # https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d29f5d6ab513c52fd872f532c492e35ae9fd6671
  403. depends on (CC_IS_CLANG && CLANG_VERSION < 170000) || (CC_IS_GCC && GCC_VERSION < 110300)
  404. help
  405. Certain versions of clang and GCC do not support zicsr and zifencei via
  406. -march. This option causes an older ISA spec compatible with these older
  407. versions of clang and GCC to be passed to GAS, which has the same result
  408. as passing zicsr and zifencei to -march.
  409. config FPU
  410. bool "FPU support"
  411. default y
  412. help
  413. Say N here if you want to disable all floating-point related procedure
  414. in the kernel.
  415. If you don't know what to do here, say Y.
  416. endmenu # "Platform type"
  417. menu "Kernel features"
  418. source "kernel/Kconfig.hz"
  419. config RISCV_SBI_V01
  420. bool "SBI v0.1 support"
  421. depends on RISCV_SBI
  422. help
  423. This config allows kernel to use SBI v0.1 APIs. This will be
  424. deprecated in future once legacy M-mode software are no longer in use.
  425. config RISCV_BOOT_SPINWAIT
  426. bool "Spinwait booting method"
  427. depends on SMP
  428. default y if RISCV_SBI_V01 || RISCV_M_MODE
  429. help
  430. This enables support for booting Linux via spinwait method. In the
  431. spinwait method, all cores randomly jump to Linux. One of the cores
  432. gets chosen via lottery and all other keep spinning on a percpu
  433. variable. This method cannot support CPU hotplug and sparse hartid
  434. scheme. It should be only enabled for M-mode Linux or platforms relying
  435. on older firmware without SBI HSM extension. All other platforms should
  436. rely on ordered booting via SBI HSM extension which gets chosen
  437. dynamically at runtime if the firmware supports it.
  438. Since spinwait is incompatible with sparse hart IDs, it requires
  439. NR_CPUS be large enough to contain the physical hart ID of the first
  440. hart to enter Linux.
  441. If unsure what to do here, say N.
  442. config KEXEC
  443. bool "Kexec system call"
  444. select KEXEC_CORE
  445. select HOTPLUG_CPU if SMP
  446. depends on MMU
  447. help
  448. kexec is a system call that implements the ability to shutdown your
  449. current kernel, and to start another kernel. It is like a reboot
  450. but it is independent of the system firmware. And like a reboot
  451. you can start any kernel with it, not just Linux.
  452. The name comes from the similarity to the exec system call.
  453. config KEXEC_FILE
  454. bool "kexec file based systmem call"
  455. select KEXEC_CORE
  456. select KEXEC_ELF
  457. select HAVE_IMA_KEXEC if IMA
  458. depends on 64BIT && MMU
  459. help
  460. This is new version of kexec system call. This system call is
  461. file based and takes file descriptors as system call argument
  462. for kernel and initramfs as opposed to list of segments as
  463. accepted by previous system call.
  464. If you don't know what to do here, say Y.
  465. config ARCH_HAS_KEXEC_PURGATORY
  466. def_bool KEXEC_FILE
  467. depends on CRYPTO=y
  468. depends on CRYPTO_SHA256=y
  469. config CRASH_DUMP
  470. bool "Build kdump crash kernel"
  471. help
  472. Generate crash dump after being started by kexec. This should
  473. be normally only set in special crash dump kernels which are
  474. loaded in the main kernel with kexec-tools into a specially
  475. reserved region and then later executed after a crash by
  476. kdump/kexec.
  477. For more details see Documentation/admin-guide/kdump/kdump.rst
  478. config COMPAT
  479. bool "Kernel support for 32-bit U-mode"
  480. default 64BIT
  481. depends on 64BIT && MMU
  482. help
  483. This option enables support for a 32-bit U-mode running under a 64-bit
  484. kernel at S-mode. riscv32-specific components such as system calls,
  485. the user helper functions (vdso), signal rt_frame functions and the
  486. ptrace interface are handled appropriately by the kernel.
  487. If you want to execute 32-bit userspace applications, say Y.
  488. endmenu # "Kernel features"
  489. menu "Boot options"
  490. config CMDLINE
  491. string "Built-in kernel command line"
  492. help
  493. For most platforms, the arguments for the kernel's command line
  494. are provided at run-time, during boot. However, there are cases
  495. where either no arguments are being provided or the provided
  496. arguments are insufficient or even invalid.
  497. When that occurs, it is possible to define a built-in command
  498. line here and choose how the kernel should use it later on.
  499. choice
  500. prompt "Built-in command line usage" if CMDLINE != ""
  501. default CMDLINE_FALLBACK
  502. help
  503. Choose how the kernel will handle the provided built-in command
  504. line.
  505. config CMDLINE_FALLBACK
  506. bool "Use bootloader kernel arguments if available"
  507. help
  508. Use the built-in command line as fallback in case we get nothing
  509. during boot. This is the default behaviour.
  510. config CMDLINE_EXTEND
  511. bool "Extend bootloader kernel arguments"
  512. help
  513. The command-line arguments provided during boot will be
  514. appended to the built-in command line. This is useful in
  515. cases where the provided arguments are insufficient and
  516. you don't want to or cannot modify them.
  517. config CMDLINE_FORCE
  518. bool "Always use the default kernel command string"
  519. help
  520. Always use the built-in command line, even if we get one during
  521. boot. This is useful in case you need to override the provided
  522. command line on systems where you don't have or want control
  523. over it.
  524. endchoice
  525. config EFI_STUB
  526. bool
  527. config EFI
  528. bool "UEFI runtime support"
  529. depends on OF && !XIP_KERNEL
  530. select LIBFDT
  531. select UCS2_STRING
  532. select EFI_PARAMS_FROM_FDT
  533. select EFI_STUB
  534. select EFI_GENERIC_STUB
  535. select EFI_RUNTIME_WRAPPERS
  536. select RISCV_ISA_C
  537. depends on MMU
  538. default y
  539. help
  540. This option provides support for runtime services provided
  541. by UEFI firmware (such as non-volatile variables, realtime
  542. clock, and platform reset). A UEFI stub is also provided to
  543. allow the kernel to be booted as an EFI application. This
  544. is only useful on systems that have UEFI firmware.
  545. config CC_HAVE_STACKPROTECTOR_TLS
  546. def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
  547. config STACKPROTECTOR_PER_TASK
  548. def_bool y
  549. depends on !RANDSTRUCT
  550. depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
  551. config PHYS_RAM_BASE_FIXED
  552. bool "Explicitly specified physical RAM address"
  553. depends on NONPORTABLE
  554. default n
  555. config PHYS_RAM_BASE
  556. hex "Platform Physical RAM address"
  557. depends on PHYS_RAM_BASE_FIXED
  558. default "0x80000000"
  559. help
  560. This is the physical address of RAM in the system. It has to be
  561. explicitly specified to run early relocations of read-write data
  562. from flash to RAM.
  563. config XIP_KERNEL
  564. bool "Kernel Execute-In-Place from ROM"
  565. depends on MMU && SPARSEMEM && NONPORTABLE
  566. # This prevents XIP from being enabled by all{yes,mod}config, which
  567. # fail to build since XIP doesn't support large kernels.
  568. depends on !COMPILE_TEST
  569. select PHYS_RAM_BASE_FIXED
  570. help
  571. Execute-In-Place allows the kernel to run from non-volatile storage
  572. directly addressable by the CPU, such as NOR flash. This saves RAM
  573. space since the text section of the kernel is not loaded from flash
  574. to RAM. Read-write sections, such as the data section and stack,
  575. are still copied to RAM. The XIP kernel is not compressed since
  576. it has to run directly from flash, so it will take more space to
  577. store it. The flash address used to link the kernel object files,
  578. and for storing it, is configuration dependent. Therefore, if you
  579. say Y here, you must know the proper physical address where to
  580. store the kernel image depending on your own flash memory usage.
  581. Also note that the make target becomes "make xipImage" rather than
  582. "make zImage" or "make Image". The final kernel binary to put in
  583. ROM memory will be arch/riscv/boot/xipImage.
  584. SPARSEMEM is required because the kernel text and rodata that are
  585. flash resident are not backed by memmap, then any attempt to get
  586. a struct page on those regions will trigger a fault.
  587. If unsure, say N.
  588. config XIP_PHYS_ADDR
  589. hex "XIP Kernel Physical Location"
  590. depends on XIP_KERNEL
  591. default "0x21000000"
  592. help
  593. This is the physical address in your flash memory the kernel will
  594. be linked for and stored to. This address is dependent on your
  595. own flash usage.
  596. endmenu # "Boot options"
  597. config BUILTIN_DTB
  598. bool
  599. depends on OF && NONPORTABLE
  600. default y if XIP_KERNEL
  601. config PORTABLE
  602. bool
  603. default !NONPORTABLE
  604. select EFI
  605. select OF
  606. select MMU
  607. menu "Power management options"
  608. source "kernel/power/Kconfig"
  609. endmenu # "Power management options"
  610. menu "CPU Power Management"
  611. source "drivers/cpuidle/Kconfig"
  612. endmenu # "CPU Power Management"
  613. source "arch/riscv/kvm/Kconfig"