Kconfig 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # General architecture dependent options
  4. #
  5. #
  6. # Note: arch/$(SRCARCH)/Kconfig needs to be included first so that it can
  7. # override the default values in this file.
  8. #
  9. source "arch/$(SRCARCH)/Kconfig"
  10. config ARCH_CONFIGURES_CPU_MITIGATIONS
  11. bool
  12. if !ARCH_CONFIGURES_CPU_MITIGATIONS
  13. config CPU_MITIGATIONS
  14. def_bool y
  15. endif
  16. #
  17. # Selected by architectures that need custom DMA operations for e.g. legacy
  18. # IOMMUs not handled by dma-iommu. Drivers must never select this symbol.
  19. #
  20. config ARCH_HAS_DMA_OPS
  21. depends on HAS_DMA
  22. select DMA_OPS_HELPERS
  23. bool
  24. menu "General architecture-dependent options"
  25. config ARCH_HAS_SUBPAGE_FAULTS
  26. bool
  27. help
  28. Select if the architecture can check permissions at sub-page
  29. granularity (e.g. arm64 MTE). The probe_user_*() functions
  30. must be implemented.
  31. config HOTPLUG_SMT
  32. bool
  33. config SMT_NUM_THREADS_DYNAMIC
  34. bool
  35. # Selected by HOTPLUG_CORE_SYNC_DEAD or HOTPLUG_CORE_SYNC_FULL
  36. config HOTPLUG_CORE_SYNC
  37. bool
  38. # Basic CPU dead synchronization selected by architecture
  39. config HOTPLUG_CORE_SYNC_DEAD
  40. bool
  41. select HOTPLUG_CORE_SYNC
  42. # Full CPU synchronization with alive state selected by architecture
  43. config HOTPLUG_CORE_SYNC_FULL
  44. bool
  45. select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
  46. select HOTPLUG_CORE_SYNC
  47. config HOTPLUG_SPLIT_STARTUP
  48. bool
  49. select HOTPLUG_CORE_SYNC_FULL
  50. config HOTPLUG_PARALLEL
  51. bool
  52. select HOTPLUG_SPLIT_STARTUP
  53. config GENERIC_ENTRY
  54. bool
  55. config KPROBES
  56. bool "Kprobes"
  57. depends on HAVE_KPROBES
  58. select KALLSYMS
  59. select EXECMEM
  60. select NEED_TASKS_RCU
  61. help
  62. Kprobes allows you to trap at almost any kernel address and
  63. execute a callback function. register_kprobe() establishes
  64. a probepoint and specifies the callback. Kprobes is useful
  65. for kernel debugging, non-intrusive instrumentation and testing.
  66. If in doubt, say "N".
  67. config JUMP_LABEL
  68. bool "Optimize very unlikely/likely branches"
  69. depends on HAVE_ARCH_JUMP_LABEL
  70. select OBJTOOL if HAVE_JUMP_LABEL_HACK
  71. help
  72. This option enables a transparent branch optimization that
  73. makes certain almost-always-true or almost-always-false branch
  74. conditions even cheaper to execute within the kernel.
  75. Certain performance-sensitive kernel code, such as trace points,
  76. scheduler functionality, networking code and KVM have such
  77. branches and include support for this optimization technique.
  78. If it is detected that the compiler has support for "asm goto",
  79. the kernel will compile such branches with just a nop
  80. instruction. When the condition flag is toggled to true, the
  81. nop will be converted to a jump instruction to execute the
  82. conditional block of instructions.
  83. This technique lowers overhead and stress on the branch prediction
  84. of the processor and generally makes the kernel faster. The update
  85. of the condition is slower, but those are always very rare.
  86. ( On 32-bit x86, the necessary options added to the compiler
  87. flags may increase the size of the kernel slightly. )
  88. config STATIC_KEYS_SELFTEST
  89. bool "Static key selftest"
  90. depends on JUMP_LABEL
  91. help
  92. Boot time self-test of the branch patching code.
  93. config STATIC_CALL_SELFTEST
  94. bool "Static call selftest"
  95. depends on HAVE_STATIC_CALL
  96. help
  97. Boot time self-test of the call patching code.
  98. config OPTPROBES
  99. def_bool y
  100. depends on KPROBES && HAVE_OPTPROBES
  101. select NEED_TASKS_RCU
  102. config KPROBES_ON_FTRACE
  103. def_bool y
  104. depends on KPROBES && HAVE_KPROBES_ON_FTRACE
  105. depends on DYNAMIC_FTRACE_WITH_REGS
  106. help
  107. If function tracer is enabled and the arch supports full
  108. passing of pt_regs to function tracing, then kprobes can
  109. optimize on top of function tracing.
  110. config UPROBES
  111. def_bool n
  112. depends on ARCH_SUPPORTS_UPROBES
  113. help
  114. Uprobes is the user-space counterpart to kprobes: they
  115. enable instrumentation applications (such as 'perf probe')
  116. to establish unintrusive probes in user-space binaries and
  117. libraries, by executing handler functions when the probes
  118. are hit by user-space applications.
  119. ( These probes come in the form of single-byte breakpoints,
  120. managed by the kernel and kept transparent to the probed
  121. application. )
  122. config HAVE_64BIT_ALIGNED_ACCESS
  123. def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
  124. help
  125. Some architectures require 64 bit accesses to be 64 bit
  126. aligned, which also requires structs containing 64 bit values
  127. to be 64 bit aligned too. This includes some 32 bit
  128. architectures which can do 64 bit accesses, as well as 64 bit
  129. architectures without unaligned access.
  130. This symbol should be selected by an architecture if 64 bit
  131. accesses are required to be 64 bit aligned in this way even
  132. though it is not a 64 bit architecture.
  133. See Documentation/core-api/unaligned-memory-access.rst for
  134. more information on the topic of unaligned memory accesses.
  135. config HAVE_EFFICIENT_UNALIGNED_ACCESS
  136. bool
  137. help
  138. Some architectures are unable to perform unaligned accesses
  139. without the use of get_unaligned/put_unaligned. Others are
  140. unable to perform such accesses efficiently (e.g. trap on
  141. unaligned access and require fixing it up in the exception
  142. handler.)
  143. This symbol should be selected by an architecture if it can
  144. perform unaligned accesses efficiently to allow different
  145. code paths to be selected for these cases. Some network
  146. drivers, for example, could opt to not fix up alignment
  147. problems with received packets if doing so would not help
  148. much.
  149. See Documentation/core-api/unaligned-memory-access.rst for more
  150. information on the topic of unaligned memory accesses.
  151. config ARCH_USE_BUILTIN_BSWAP
  152. bool
  153. help
  154. Modern versions of GCC (since 4.4) have builtin functions
  155. for handling byte-swapping. Using these, instead of the old
  156. inline assembler that the architecture code provides in the
  157. __arch_bswapXX() macros, allows the compiler to see what's
  158. happening and offers more opportunity for optimisation. In
  159. particular, the compiler will be able to combine the byteswap
  160. with a nearby load or store and use load-and-swap or
  161. store-and-swap instructions if the architecture has them. It
  162. should almost *never* result in code which is worse than the
  163. hand-coded assembler in <asm/swab.h>. But just in case it
  164. does, the use of the builtins is optional.
  165. Any architecture with load-and-swap or store-and-swap
  166. instructions should set this. And it shouldn't hurt to set it
  167. on architectures that don't have such instructions.
  168. config KRETPROBES
  169. def_bool y
  170. depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
  171. config KRETPROBE_ON_RETHOOK
  172. def_bool y
  173. depends on HAVE_RETHOOK
  174. depends on KRETPROBES
  175. select RETHOOK
  176. config USER_RETURN_NOTIFIER
  177. bool
  178. depends on HAVE_USER_RETURN_NOTIFIER
  179. help
  180. Provide a kernel-internal notification when a cpu is about to
  181. switch to user mode.
  182. config HAVE_IOREMAP_PROT
  183. bool
  184. config HAVE_KPROBES
  185. bool
  186. config HAVE_KRETPROBES
  187. bool
  188. config HAVE_OPTPROBES
  189. bool
  190. config HAVE_KPROBES_ON_FTRACE
  191. bool
  192. config ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
  193. bool
  194. help
  195. Since kretprobes modifies return address on the stack, the
  196. stacktrace may see the kretprobe trampoline address instead
  197. of correct one. If the architecture stacktrace code and
  198. unwinder can adjust such entries, select this configuration.
  199. config HAVE_FUNCTION_ERROR_INJECTION
  200. bool
  201. config HAVE_NMI
  202. bool
  203. config HAVE_FUNCTION_DESCRIPTORS
  204. bool
  205. config TRACE_IRQFLAGS_SUPPORT
  206. bool
  207. config TRACE_IRQFLAGS_NMI_SUPPORT
  208. bool
  209. #
  210. # An arch should select this if it provides all these things:
  211. #
  212. # task_pt_regs() in asm/processor.h or asm/ptrace.h
  213. # arch_has_single_step() if there is hardware single-step support
  214. # arch_has_block_step() if there is hardware block-step support
  215. # asm/syscall.h supplying asm-generic/syscall.h interface
  216. # linux/regset.h user_regset interfaces
  217. # CORE_DUMP_USE_REGSET #define'd in linux/elf.h
  218. # TIF_SYSCALL_TRACE calls ptrace_report_syscall_{entry,exit}
  219. # TIF_NOTIFY_RESUME calls resume_user_mode_work()
  220. #
  221. config HAVE_ARCH_TRACEHOOK
  222. bool
  223. config HAVE_DMA_CONTIGUOUS
  224. bool
  225. config GENERIC_SMP_IDLE_THREAD
  226. bool
  227. config GENERIC_IDLE_POLL_SETUP
  228. bool
  229. config ARCH_HAS_FORTIFY_SOURCE
  230. bool
  231. help
  232. An architecture should select this when it can successfully
  233. build and run with CONFIG_FORTIFY_SOURCE.
  234. #
  235. # Select if the arch provides a historic keepinit alias for the retain_initrd
  236. # command line option
  237. #
  238. config ARCH_HAS_KEEPINITRD
  239. bool
  240. # Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
  241. config ARCH_HAS_SET_MEMORY
  242. bool
  243. # Select if arch has all set_direct_map_invalid/default() functions
  244. config ARCH_HAS_SET_DIRECT_MAP
  245. bool
  246. #
  247. # Select if the architecture provides the arch_dma_set_uncached symbol to
  248. # either provide an uncached segment alias for a DMA allocation, or
  249. # to remap the page tables in place.
  250. #
  251. config ARCH_HAS_DMA_SET_UNCACHED
  252. bool
  253. #
  254. # Select if the architectures provides the arch_dma_clear_uncached symbol
  255. # to undo an in-place page table remap for uncached access.
  256. #
  257. config ARCH_HAS_DMA_CLEAR_UNCACHED
  258. bool
  259. config ARCH_HAS_CPU_FINALIZE_INIT
  260. bool
  261. # The architecture has a per-task state that includes the mm's PASID
  262. config ARCH_HAS_CPU_PASID
  263. bool
  264. select IOMMU_MM_DATA
  265. config HAVE_ARCH_THREAD_STRUCT_WHITELIST
  266. bool
  267. help
  268. An architecture should select this to provide hardened usercopy
  269. knowledge about what region of the thread_struct should be
  270. whitelisted for copying to userspace. Normally this is only the
  271. FPU registers. Specifically, arch_thread_struct_whitelist()
  272. should be implemented. Without this, the entire thread_struct
  273. field in task_struct will be left whitelisted.
  274. # Select if arch wants to size task_struct dynamically via arch_task_struct_size:
  275. config ARCH_WANTS_DYNAMIC_TASK_STRUCT
  276. bool
  277. config ARCH_WANTS_NO_INSTR
  278. bool
  279. help
  280. An architecture should select this if the noinstr macro is being used on
  281. functions to denote that the toolchain should avoid instrumenting such
  282. functions and is required for correctness.
  283. config ARCH_32BIT_OFF_T
  284. bool
  285. depends on !64BIT
  286. help
  287. All new 32-bit architectures should have 64-bit off_t type on
  288. userspace side which corresponds to the loff_t kernel type. This
  289. is the requirement for modern ABIs. Some existing architectures
  290. still support 32-bit off_t. This option is enabled for all such
  291. architectures explicitly.
  292. # Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
  293. config ARCH_32BIT_USTAT_F_TINODE
  294. bool
  295. config HAVE_ASM_MODVERSIONS
  296. bool
  297. help
  298. This symbol should be selected by an architecture if it provides
  299. <asm/asm-prototypes.h> to support the module versioning for symbols
  300. exported from assembly code.
  301. config HAVE_REGS_AND_STACK_ACCESS_API
  302. bool
  303. help
  304. This symbol should be selected by an architecture if it supports
  305. the API needed to access registers and stack entries from pt_regs,
  306. declared in asm/ptrace.h
  307. For example the kprobes-based event tracer needs this API.
  308. config HAVE_RSEQ
  309. bool
  310. depends on HAVE_REGS_AND_STACK_ACCESS_API
  311. help
  312. This symbol should be selected by an architecture if it
  313. supports an implementation of restartable sequences.
  314. config HAVE_RUST
  315. bool
  316. help
  317. This symbol should be selected by an architecture if it
  318. supports Rust.
  319. config HAVE_FUNCTION_ARG_ACCESS_API
  320. bool
  321. help
  322. This symbol should be selected by an architecture if it supports
  323. the API needed to access function arguments from pt_regs,
  324. declared in asm/ptrace.h
  325. config HAVE_HW_BREAKPOINT
  326. bool
  327. depends on PERF_EVENTS
  328. config HAVE_MIXED_BREAKPOINTS_REGS
  329. bool
  330. depends on HAVE_HW_BREAKPOINT
  331. help
  332. Depending on the arch implementation of hardware breakpoints,
  333. some of them have separate registers for data and instruction
  334. breakpoints addresses, others have mixed registers to store
  335. them but define the access type in a control register.
  336. Select this option if your arch implements breakpoints under the
  337. latter fashion.
  338. config HAVE_USER_RETURN_NOTIFIER
  339. bool
  340. config HAVE_PERF_EVENTS_NMI
  341. bool
  342. help
  343. System hardware can generate an NMI using the perf event
  344. subsystem. Also has support for calculating CPU cycle events
  345. to determine how many clock cycles in a given period.
  346. config HAVE_HARDLOCKUP_DETECTOR_PERF
  347. bool
  348. depends on HAVE_PERF_EVENTS_NMI
  349. help
  350. The arch chooses to use the generic perf-NMI-based hardlockup
  351. detector. Must define HAVE_PERF_EVENTS_NMI.
  352. config HAVE_HARDLOCKUP_DETECTOR_ARCH
  353. bool
  354. help
  355. The arch provides its own hardlockup detector implementation instead
  356. of the generic ones.
  357. It uses the same command line parameters, and sysctl interface,
  358. as the generic hardlockup detectors.
  359. config HAVE_PERF_REGS
  360. bool
  361. help
  362. Support selective register dumps for perf events. This includes
  363. bit-mapping of each registers and a unique architecture id.
  364. config HAVE_PERF_USER_STACK_DUMP
  365. bool
  366. help
  367. Support user stack dumps for perf event samples. This needs
  368. access to the user stack pointer which is not unified across
  369. architectures.
  370. config HAVE_ARCH_JUMP_LABEL
  371. bool
  372. config HAVE_ARCH_JUMP_LABEL_RELATIVE
  373. bool
  374. config MMU_GATHER_TABLE_FREE
  375. bool
  376. config MMU_GATHER_RCU_TABLE_FREE
  377. bool
  378. select MMU_GATHER_TABLE_FREE
  379. config MMU_GATHER_PAGE_SIZE
  380. bool
  381. config MMU_GATHER_NO_RANGE
  382. bool
  383. select MMU_GATHER_MERGE_VMAS
  384. config MMU_GATHER_NO_FLUSH_CACHE
  385. bool
  386. config MMU_GATHER_MERGE_VMAS
  387. bool
  388. config MMU_GATHER_NO_GATHER
  389. bool
  390. depends on MMU_GATHER_TABLE_FREE
  391. config ARCH_WANT_IRQS_OFF_ACTIVATE_MM
  392. bool
  393. help
  394. Temporary select until all architectures can be converted to have
  395. irqs disabled over activate_mm. Architectures that do IPI based TLB
  396. shootdowns should enable this.
  397. # Use normal mm refcounting for MMU_LAZY_TLB kernel thread references.
  398. # MMU_LAZY_TLB_REFCOUNT=n can improve the scalability of context switching
  399. # to/from kernel threads when the same mm is running on a lot of CPUs (a large
  400. # multi-threaded application), by reducing contention on the mm refcount.
  401. #
  402. # This can be disabled if the architecture ensures no CPUs are using an mm as a
  403. # "lazy tlb" beyond its final refcount (i.e., by the time __mmdrop frees the mm
  404. # or its kernel page tables). This could be arranged by arch_exit_mmap(), or
  405. # final exit(2) TLB flush, for example.
  406. #
  407. # To implement this, an arch *must*:
  408. # Ensure the _lazy_tlb variants of mmgrab/mmdrop are used when manipulating
  409. # the lazy tlb reference of a kthread's ->active_mm (non-arch code has been
  410. # converted already).
  411. config MMU_LAZY_TLB_REFCOUNT
  412. def_bool y
  413. depends on !MMU_LAZY_TLB_SHOOTDOWN
  414. # This option allows MMU_LAZY_TLB_REFCOUNT=n. It ensures no CPUs are using an
  415. # mm as a lazy tlb beyond its last reference count, by shooting down these
  416. # users before the mm is deallocated. __mmdrop() first IPIs all CPUs that may
  417. # be using the mm as a lazy tlb, so that they may switch themselves to using
  418. # init_mm for their active mm. mm_cpumask(mm) is used to determine which CPUs
  419. # may be using mm as a lazy tlb mm.
  420. #
  421. # To implement this, an arch *must*:
  422. # - At the time of the final mmdrop of the mm, ensure mm_cpumask(mm) contains
  423. # at least all possible CPUs in which the mm is lazy.
  424. # - It must meet the requirements for MMU_LAZY_TLB_REFCOUNT=n (see above).
  425. config MMU_LAZY_TLB_SHOOTDOWN
  426. bool
  427. config ARCH_HAVE_NMI_SAFE_CMPXCHG
  428. bool
  429. config ARCH_HAVE_EXTRA_ELF_NOTES
  430. bool
  431. help
  432. An architecture should select this in order to enable adding an
  433. arch-specific ELF note section to core files. It must provide two
  434. functions: elf_coredump_extra_notes_size() and
  435. elf_coredump_extra_notes_write() which are invoked by the ELF core
  436. dumper.
  437. config ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
  438. bool
  439. config HAVE_ALIGNED_STRUCT_PAGE
  440. bool
  441. help
  442. This makes sure that struct pages are double word aligned and that
  443. e.g. the SLUB allocator can perform double word atomic operations
  444. on a struct page for better performance. However selecting this
  445. might increase the size of a struct page by a word.
  446. config HAVE_CMPXCHG_LOCAL
  447. bool
  448. config HAVE_CMPXCHG_DOUBLE
  449. bool
  450. config ARCH_WEAK_RELEASE_ACQUIRE
  451. bool
  452. config ARCH_WANT_IPC_PARSE_VERSION
  453. bool
  454. config ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  455. bool
  456. config ARCH_WANT_OLD_COMPAT_IPC
  457. select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  458. bool
  459. config HAVE_ARCH_SECCOMP
  460. bool
  461. help
  462. An arch should select this symbol to support seccomp mode 1 (the fixed
  463. syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
  464. and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
  465. - __NR_seccomp_read_32
  466. - __NR_seccomp_write_32
  467. - __NR_seccomp_exit_32
  468. - __NR_seccomp_sigreturn_32
  469. config HAVE_ARCH_SECCOMP_FILTER
  470. bool
  471. select HAVE_ARCH_SECCOMP
  472. help
  473. An arch should select this symbol if it provides all of these things:
  474. - all the requirements for HAVE_ARCH_SECCOMP
  475. - syscall_get_arch()
  476. - syscall_get_arguments()
  477. - syscall_rollback()
  478. - syscall_set_return_value()
  479. - SIGSYS siginfo_t support
  480. - secure_computing is called from a ptrace_event()-safe context
  481. - secure_computing return value is checked and a return value of -1
  482. results in the system call being skipped immediately.
  483. - seccomp syscall wired up
  484. - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
  485. SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
  486. COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
  487. config SECCOMP
  488. prompt "Enable seccomp to safely execute untrusted bytecode"
  489. def_bool y
  490. depends on HAVE_ARCH_SECCOMP
  491. help
  492. This kernel feature is useful for number crunching applications
  493. that may need to handle untrusted bytecode during their
  494. execution. By using pipes or other transports made available
  495. to the process as file descriptors supporting the read/write
  496. syscalls, it's possible to isolate those applications in their
  497. own address space using seccomp. Once seccomp is enabled via
  498. prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
  499. disabled and the task is only allowed to execute a few safe
  500. syscalls defined by each seccomp mode.
  501. If unsure, say Y.
  502. config SECCOMP_FILTER
  503. def_bool y
  504. depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
  505. help
  506. Enable tasks to build secure computing environments defined
  507. in terms of Berkeley Packet Filter programs which implement
  508. task-defined system call filtering polices.
  509. See Documentation/userspace-api/seccomp_filter.rst for details.
  510. config SECCOMP_CACHE_DEBUG
  511. bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
  512. depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
  513. depends on PROC_FS
  514. help
  515. This enables the /proc/pid/seccomp_cache interface to monitor
  516. seccomp cache data. The file format is subject to change. Reading
  517. the file requires CAP_SYS_ADMIN.
  518. This option is for debugging only. Enabling presents the risk that
  519. an adversary may be able to infer the seccomp filter logic.
  520. If unsure, say N.
  521. config HAVE_ARCH_STACKLEAK
  522. bool
  523. help
  524. An architecture should select this if it has the code which
  525. fills the used part of the kernel stack with the STACKLEAK_POISON
  526. value before returning from system calls.
  527. config HAVE_STACKPROTECTOR
  528. bool
  529. help
  530. An arch should select this symbol if:
  531. - it has implemented a stack canary (e.g. __stack_chk_guard)
  532. config STACKPROTECTOR
  533. bool "Stack Protector buffer overflow detection"
  534. depends on HAVE_STACKPROTECTOR
  535. depends on $(cc-option,-fstack-protector)
  536. default y
  537. help
  538. This option turns on the "stack-protector" GCC feature. This
  539. feature puts, at the beginning of functions, a canary value on
  540. the stack just before the return address, and validates
  541. the value just before actually returning. Stack based buffer
  542. overflows (that need to overwrite this return address) now also
  543. overwrite the canary, which gets detected and the attack is then
  544. neutralized via a kernel panic.
  545. Functions will have the stack-protector canary logic added if they
  546. have an 8-byte or larger character array on the stack.
  547. This feature requires gcc version 4.2 or above, or a distribution
  548. gcc with the feature backported ("-fstack-protector").
  549. On an x86 "defconfig" build, this feature adds canary checks to
  550. about 3% of all kernel functions, which increases kernel code size
  551. by about 0.3%.
  552. config STACKPROTECTOR_STRONG
  553. bool "Strong Stack Protector"
  554. depends on STACKPROTECTOR
  555. depends on $(cc-option,-fstack-protector-strong)
  556. default y
  557. help
  558. Functions will have the stack-protector canary logic added in any
  559. of the following conditions:
  560. - local variable's address used as part of the right hand side of an
  561. assignment or function argument
  562. - local variable is an array (or union containing an array),
  563. regardless of array type or length
  564. - uses register local variables
  565. This feature requires gcc version 4.9 or above, or a distribution
  566. gcc with the feature backported ("-fstack-protector-strong").
  567. On an x86 "defconfig" build, this feature adds canary checks to
  568. about 20% of all kernel functions, which increases the kernel code
  569. size by about 2%.
  570. config ARCH_SUPPORTS_SHADOW_CALL_STACK
  571. bool
  572. help
  573. An architecture should select this if it supports the compiler's
  574. Shadow Call Stack and implements runtime support for shadow stack
  575. switching.
  576. config SHADOW_CALL_STACK
  577. bool "Shadow Call Stack"
  578. depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
  579. depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
  580. depends on MMU
  581. help
  582. This option enables the compiler's Shadow Call Stack, which
  583. uses a shadow stack to protect function return addresses from
  584. being overwritten by an attacker. More information can be found
  585. in the compiler's documentation:
  586. - Clang: https://clang.llvm.org/docs/ShadowCallStack.html
  587. - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
  588. Note that security guarantees in the kernel differ from the
  589. ones documented for user space. The kernel must store addresses
  590. of shadow stacks in memory, which means an attacker capable of
  591. reading and writing arbitrary memory may be able to locate them
  592. and hijack control flow by modifying the stacks.
  593. config DYNAMIC_SCS
  594. bool
  595. help
  596. Set by the arch code if it relies on code patching to insert the
  597. shadow call stack push and pop instructions rather than on the
  598. compiler.
  599. config LTO
  600. bool
  601. help
  602. Selected if the kernel will be built using the compiler's LTO feature.
  603. config LTO_CLANG
  604. bool
  605. select LTO
  606. help
  607. Selected if the kernel will be built using Clang's LTO feature.
  608. config ARCH_SUPPORTS_LTO_CLANG
  609. bool
  610. help
  611. An architecture should select this option if it supports:
  612. - compiling with Clang,
  613. - compiling inline assembly with Clang's integrated assembler,
  614. - and linking with LLD.
  615. config ARCH_SUPPORTS_LTO_CLANG_THIN
  616. bool
  617. help
  618. An architecture should select this option if it can support Clang's
  619. ThinLTO mode.
  620. config HAS_LTO_CLANG
  621. def_bool y
  622. depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
  623. depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
  624. depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
  625. depends on ARCH_SUPPORTS_LTO_CLANG
  626. depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
  627. # https://github.com/ClangBuiltLinux/linux/issues/1721
  628. depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
  629. depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
  630. depends on !GCOV_KERNEL
  631. help
  632. The compiler and Kconfig options support building with Clang's
  633. LTO.
  634. choice
  635. prompt "Link Time Optimization (LTO)"
  636. default LTO_NONE
  637. help
  638. This option enables Link Time Optimization (LTO), which allows the
  639. compiler to optimize binaries globally.
  640. If unsure, select LTO_NONE. Note that LTO is very resource-intensive
  641. so it's disabled by default.
  642. config LTO_NONE
  643. bool "None"
  644. help
  645. Build the kernel normally, without Link Time Optimization (LTO).
  646. config LTO_CLANG_FULL
  647. bool "Clang Full LTO (EXPERIMENTAL)"
  648. depends on HAS_LTO_CLANG
  649. depends on !COMPILE_TEST
  650. select LTO_CLANG
  651. help
  652. This option enables Clang's full Link Time Optimization (LTO), which
  653. allows the compiler to optimize the kernel globally. If you enable
  654. this option, the compiler generates LLVM bitcode instead of ELF
  655. object files, and the actual compilation from bitcode happens at
  656. the LTO link step, which may take several minutes depending on the
  657. kernel configuration. More information can be found from LLVM's
  658. documentation:
  659. https://llvm.org/docs/LinkTimeOptimization.html
  660. During link time, this option can use a large amount of RAM, and
  661. may take much longer than the ThinLTO option.
  662. config LTO_CLANG_THIN
  663. bool "Clang ThinLTO (EXPERIMENTAL)"
  664. depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
  665. select LTO_CLANG
  666. help
  667. This option enables Clang's ThinLTO, which allows for parallel
  668. optimization and faster incremental compiles compared to the
  669. CONFIG_LTO_CLANG_FULL option. More information can be found
  670. from Clang's documentation:
  671. https://clang.llvm.org/docs/ThinLTO.html
  672. If unsure, say Y.
  673. endchoice
  674. config ARCH_SUPPORTS_CFI_CLANG
  675. bool
  676. help
  677. An architecture should select this option if it can support Clang's
  678. Control-Flow Integrity (CFI) checking.
  679. config ARCH_USES_CFI_TRAPS
  680. bool
  681. config CFI_CLANG
  682. bool "Use Clang's Control Flow Integrity (CFI)"
  683. depends on ARCH_SUPPORTS_CFI_CLANG
  684. depends on $(cc-option,-fsanitize=kcfi)
  685. help
  686. This option enables Clang's forward-edge Control Flow Integrity
  687. (CFI) checking, where the compiler injects a runtime check to each
  688. indirect function call to ensure the target is a valid function with
  689. the correct static type. This restricts possible call targets and
  690. makes it more difficult for an attacker to exploit bugs that allow
  691. the modification of stored function pointers. More information can be
  692. found from Clang's documentation:
  693. https://clang.llvm.org/docs/ControlFlowIntegrity.html
  694. config CFI_ICALL_NORMALIZE_INTEGERS
  695. bool "Normalize CFI tags for integers"
  696. depends on CFI_CLANG
  697. depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
  698. help
  699. This option normalizes the CFI tags for integer types so that all
  700. integer types of the same size and signedness receive the same CFI
  701. tag.
  702. The option is separate from CONFIG_RUST because it affects the ABI.
  703. When working with build systems that care about the ABI, it is
  704. convenient to be able to turn on this flag first, before Rust is
  705. turned on.
  706. This option is necessary for using CFI with Rust. If unsure, say N.
  707. config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
  708. def_bool y
  709. depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
  710. # With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
  711. depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
  712. config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
  713. def_bool y
  714. depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
  715. depends on RUSTC_VERSION >= 107900
  716. # With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
  717. depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \
  718. (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
  719. config CFI_PERMISSIVE
  720. bool "Use CFI in permissive mode"
  721. depends on CFI_CLANG
  722. help
  723. When selected, Control Flow Integrity (CFI) violations result in a
  724. warning instead of a kernel panic. This option should only be used
  725. for finding indirect call type mismatches during development.
  726. If unsure, say N.
  727. config HAVE_ARCH_WITHIN_STACK_FRAMES
  728. bool
  729. help
  730. An architecture should select this if it can walk the kernel stack
  731. frames to determine if an object is part of either the arguments
  732. or local variables (i.e. that it excludes saved return addresses,
  733. and similar) by implementing an inline arch_within_stack_frames(),
  734. which is used by CONFIG_HARDENED_USERCOPY.
  735. config HAVE_CONTEXT_TRACKING_USER
  736. bool
  737. help
  738. Provide kernel/user boundaries probes necessary for subsystems
  739. that need it, such as userspace RCU extended quiescent state.
  740. Syscalls need to be wrapped inside user_exit()-user_enter(), either
  741. optimized behind static key or through the slow path using TIF_NOHZ
  742. flag. Exceptions handlers must be wrapped as well. Irqs are already
  743. protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
  744. handling on irq exit still need to be protected.
  745. config HAVE_CONTEXT_TRACKING_USER_OFFSTACK
  746. bool
  747. help
  748. Architecture neither relies on exception_enter()/exception_exit()
  749. nor on schedule_user(). Also preempt_schedule_notrace() and
  750. preempt_schedule_irq() can't be called in a preemptible section
  751. while context tracking is CT_STATE_USER. This feature reflects a sane
  752. entry implementation where the following requirements are met on
  753. critical entry code, ie: before user_exit() or after user_enter():
  754. - Critical entry code isn't preemptible (or better yet:
  755. not interruptible).
  756. - No use of RCU read side critical sections, unless ct_nmi_enter()
  757. got called.
  758. - No use of instrumentation, unless instrumentation_begin() got
  759. called.
  760. config HAVE_TIF_NOHZ
  761. bool
  762. help
  763. Arch relies on TIF_NOHZ and syscall slow path to implement context
  764. tracking calls to user_enter()/user_exit().
  765. config HAVE_VIRT_CPU_ACCOUNTING
  766. bool
  767. config HAVE_VIRT_CPU_ACCOUNTING_IDLE
  768. bool
  769. help
  770. Architecture has its own way to account idle CPU time and therefore
  771. doesn't implement vtime_account_idle().
  772. config ARCH_HAS_SCALED_CPUTIME
  773. bool
  774. config HAVE_VIRT_CPU_ACCOUNTING_GEN
  775. bool
  776. default y if 64BIT
  777. help
  778. With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
  779. Before enabling this option, arch code must be audited
  780. to ensure there are no races in concurrent read/write of
  781. cputime_t. For example, reading/writing 64-bit cputime_t on
  782. some 32-bit arches may require multiple accesses, so proper
  783. locking is needed to protect against concurrent accesses.
  784. config HAVE_IRQ_TIME_ACCOUNTING
  785. bool
  786. help
  787. Archs need to ensure they use a high enough resolution clock to
  788. support irq time accounting and then call enable_sched_clock_irqtime().
  789. config HAVE_MOVE_PUD
  790. bool
  791. help
  792. Architectures that select this are able to move page tables at the
  793. PUD level. If there are only 3 page table levels, the move effectively
  794. happens at the PGD level.
  795. config HAVE_MOVE_PMD
  796. bool
  797. help
  798. Archs that select this are able to move page tables at the PMD level.
  799. config HAVE_ARCH_TRANSPARENT_HUGEPAGE
  800. bool
  801. config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
  802. bool
  803. config HAVE_ARCH_HUGE_VMAP
  804. bool
  805. #
  806. # Archs that select this would be capable of PMD-sized vmaps (i.e.,
  807. # arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
  808. # must be used to enable allocations to use hugepages.
  809. #
  810. config HAVE_ARCH_HUGE_VMALLOC
  811. depends on HAVE_ARCH_HUGE_VMAP
  812. bool
  813. config ARCH_WANT_HUGE_PMD_SHARE
  814. bool
  815. # Archs that want to use pmd_mkwrite on kernel memory need it defined even
  816. # if there are no userspace memory management features that use it
  817. config ARCH_WANT_KERNEL_PMD_MKWRITE
  818. bool
  819. config ARCH_WANT_PMD_MKWRITE
  820. def_bool TRANSPARENT_HUGEPAGE || ARCH_WANT_KERNEL_PMD_MKWRITE
  821. config HAVE_ARCH_SOFT_DIRTY
  822. bool
  823. config HAVE_MOD_ARCH_SPECIFIC
  824. bool
  825. help
  826. The arch uses struct mod_arch_specific to store data. Many arches
  827. just need a simple module loader without arch specific data - those
  828. should not enable this.
  829. config MODULES_USE_ELF_RELA
  830. bool
  831. help
  832. Modules only use ELF RELA relocations. Modules with ELF REL
  833. relocations will give an error.
  834. config MODULES_USE_ELF_REL
  835. bool
  836. help
  837. Modules only use ELF REL relocations. Modules with ELF RELA
  838. relocations will give an error.
  839. config ARCH_WANTS_MODULES_DATA_IN_VMALLOC
  840. bool
  841. help
  842. For architectures like powerpc/32 which have constraints on module
  843. allocation and need to allocate module data outside of module area.
  844. config ARCH_WANTS_EXECMEM_LATE
  845. bool
  846. help
  847. For architectures that do not allocate executable memory early on
  848. boot, but rather require its initialization late when there is
  849. enough entropy for module space randomization, for instance
  850. arm64.
  851. config HAVE_IRQ_EXIT_ON_IRQ_STACK
  852. bool
  853. help
  854. Architecture doesn't only execute the irq handler on the irq stack
  855. but also irq_exit(). This way we can process softirqs on this irq
  856. stack instead of switching to a new one when we call __do_softirq()
  857. in the end of an hardirq.
  858. This spares a stack switch and improves cache usage on softirq
  859. processing.
  860. config HAVE_SOFTIRQ_ON_OWN_STACK
  861. bool
  862. help
  863. Architecture provides a function to run __do_softirq() on a
  864. separate stack.
  865. config SOFTIRQ_ON_OWN_STACK
  866. def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
  867. config ALTERNATE_USER_ADDRESS_SPACE
  868. bool
  869. help
  870. Architectures set this when the CPU uses separate address
  871. spaces for kernel and user space pointers. In this case, the
  872. access_ok() check on a __user pointer is skipped.
  873. config PGTABLE_LEVELS
  874. int
  875. default 2
  876. config ARCH_HAS_ELF_RANDOMIZE
  877. bool
  878. help
  879. An architecture supports choosing randomized locations for
  880. stack, mmap, brk, and ET_DYN. Defined functions:
  881. - arch_mmap_rnd()
  882. - arch_randomize_brk()
  883. config HAVE_ARCH_MMAP_RND_BITS
  884. bool
  885. help
  886. An arch should select this symbol if it supports setting a variable
  887. number of bits for use in establishing the base address for mmap
  888. allocations, has MMU enabled and provides values for both:
  889. - ARCH_MMAP_RND_BITS_MIN
  890. - ARCH_MMAP_RND_BITS_MAX
  891. config HAVE_EXIT_THREAD
  892. bool
  893. help
  894. An architecture implements exit_thread.
  895. config ARCH_MMAP_RND_BITS_MIN
  896. int
  897. config ARCH_MMAP_RND_BITS_MAX
  898. int
  899. config ARCH_MMAP_RND_BITS_DEFAULT
  900. int
  901. config ARCH_MMAP_RND_BITS
  902. int "Number of bits to use for ASLR of mmap base address" if EXPERT
  903. range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
  904. default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
  905. default ARCH_MMAP_RND_BITS_MIN
  906. depends on HAVE_ARCH_MMAP_RND_BITS
  907. help
  908. This value can be used to select the number of bits to use to
  909. determine the random offset to the base address of vma regions
  910. resulting from mmap allocations. This value will be bounded
  911. by the architecture's minimum and maximum supported values.
  912. This value can be changed after boot using the
  913. /proc/sys/vm/mmap_rnd_bits tunable
  914. config HAVE_ARCH_MMAP_RND_COMPAT_BITS
  915. bool
  916. help
  917. An arch should select this symbol if it supports running applications
  918. in compatibility mode, supports setting a variable number of bits for
  919. use in establishing the base address for mmap allocations, has MMU
  920. enabled and provides values for both:
  921. - ARCH_MMAP_RND_COMPAT_BITS_MIN
  922. - ARCH_MMAP_RND_COMPAT_BITS_MAX
  923. config ARCH_MMAP_RND_COMPAT_BITS_MIN
  924. int
  925. config ARCH_MMAP_RND_COMPAT_BITS_MAX
  926. int
  927. config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  928. int
  929. config ARCH_MMAP_RND_COMPAT_BITS
  930. int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
  931. range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
  932. default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  933. default ARCH_MMAP_RND_COMPAT_BITS_MIN
  934. depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
  935. help
  936. This value can be used to select the number of bits to use to
  937. determine the random offset to the base address of vma regions
  938. resulting from mmap allocations for compatible applications This
  939. value will be bounded by the architecture's minimum and maximum
  940. supported values.
  941. This value can be changed after boot using the
  942. /proc/sys/vm/mmap_rnd_compat_bits tunable
  943. config HAVE_ARCH_COMPAT_MMAP_BASES
  944. bool
  945. help
  946. This allows 64bit applications to invoke 32-bit mmap() syscall
  947. and vice-versa 32-bit applications to call 64-bit mmap().
  948. Required for applications doing different bitness syscalls.
  949. config HAVE_PAGE_SIZE_4KB
  950. bool
  951. config HAVE_PAGE_SIZE_8KB
  952. bool
  953. config HAVE_PAGE_SIZE_16KB
  954. bool
  955. config HAVE_PAGE_SIZE_32KB
  956. bool
  957. config HAVE_PAGE_SIZE_64KB
  958. bool
  959. config HAVE_PAGE_SIZE_256KB
  960. bool
  961. choice
  962. prompt "MMU page size"
  963. config PAGE_SIZE_4KB
  964. bool "4KiB pages"
  965. depends on HAVE_PAGE_SIZE_4KB
  966. help
  967. This option select the standard 4KiB Linux page size and the only
  968. available option on many architectures. Using 4KiB page size will
  969. minimize memory consumption and is therefore recommended for low
  970. memory systems.
  971. Some software that is written for x86 systems makes incorrect
  972. assumptions about the page size and only runs on 4KiB pages.
  973. config PAGE_SIZE_8KB
  974. bool "8KiB pages"
  975. depends on HAVE_PAGE_SIZE_8KB
  976. help
  977. This option is the only supported page size on a few older
  978. processors, and can be slightly faster than 4KiB pages.
  979. config PAGE_SIZE_16KB
  980. bool "16KiB pages"
  981. depends on HAVE_PAGE_SIZE_16KB
  982. help
  983. This option is usually a good compromise between memory
  984. consumption and performance for typical desktop and server
  985. workloads, often saving a level of page table lookups compared
  986. to 4KB pages as well as reducing TLB pressure and overhead of
  987. per-page operations in the kernel at the expense of a larger
  988. page cache.
  989. config PAGE_SIZE_32KB
  990. bool "32KiB pages"
  991. depends on HAVE_PAGE_SIZE_32KB
  992. help
  993. Using 32KiB page size will result in slightly higher performance
  994. kernel at the price of higher memory consumption compared to
  995. 16KiB pages. This option is available only on cnMIPS cores.
  996. Note that you will need a suitable Linux distribution to
  997. support this.
  998. config PAGE_SIZE_64KB
  999. bool "64KiB pages"
  1000. depends on HAVE_PAGE_SIZE_64KB
  1001. help
  1002. Using 64KiB page size will result in slightly higher performance
  1003. kernel at the price of much higher memory consumption compared to
  1004. 4KiB or 16KiB pages.
  1005. This is not suitable for general-purpose workloads but the
  1006. better performance may be worth the cost for certain types of
  1007. supercomputing or database applications that work mostly with
  1008. large in-memory data rather than small files.
  1009. config PAGE_SIZE_256KB
  1010. bool "256KiB pages"
  1011. depends on HAVE_PAGE_SIZE_256KB
  1012. help
  1013. 256KiB pages have little practical value due to their extreme
  1014. memory usage. The kernel will only be able to run applications
  1015. that have been compiled with '-zmax-page-size' set to 256KiB
  1016. (the default is 64KiB or 4KiB on most architectures).
  1017. endchoice
  1018. config PAGE_SIZE_LESS_THAN_64KB
  1019. def_bool y
  1020. depends on !PAGE_SIZE_64KB
  1021. depends on PAGE_SIZE_LESS_THAN_256KB
  1022. config PAGE_SIZE_LESS_THAN_256KB
  1023. def_bool y
  1024. depends on !PAGE_SIZE_256KB
  1025. config PAGE_SHIFT
  1026. int
  1027. default 12 if PAGE_SIZE_4KB
  1028. default 13 if PAGE_SIZE_8KB
  1029. default 14 if PAGE_SIZE_16KB
  1030. default 15 if PAGE_SIZE_32KB
  1031. default 16 if PAGE_SIZE_64KB
  1032. default 18 if PAGE_SIZE_256KB
  1033. # This allows to use a set of generic functions to determine mmap base
  1034. # address by giving priority to top-down scheme only if the process
  1035. # is not in legacy mode (compat task, unlimited stack size or
  1036. # sysctl_legacy_va_layout).
  1037. # Architecture that selects this option can provide its own version of:
  1038. # - STACK_RND_MASK
  1039. config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
  1040. bool
  1041. depends on MMU
  1042. select ARCH_HAS_ELF_RANDOMIZE
  1043. config HAVE_OBJTOOL
  1044. bool
  1045. config HAVE_JUMP_LABEL_HACK
  1046. bool
  1047. config HAVE_NOINSTR_HACK
  1048. bool
  1049. config HAVE_NOINSTR_VALIDATION
  1050. bool
  1051. config HAVE_UACCESS_VALIDATION
  1052. bool
  1053. select OBJTOOL
  1054. config HAVE_STACK_VALIDATION
  1055. bool
  1056. help
  1057. Architecture supports objtool compile-time frame pointer rule
  1058. validation.
  1059. config HAVE_RELIABLE_STACKTRACE
  1060. bool
  1061. help
  1062. Architecture has either save_stack_trace_tsk_reliable() or
  1063. arch_stack_walk_reliable() function which only returns a stack trace
  1064. if it can guarantee the trace is reliable.
  1065. config HAVE_ARCH_HASH
  1066. bool
  1067. default n
  1068. help
  1069. If this is set, the architecture provides an <asm/hash.h>
  1070. file which provides platform-specific implementations of some
  1071. functions in <linux/hash.h> or fs/namei.c.
  1072. config HAVE_ARCH_NVRAM_OPS
  1073. bool
  1074. config ISA_BUS_API
  1075. def_bool ISA
  1076. #
  1077. # ABI hall of shame
  1078. #
  1079. config CLONE_BACKWARDS
  1080. bool
  1081. help
  1082. Architecture has tls passed as the 4th argument of clone(2),
  1083. not the 5th one.
  1084. config CLONE_BACKWARDS2
  1085. bool
  1086. help
  1087. Architecture has the first two arguments of clone(2) swapped.
  1088. config CLONE_BACKWARDS3
  1089. bool
  1090. help
  1091. Architecture has tls passed as the 3rd argument of clone(2),
  1092. not the 5th one.
  1093. config ODD_RT_SIGACTION
  1094. bool
  1095. help
  1096. Architecture has unusual rt_sigaction(2) arguments
  1097. config OLD_SIGSUSPEND
  1098. bool
  1099. help
  1100. Architecture has old sigsuspend(2) syscall, of one-argument variety
  1101. config OLD_SIGSUSPEND3
  1102. bool
  1103. help
  1104. Even weirder antique ABI - three-argument sigsuspend(2)
  1105. config OLD_SIGACTION
  1106. bool
  1107. help
  1108. Architecture has old sigaction(2) syscall. Nope, not the same
  1109. as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
  1110. but fairly different variant of sigaction(2), thanks to OSF/1
  1111. compatibility...
  1112. config COMPAT_OLD_SIGACTION
  1113. bool
  1114. config COMPAT_32BIT_TIME
  1115. bool "Provide system calls for 32-bit time_t"
  1116. default !64BIT || COMPAT
  1117. help
  1118. This enables 32 bit time_t support in addition to 64 bit time_t support.
  1119. This is relevant on all 32-bit architectures, and 64-bit architectures
  1120. as part of compat syscall handling.
  1121. config ARCH_NO_PREEMPT
  1122. bool
  1123. config ARCH_SUPPORTS_RT
  1124. bool
  1125. config CPU_NO_EFFICIENT_FFS
  1126. def_bool n
  1127. config HAVE_ARCH_VMAP_STACK
  1128. def_bool n
  1129. help
  1130. An arch should select this symbol if it can support kernel stacks
  1131. in vmalloc space. This means:
  1132. - vmalloc space must be large enough to hold many kernel stacks.
  1133. This may rule out many 32-bit architectures.
  1134. - Stacks in vmalloc space need to work reliably. For example, if
  1135. vmap page tables are created on demand, either this mechanism
  1136. needs to work while the stack points to a virtual address with
  1137. unpopulated page tables or arch code (switch_to() and switch_mm(),
  1138. most likely) needs to ensure that the stack's page table entries
  1139. are populated before running on a possibly unpopulated stack.
  1140. - If the stack overflows into a guard page, something reasonable
  1141. should happen. The definition of "reasonable" is flexible, but
  1142. instantly rebooting without logging anything would be unfriendly.
  1143. config VMAP_STACK
  1144. default y
  1145. bool "Use a virtually-mapped stack"
  1146. depends on HAVE_ARCH_VMAP_STACK
  1147. depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
  1148. help
  1149. Enable this if you want the use virtually-mapped kernel stacks
  1150. with guard pages. This causes kernel stack overflows to be
  1151. caught immediately rather than causing difficult-to-diagnose
  1152. corruption.
  1153. To use this with software KASAN modes, the architecture must support
  1154. backing virtual mappings with real shadow memory, and KASAN_VMALLOC
  1155. must be enabled.
  1156. config HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
  1157. def_bool n
  1158. help
  1159. An arch should select this symbol if it can support kernel stack
  1160. offset randomization with calls to add_random_kstack_offset()
  1161. during syscall entry and choose_random_kstack_offset() during
  1162. syscall exit. Careful removal of -fstack-protector-strong and
  1163. -fstack-protector should also be applied to the entry code and
  1164. closely examined, as the artificial stack bump looks like an array
  1165. to the compiler, so it will attempt to add canary checks regardless
  1166. of the static branch state.
  1167. config RANDOMIZE_KSTACK_OFFSET
  1168. bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
  1169. default y
  1170. depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
  1171. depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000
  1172. help
  1173. The kernel stack offset can be randomized (after pt_regs) by
  1174. roughly 5 bits of entropy, frustrating memory corruption
  1175. attacks that depend on stack address determinism or
  1176. cross-syscall address exposures.
  1177. The feature is controlled via the "randomize_kstack_offset=on/off"
  1178. kernel boot param, and if turned off has zero overhead due to its use
  1179. of static branches (see JUMP_LABEL).
  1180. If unsure, say Y.
  1181. config RANDOMIZE_KSTACK_OFFSET_DEFAULT
  1182. bool "Default state of kernel stack offset randomization"
  1183. depends on RANDOMIZE_KSTACK_OFFSET
  1184. help
  1185. Kernel stack offset randomization is controlled by kernel boot param
  1186. "randomize_kstack_offset=on/off", and this config chooses the default
  1187. boot state.
  1188. config ARCH_OPTIONAL_KERNEL_RWX
  1189. def_bool n
  1190. config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  1191. def_bool n
  1192. config ARCH_HAS_STRICT_KERNEL_RWX
  1193. def_bool n
  1194. config STRICT_KERNEL_RWX
  1195. bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
  1196. depends on ARCH_HAS_STRICT_KERNEL_RWX
  1197. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  1198. help
  1199. If this is set, kernel text and rodata memory will be made read-only,
  1200. and non-text memory will be made non-executable. This provides
  1201. protection against certain security exploits (e.g. executing the heap
  1202. or modifying text)
  1203. These features are considered standard security practice these days.
  1204. You should say Y here in almost all cases.
  1205. config ARCH_HAS_STRICT_MODULE_RWX
  1206. def_bool n
  1207. config STRICT_MODULE_RWX
  1208. bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
  1209. depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
  1210. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  1211. help
  1212. If this is set, module text and rodata memory will be made read-only,
  1213. and non-text memory will be made non-executable. This provides
  1214. protection against certain security exploits (e.g. writing to text)
  1215. # select if the architecture provides an asm/dma-direct.h header
  1216. config ARCH_HAS_PHYS_TO_DMA
  1217. bool
  1218. config HAVE_ARCH_COMPILER_H
  1219. bool
  1220. help
  1221. An architecture can select this if it provides an
  1222. asm/compiler.h header that should be included after
  1223. linux/compiler-*.h in order to override macro definitions that those
  1224. headers generally provide.
  1225. config HAVE_ARCH_PREL32_RELOCATIONS
  1226. bool
  1227. help
  1228. May be selected by an architecture if it supports place-relative
  1229. 32-bit relocations, both in the toolchain and in the module loader,
  1230. in which case relative references can be used in special sections
  1231. for PCI fixup, initcalls etc which are only half the size on 64 bit
  1232. architectures, and don't require runtime relocation on relocatable
  1233. kernels.
  1234. config ARCH_USE_MEMREMAP_PROT
  1235. bool
  1236. config LOCK_EVENT_COUNTS
  1237. bool "Locking event counts collection"
  1238. depends on DEBUG_FS
  1239. help
  1240. Enable light-weight counting of various locking related events
  1241. in the system with minimal performance impact. This reduces
  1242. the chance of application behavior change because of timing
  1243. differences. The counts are reported via debugfs.
  1244. # Select if the architecture has support for applying RELR relocations.
  1245. config ARCH_HAS_RELR
  1246. bool
  1247. config RELR
  1248. bool "Use RELR relocation packing"
  1249. depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
  1250. default y
  1251. help
  1252. Store the kernel's dynamic relocations in the RELR relocation packing
  1253. format. Requires a compatible linker (LLD supports this feature), as
  1254. well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
  1255. are compatible).
  1256. config ARCH_HAS_MEM_ENCRYPT
  1257. bool
  1258. config ARCH_HAS_CC_PLATFORM
  1259. bool
  1260. config HAVE_SPARSE_SYSCALL_NR
  1261. bool
  1262. help
  1263. An architecture should select this if its syscall numbering is sparse
  1264. to save space. For example, MIPS architecture has a syscall array with
  1265. entries at 4000, 5000 and 6000 locations. This option turns on syscall
  1266. related optimizations for a given architecture.
  1267. config ARCH_HAS_VDSO_DATA
  1268. bool
  1269. config HAVE_STATIC_CALL
  1270. bool
  1271. config HAVE_STATIC_CALL_INLINE
  1272. bool
  1273. depends on HAVE_STATIC_CALL
  1274. select OBJTOOL
  1275. config HAVE_PREEMPT_DYNAMIC
  1276. bool
  1277. config HAVE_PREEMPT_DYNAMIC_CALL
  1278. bool
  1279. depends on HAVE_STATIC_CALL
  1280. select HAVE_PREEMPT_DYNAMIC
  1281. help
  1282. An architecture should select this if it can handle the preemption
  1283. model being selected at boot time using static calls.
  1284. Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
  1285. preemption function will be patched directly.
  1286. Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
  1287. call to a preemption function will go through a trampoline, and the
  1288. trampoline will be patched.
  1289. It is strongly advised to support inline static call to avoid any
  1290. overhead.
  1291. config HAVE_PREEMPT_DYNAMIC_KEY
  1292. bool
  1293. depends on HAVE_ARCH_JUMP_LABEL
  1294. select HAVE_PREEMPT_DYNAMIC
  1295. help
  1296. An architecture should select this if it can handle the preemption
  1297. model being selected at boot time using static keys.
  1298. Each preemption function will be given an early return based on a
  1299. static key. This should have slightly lower overhead than non-inline
  1300. static calls, as this effectively inlines each trampoline into the
  1301. start of its callee. This may avoid redundant work, and may
  1302. integrate better with CFI schemes.
  1303. This will have greater overhead than using inline static calls as
  1304. the call to the preemption function cannot be entirely elided.
  1305. config ARCH_WANT_LD_ORPHAN_WARN
  1306. bool
  1307. help
  1308. An arch should select this symbol once all linker sections are explicitly
  1309. included, size-asserted, or discarded in the linker scripts. This is
  1310. important because we never want expected sections to be placed heuristically
  1311. by the linker, since the locations of such sections can change between linker
  1312. versions.
  1313. config HAVE_ARCH_PFN_VALID
  1314. bool
  1315. config ARCH_SUPPORTS_DEBUG_PAGEALLOC
  1316. bool
  1317. config ARCH_SUPPORTS_PAGE_TABLE_CHECK
  1318. bool
  1319. config ARCH_SPLIT_ARG64
  1320. bool
  1321. help
  1322. If a 32-bit architecture requires 64-bit arguments to be split into
  1323. pairs of 32-bit arguments, select this option.
  1324. config ARCH_HAS_ELFCORE_COMPAT
  1325. bool
  1326. config ARCH_HAS_PARANOID_L1D_FLUSH
  1327. bool
  1328. config ARCH_HAVE_TRACE_MMIO_ACCESS
  1329. bool
  1330. config DYNAMIC_SIGFRAME
  1331. bool
  1332. # Select, if arch has a named attribute group bound to NUMA device nodes.
  1333. config HAVE_ARCH_NODE_DEV_GROUP
  1334. bool
  1335. config ARCH_HAS_HW_PTE_YOUNG
  1336. bool
  1337. help
  1338. Architectures that select this option are capable of setting the
  1339. accessed bit in PTE entries when using them as part of linear address
  1340. translations. Architectures that require runtime check should select
  1341. this option and override arch_has_hw_pte_young().
  1342. config ARCH_HAS_NONLEAF_PMD_YOUNG
  1343. bool
  1344. help
  1345. Architectures that select this option are capable of setting the
  1346. accessed bit in non-leaf PMD entries when using them as part of linear
  1347. address translations. Page table walkers that clear the accessed bit
  1348. may use this capability to reduce their search space.
  1349. config ARCH_HAS_KERNEL_FPU_SUPPORT
  1350. bool
  1351. help
  1352. Architectures that select this option can run floating-point code in
  1353. the kernel, as described in Documentation/core-api/floating-point.rst.
  1354. source "kernel/gcov/Kconfig"
  1355. source "scripts/gcc-plugins/Kconfig"
  1356. config FUNCTION_ALIGNMENT_4B
  1357. bool
  1358. config FUNCTION_ALIGNMENT_8B
  1359. bool
  1360. config FUNCTION_ALIGNMENT_16B
  1361. bool
  1362. config FUNCTION_ALIGNMENT_32B
  1363. bool
  1364. config FUNCTION_ALIGNMENT_64B
  1365. bool
  1366. config FUNCTION_ALIGNMENT
  1367. int
  1368. default 64 if FUNCTION_ALIGNMENT_64B
  1369. default 32 if FUNCTION_ALIGNMENT_32B
  1370. default 16 if FUNCTION_ALIGNMENT_16B
  1371. default 8 if FUNCTION_ALIGNMENT_8B
  1372. default 4 if FUNCTION_ALIGNMENT_4B
  1373. default 0
  1374. config CC_HAS_MIN_FUNCTION_ALIGNMENT
  1375. # Detect availability of the GCC option -fmin-function-alignment which
  1376. # guarantees minimal alignment for all functions, unlike
  1377. # -falign-functions which the compiler ignores for cold functions.
  1378. def_bool $(cc-option, -fmin-function-alignment=8)
  1379. config CC_HAS_SANE_FUNCTION_ALIGNMENT
  1380. # Set if the guaranteed alignment with -fmin-function-alignment is
  1381. # available or extra care is required in the kernel. Clang provides
  1382. # strict alignment always, even with -falign-functions.
  1383. def_bool CC_HAS_MIN_FUNCTION_ALIGNMENT || CC_IS_CLANG
  1384. config ARCH_NEED_CMPXCHG_1_EMU
  1385. bool
  1386. endmenu