Kconfig 14 KB

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