Kconfig 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  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_SUPPORTS_ATOMIC_RMW
  14. select ARCH_HAS_BINFMT_FLAT
  15. select ARCH_HAS_DEBUG_VM_PGTABLE
  16. select ARCH_HAS_DEBUG_VIRTUAL if MMU
  17. select ARCH_HAS_DEBUG_WX
  18. select ARCH_HAS_GCOV_PROFILE_ALL
  19. select ARCH_HAS_GIGANTIC_PAGE
  20. select ARCH_HAS_KCOV
  21. select ARCH_HAS_MMIOWB
  22. select ARCH_HAS_PTE_SPECIAL
  23. select ARCH_HAS_SET_DIRECT_MAP
  24. select ARCH_HAS_SET_MEMORY
  25. select ARCH_HAS_STRICT_KERNEL_RWX if MMU
  26. select ARCH_HAS_STRICT_MODULE_RWX if MMU
  27. select ARCH_HAS_DMA_PREP_COHERENT
  28. select ARCH_HAS_SYNC_DMA_FOR_CPU
  29. select ARCH_HAS_SYNC_DMA_FOR_DEVICE
  30. select ARCH_HAS_DMA_WRITE_COMBINE
  31. select ARCH_HAS_DMA_MMAP_PGPROT
  32. select ARCH_KEEP_MEMBLOCK
  33. select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
  34. select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  35. select ARCH_USE_QUEUED_RWLOCKS
  36. select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
  37. select ARCH_WANT_FRAME_POINTERS
  38. select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
  39. select CLONE_BACKWARDS
  40. select CLINT_TIMER if !MMU
  41. select COMMON_CLK
  42. select CPU_PM if (SUSPEND || CPU_IDLE)
  43. select COMPAT_BINFMT_ELF if BINFMT_ELF && COMPAT
  44. select EDAC_SUPPORT
  45. select DMA_DIRECT_REMAP
  46. select GENERIC_ALLOCATOR
  47. select GENERIC_ARCH_TOPOLOGY if SMP
  48. select GENERIC_ATOMIC64 if !64BIT
  49. select GENERIC_CLOCKEVENTS
  50. select GENERIC_EARLY_IOREMAP
  51. select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
  52. select GENERIC_IOREMAP
  53. select GENERIC_IRQ_MULTI_HANDLER
  54. select GENERIC_IRQ_SHOW
  55. select GENERIC_PCI_IOMAP
  56. select GENERIC_PTDUMP if MMU
  57. select GENERIC_SCHED_CLOCK
  58. select GENERIC_SMP_IDLE_THREAD
  59. select GENERIC_STRNCPY_FROM_USER if MMU
  60. select GENERIC_STRNLEN_USER if MMU
  61. select GENERIC_TIME_VSYSCALL if MMU && 64BIT
  62. select HANDLE_DOMAIN_IRQ
  63. select HAVE_ARCH_AUDITSYSCALL
  64. select HAVE_ARCH_JUMP_LABEL
  65. select HAVE_ARCH_JUMP_LABEL_RELATIVE
  66. select HAVE_ARCH_KASAN if MMU && 64BIT
  67. select HAVE_ARCH_KGDB
  68. select HAVE_ARCH_KGDB_QXFER_PKT
  69. select HAVE_ARCH_MMAP_RND_BITS if MMU
  70. select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
  71. select HAVE_ARCH_SECCOMP_FILTER
  72. select HAVE_ARCH_TRACEHOOK
  73. select HAVE_ASM_MODVERSIONS
  74. select HAVE_CONTEXT_TRACKING
  75. select HAVE_DEBUG_KMEMLEAK
  76. select HAVE_DMA_CONTIGUOUS if MMU
  77. select HAVE_EBPF_JIT if MMU
  78. select HAVE_FUTEX_CMPXCHG if FUTEX
  79. select HAVE_GCC_PLUGINS
  80. select HAVE_FUNCTION_ERROR_INJECTION
  81. select HAVE_EFFICIENT_UNALIGNED_ACCESS
  82. select HAVE_GENERIC_VDSO if MMU && 64BIT
  83. select HAVE_KPROBES
  84. select HAVE_KPROBES_ON_FTRACE
  85. select HAVE_KRETPROBES
  86. select HAVE_PCI
  87. select HAVE_PERF_EVENTS
  88. select HAVE_PERF_REGS
  89. select HAVE_PERF_USER_STACK_DUMP
  90. select HAVE_REGS_AND_STACK_ACCESS_API
  91. select HAVE_STACKPROTECTOR
  92. select HAVE_SYSCALL_TRACEPOINTS
  93. select IRQ_DOMAIN
  94. select MODULES_USE_ELF_RELA if MODULES
  95. select MODULE_SECTIONS if MODULES
  96. select OF
  97. select OF_EARLY_FLATTREE
  98. select OF_IRQ
  99. select PCI_DOMAINS_GENERIC if PCI
  100. select PCI_MSI if PCI
  101. select RISCV_INTC
  102. select RISCV_TIMER if RISCV_SBI
  103. select SPARSE_IRQ
  104. select SYSCTL_EXCEPTION_TRACE
  105. select THREAD_INFO_IN_TASK
  106. select UACCESS_MEMCPY if !MMU
  107. config ARCH_MMAP_RND_BITS_MIN
  108. default 18 if 64BIT
  109. default 8
  110. config ARCH_MMAP_RND_COMPAT_BITS_MIN
  111. default 8
  112. # max bits determined by the following formula:
  113. # VA_BITS - PAGE_SHIFT - 3
  114. config ARCH_MMAP_RND_BITS_MAX
  115. default 24 if 64BIT # SV39 based
  116. default 17
  117. config ARCH_MMAP_RND_COMPAT_BITS_MAX
  118. default 17
  119. # set if we run in machine mode, cleared if we run in supervisor mode
  120. config RISCV_M_MODE
  121. bool
  122. default !MMU
  123. # set if we are running in S-mode and can use SBI calls
  124. config RISCV_SBI
  125. bool
  126. depends on !RISCV_M_MODE
  127. default y
  128. config MMU
  129. bool "MMU-based Paged Memory Management Support"
  130. default y
  131. help
  132. Select if you want MMU-based virtualised addressing space
  133. support by paged memory management. If unsure, say 'Y'.
  134. config ZONE_DMA32
  135. bool
  136. default y if 64BIT
  137. config VA_BITS
  138. int
  139. default 32 if 32BIT
  140. default 39 if 64BIT
  141. config PA_BITS
  142. int
  143. default 34 if 32BIT
  144. default 56 if 64BIT
  145. config PAGE_OFFSET
  146. hex
  147. default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
  148. default 0x80000000 if 64BIT && !MMU
  149. default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
  150. default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
  151. config KASAN_SHADOW_OFFSET
  152. hex
  153. depends on KASAN_GENERIC
  154. default 0xdfffffc800000000 if 64BIT
  155. default 0xffffffff if 32BIT
  156. config FORCE_MAX_ZONEORDER
  157. int "Maximum zone order"
  158. default 13
  159. help
  160. The kernel memory allocator divides physically contiguous memory
  161. blocks into "zones", where each zone is a power of two number of
  162. pages. This option selects the largest power of two that the kernel
  163. keeps in the memory allocator. If you need to allocate very large
  164. blocks of physically contiguous memory, then you may need to
  165. increase this value.
  166. This config option is actually maximum order plus one. For example,
  167. a value of 13 means that the largest free memory block is 2^12 pages.
  168. config ARCH_FLATMEM_ENABLE
  169. def_bool y
  170. config ARCH_SPARSEMEM_ENABLE
  171. def_bool y
  172. depends on MMU
  173. select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
  174. select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
  175. config ARCH_SELECT_MEMORY_MODEL
  176. def_bool ARCH_SPARSEMEM_ENABLE
  177. config ARCH_WANT_GENERAL_HUGETLB
  178. def_bool y
  179. config ARCH_SUPPORTS_DEBUG_PAGEALLOC
  180. def_bool y
  181. config ARCH_SUPPORTS_UPROBES
  182. def_bool y
  183. config SYS_SUPPORTS_HUGETLBFS
  184. depends on MMU
  185. def_bool y
  186. config STACKTRACE_SUPPORT
  187. def_bool y
  188. config TRACE_IRQFLAGS_SUPPORT
  189. def_bool y
  190. config GENERIC_BUG
  191. def_bool y
  192. depends on BUG
  193. select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
  194. config GENERIC_BUG_RELATIVE_POINTERS
  195. bool
  196. config GENERIC_CALIBRATE_DELAY
  197. def_bool y
  198. config GENERIC_CSUM
  199. def_bool y
  200. config GENERIC_HWEIGHT
  201. def_bool y
  202. config FIX_EARLYCON_MEM
  203. def_bool MMU
  204. config PGTABLE_LEVELS
  205. int
  206. default 3 if 64BIT
  207. default 2
  208. config LOCKDEP_SUPPORT
  209. def_bool y
  210. source "arch/riscv/Kconfig.socs"
  211. menu "Platform type"
  212. choice
  213. prompt "Base ISA"
  214. default ARCH_RV64I
  215. help
  216. This selects the base ISA that this kernel will target and must match
  217. the target platform.
  218. config ARCH_RV32I
  219. bool "RV32I"
  220. select 32BIT
  221. select GENERIC_LIB_ASHLDI3
  222. select GENERIC_LIB_ASHRDI3
  223. select GENERIC_LIB_LSHRDI3
  224. select GENERIC_LIB_UCMPDI2
  225. select MMU
  226. config ARCH_RV64I
  227. bool "RV64I"
  228. select 64BIT
  229. select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
  230. select HAVE_DYNAMIC_FTRACE if MMU
  231. select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
  232. select HAVE_FTRACE_MCOUNT_RECORD
  233. select HAVE_FUNCTION_GRAPH_TRACER
  234. select HAVE_FUNCTION_TRACER
  235. select SWIOTLB if RISCV_SWIOTLB
  236. endchoice
  237. # We must be able to map all physical memory into the kernel, but the compiler
  238. # is still a bit more efficient when generating code if it's setup in a manner
  239. # such that it can only map 2GiB of memory.
  240. choice
  241. prompt "Kernel Code Model"
  242. default CMODEL_MEDLOW if 32BIT
  243. default CMODEL_MEDANY if 64BIT
  244. config CMODEL_MEDLOW
  245. bool "medium low code model"
  246. config CMODEL_MEDANY
  247. bool "medium any code model"
  248. endchoice
  249. config MODULE_SECTIONS
  250. bool
  251. select HAVE_MOD_ARCH_SPECIFIC
  252. choice
  253. prompt "Maximum Physical Memory"
  254. default MAXPHYSMEM_1GB if 32BIT
  255. default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
  256. default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
  257. config MAXPHYSMEM_1GB
  258. depends on 32BIT
  259. bool "1GiB"
  260. config MAXPHYSMEM_2GB
  261. depends on 64BIT && CMODEL_MEDLOW
  262. bool "2GiB"
  263. config MAXPHYSMEM_128GB
  264. depends on 64BIT && CMODEL_MEDANY
  265. bool "128GiB"
  266. endchoice
  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-32)"
  280. range 2 32
  281. depends on SMP
  282. default "8"
  283. config HOTPLUG_CPU
  284. bool "Support for hot-pluggable CPUs"
  285. depends on SMP
  286. select GENERIC_IRQ_MIGRATION
  287. help
  288. Say Y here to experiment with turning CPUs off and on. CPUs
  289. can be controlled through /sys/devices/system/cpu.
  290. Say N if you want to disable CPU hotplug.
  291. choice
  292. prompt "CPU Tuning"
  293. default TUNE_GENERIC
  294. config TUNE_GENERIC
  295. bool "generic"
  296. endchoice
  297. config RISCV_ISA_C
  298. bool "Emit compressed instructions when building Linux"
  299. default y
  300. help
  301. Adds "C" to the ISA subsets that the toolchain is allowed to emit
  302. when building Linux, which results in compressed instructions in the
  303. Linux binary.
  304. If you don't know what to do here, say Y.
  305. config NO_SFENCE_VMA
  306. bool "Replace sfence.vma with CSR_SMCIR operation"
  307. depends on !SMP
  308. default y
  309. config RISCV_SWIOTLB
  310. bool "Enable SWIOTLB"
  311. depends on MMU
  312. default y
  313. menu "supported PMU type"
  314. depends on PERF_EVENTS
  315. config RISCV_BASE_PMU
  316. bool "Base Performance Monitoring Unit"
  317. def_bool n
  318. help
  319. A base PMU that serves as a reference implementation and has limited
  320. feature of perf. It can run on any RISC-V machines so serves as the
  321. fallback, but this option can also be disable to reduce kernel size.
  322. endmenu
  323. config FPU
  324. bool "FPU support"
  325. default y
  326. help
  327. Say N here if you want to disable all floating-point related procedure
  328. in the kernel.
  329. If you don't know what to do here, say Y.
  330. config VECTOR
  331. bool "VECTOR support"
  332. default n
  333. choice VECTOR_VERSION
  334. prompt "Vector Version"
  335. depends on VECTOR
  336. default VECTOR_1_0
  337. config VECTOR_1_0
  338. bool "VECTOR 1.0 support"
  339. help
  340. Say N here if you want to disable all vector 1.0 related procedure
  341. in the kernel.
  342. If you don't know what to do here, say Y.
  343. config VECTOR_0_7
  344. bool "VECTOR 0.7 support"
  345. help
  346. Say N here if you want to disable all vector 0.7 related procedure
  347. in the kernel.
  348. If you don't know what to do here, say Y.
  349. endchoice
  350. config VLEN_256
  351. bool "VECTOR VLEN 256"
  352. depends on VECTOR
  353. default n
  354. config VECTOR_EMU
  355. bool "VECTOR e64 emulate for c906 v1"
  356. depends on VECTOR
  357. default n
  358. config THEAD_ISA
  359. bool "T-HEAD extension ISA in AFLAGS with -march=_xtheadc"
  360. default n
  361. endmenu
  362. menu "Kernel features"
  363. source "kernel/Kconfig.hz"
  364. config RISCV_SBI_V01
  365. bool "SBI v0.1 support"
  366. default y
  367. depends on RISCV_SBI
  368. help
  369. This config allows kernel to use SBI v0.1 APIs. This will be
  370. deprecated in future once legacy M-mode software are no longer in use.
  371. config KEXEC
  372. bool "Kexec system call"
  373. select KEXEC_CORE
  374. select HOTPLUG_CPU if SMP
  375. depends on MMU
  376. default y
  377. help
  378. kexec is a system call that implements the ability to shutdown your
  379. current kernel, and to start another kernel. It is like a reboot
  380. but it is independent of the system firmware. And like a reboot
  381. you can start any kernel with it, not just Linux.
  382. The name comes from the similarity to the exec system call.
  383. config CRASH_DUMP
  384. bool "Build kdump crash kernel"
  385. default y
  386. help
  387. Generate crash dump after being started by kexec. This should
  388. be normally only set in special crash dump kernels which are
  389. loaded in the main kernel with kexec-tools into a specially
  390. reserved region and then later executed after a crash by
  391. kdump/kexec.
  392. For more details see Documentation/admin-guide/kdump/kdump.rst
  393. config COMPAT
  394. bool "Kernel support for 32-bit U-mode"
  395. depends on 64BIT && MMU
  396. help
  397. This option enables support for a 32-bit U-mode running under a 64-bit
  398. kernel at S-mode. riscv32-specific components such as system calls,
  399. the user helper functions (vdso), signal rt_frame functions and the
  400. ptrace interface are handled appropriately by the kernel.
  401. If you want to execute 32-bit userspace applications, say Y.
  402. config SYSVIPC_COMPAT
  403. def_bool y
  404. depends on COMPAT && SYSVIPC
  405. endmenu
  406. menu "Boot options"
  407. config CMDLINE
  408. string "Built-in kernel command line"
  409. help
  410. For most platforms, the arguments for the kernel's command line
  411. are provided at run-time, during boot. However, there are cases
  412. where either no arguments are being provided or the provided
  413. arguments are insufficient or even invalid.
  414. When that occurs, it is possible to define a built-in command
  415. line here and choose how the kernel should use it later on.
  416. choice
  417. prompt "Built-in command line usage" if CMDLINE != ""
  418. default CMDLINE_FALLBACK
  419. help
  420. Choose how the kernel will handle the provided built-in command
  421. line.
  422. config CMDLINE_FALLBACK
  423. bool "Use bootloader kernel arguments if available"
  424. help
  425. Use the built-in command line as fallback in case we get nothing
  426. during boot. This is the default behaviour.
  427. config CMDLINE_EXTEND
  428. bool "Extend bootloader kernel arguments"
  429. help
  430. The command-line arguments provided during boot will be
  431. appended to the built-in command line. This is useful in
  432. cases where the provided arguments are insufficient and
  433. you don't want to or cannot modify them.
  434. config CMDLINE_FORCE
  435. bool "Always use the default kernel command string"
  436. help
  437. Always use the built-in command line, even if we get one during
  438. boot. This is useful in case you need to override the provided
  439. command line on systems where you don't have or want control
  440. over it.
  441. endchoice
  442. config EFI_STUB
  443. bool
  444. config EFI
  445. bool "UEFI runtime support"
  446. depends on OF
  447. select LIBFDT
  448. select UCS2_STRING
  449. select EFI_PARAMS_FROM_FDT
  450. select EFI_STUB
  451. select EFI_GENERIC_STUB
  452. select EFI_RUNTIME_WRAPPERS
  453. select RISCV_ISA_C
  454. depends on MMU
  455. default y
  456. help
  457. This option provides support for runtime services provided
  458. by UEFI firmware (such as non-volatile variables, realtime
  459. clock, and platform reset). A UEFI stub is also provided to
  460. allow the kernel to be booted as an EFI application. This
  461. is only useful on systems that have UEFI firmware.
  462. endmenu
  463. config BUILTIN_DTB
  464. def_bool n
  465. depends on RISCV_M_MODE
  466. depends on OF
  467. menu "Power management options"
  468. source "drivers/cpuidle/Kconfig"
  469. source "drivers/cpufreq/Kconfig"
  470. source "kernel/power/Kconfig"
  471. config ARCH_SUSPEND_POSSIBLE
  472. def_bool y
  473. endmenu
  474. source "arch/riscv/kvm/Kconfig"
  475. source "drivers/firmware/Kconfig"