xref: /linux/arch/arm64/Kconfig (revision 145ff1ec090dce9beb5a9590b5dc288e7bb2e65d)
1# SPDX-License-Identifier: GPL-2.0-only
2config ARM64
3	def_bool y
4	select ACPI_CCA_REQUIRED if ACPI
5	select ACPI_GENERIC_GSI if ACPI
6	select ACPI_GTDT if ACPI
7	select ACPI_IORT if ACPI
8	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
9	select ACPI_MCFG if (ACPI && PCI)
10	select ACPI_SPCR_TABLE if ACPI
11	select ACPI_PPTT if ACPI
12	select ARCH_HAS_DEBUG_WX
13	select ARCH_BINFMT_ELF_STATE
14	select ARCH_HAS_DEBUG_VIRTUAL
15	select ARCH_HAS_DEBUG_VM_PGTABLE
16	select ARCH_HAS_DEVMEM_IS_ALLOWED
17	select ARCH_HAS_DMA_PREP_COHERENT
18	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
19	select ARCH_HAS_FAST_MULTIPLIER
20	select ARCH_HAS_FORTIFY_SOURCE
21	select ARCH_HAS_GCOV_PROFILE_ALL
22	select ARCH_HAS_GIGANTIC_PAGE
23	select ARCH_HAS_KCOV
24	select ARCH_HAS_KEEPINITRD
25	select ARCH_HAS_MEMBARRIER_SYNC_CORE
26	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
27	select ARCH_HAS_PTE_DEVMAP
28	select ARCH_HAS_PTE_SPECIAL
29	select ARCH_HAS_SETUP_DMA_OPS
30	select ARCH_HAS_SET_DIRECT_MAP
31	select ARCH_HAS_SET_MEMORY
32	select ARCH_HAS_STRICT_KERNEL_RWX
33	select ARCH_HAS_STRICT_MODULE_RWX
34	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
35	select ARCH_HAS_SYNC_DMA_FOR_CPU
36	select ARCH_HAS_SYSCALL_WRAPPER
37	select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT
38	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
39	select ARCH_HAVE_ELF_PROT
40	select ARCH_HAVE_NMI_SAFE_CMPXCHG
41	select ARCH_INLINE_READ_LOCK if !PREEMPTION
42	select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
43	select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPTION
44	select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPTION
45	select ARCH_INLINE_READ_UNLOCK if !PREEMPTION
46	select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPTION
47	select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPTION
48	select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPTION
49	select ARCH_INLINE_WRITE_LOCK if !PREEMPTION
50	select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPTION
51	select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPTION
52	select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPTION
53	select ARCH_INLINE_WRITE_UNLOCK if !PREEMPTION
54	select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPTION
55	select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPTION
56	select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPTION
57	select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPTION
58	select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPTION
59	select ARCH_INLINE_SPIN_LOCK if !PREEMPTION
60	select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPTION
61	select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPTION
62	select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPTION
63	select ARCH_INLINE_SPIN_UNLOCK if !PREEMPTION
64	select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
65	select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
66	select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
67	select ARCH_KEEP_MEMBLOCK
68	select ARCH_USE_CMPXCHG_LOCKREF
69	select ARCH_USE_GNU_PROPERTY
70	select ARCH_USE_QUEUED_RWLOCKS
71	select ARCH_USE_QUEUED_SPINLOCKS
72	select ARCH_USE_SYM_ANNOTATIONS
73	select ARCH_SUPPORTS_MEMORY_FAILURE
74	select ARCH_SUPPORTS_SHADOW_CALL_STACK if CC_HAVE_SHADOW_CALL_STACK
75	select ARCH_SUPPORTS_ATOMIC_RMW
76	select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && (GCC_VERSION >= 50000 || CC_IS_CLANG)
77	select ARCH_SUPPORTS_NUMA_BALANCING
78	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
79	select ARCH_WANT_DEFAULT_BPF_JIT
80	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
81	select ARCH_WANT_FRAME_POINTERS
82	select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
83	select ARCH_HAS_UBSAN_SANITIZE_ALL
84	select ARM_AMBA
85	select ARM_ARCH_TIMER
86	select ARM_GIC
87	select AUDIT_ARCH_COMPAT_GENERIC
88	select ARM_GIC_V2M if PCI
89	select ARM_GIC_V3
90	select ARM_GIC_V3_ITS if PCI
91	select ARM_PSCI_FW
92	select BUILDTIME_TABLE_SORT
93	select CLONE_BACKWARDS
94	select COMMON_CLK
95	select CPU_PM if (SUSPEND || CPU_IDLE)
96	select CRC32
97	select DCACHE_WORD_ACCESS
98	select DMA_DIRECT_REMAP
99	select EDAC_SUPPORT
100	select FRAME_POINTER
101	select GENERIC_ALLOCATOR
102	select GENERIC_ARCH_TOPOLOGY
103	select GENERIC_CLOCKEVENTS
104	select GENERIC_CLOCKEVENTS_BROADCAST
105	select GENERIC_CPU_AUTOPROBE
106	select GENERIC_CPU_VULNERABILITIES
107	select GENERIC_EARLY_IOREMAP
108	select GENERIC_IDLE_POLL_SETUP
109	select GENERIC_IRQ_MULTI_HANDLER
110	select GENERIC_IRQ_PROBE
111	select GENERIC_IRQ_SHOW
112	select GENERIC_IRQ_SHOW_LEVEL
113	select GENERIC_PCI_IOMAP
114	select GENERIC_PTDUMP
115	select GENERIC_SCHED_CLOCK
116	select GENERIC_SMP_IDLE_THREAD
117	select GENERIC_STRNCPY_FROM_USER
118	select GENERIC_STRNLEN_USER
119	select GENERIC_TIME_VSYSCALL
120	select GENERIC_GETTIMEOFDAY
121	select GENERIC_VDSO_TIME_NS
122	select HANDLE_DOMAIN_IRQ
123	select HARDIRQS_SW_RESEND
124	select HAVE_PCI
125	select HAVE_ACPI_APEI if (ACPI && EFI)
126	select HAVE_ALIGNED_STRUCT_PAGE if SLUB
127	select HAVE_ARCH_AUDITSYSCALL
128	select HAVE_ARCH_BITREVERSE
129	select HAVE_ARCH_COMPILER_H
130	select HAVE_ARCH_HUGE_VMAP
131	select HAVE_ARCH_JUMP_LABEL
132	select HAVE_ARCH_JUMP_LABEL_RELATIVE
133	select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
134	select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
135	select HAVE_ARCH_KGDB
136	select HAVE_ARCH_MMAP_RND_BITS
137	select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
138	select HAVE_ARCH_PREL32_RELOCATIONS
139	select HAVE_ARCH_SECCOMP_FILTER
140	select HAVE_ARCH_STACKLEAK
141	select HAVE_ARCH_THREAD_STRUCT_WHITELIST
142	select HAVE_ARCH_TRACEHOOK
143	select HAVE_ARCH_TRANSPARENT_HUGEPAGE
144	select HAVE_ARCH_VMAP_STACK
145	select HAVE_ARM_SMCCC
146	select HAVE_ASM_MODVERSIONS
147	select HAVE_EBPF_JIT
148	select HAVE_C_RECORDMCOUNT
149	select HAVE_CMPXCHG_DOUBLE
150	select HAVE_CMPXCHG_LOCAL
151	select HAVE_CONTEXT_TRACKING
152	select HAVE_COPY_THREAD_TLS
153	select HAVE_DEBUG_BUGVERBOSE
154	select HAVE_DEBUG_KMEMLEAK
155	select HAVE_DMA_CONTIGUOUS
156	select HAVE_DYNAMIC_FTRACE
157	select HAVE_DYNAMIC_FTRACE_WITH_REGS \
158		if $(cc-option,-fpatchable-function-entry=2)
159	select HAVE_EFFICIENT_UNALIGNED_ACCESS
160	select HAVE_FAST_GUP
161	select HAVE_FTRACE_MCOUNT_RECORD
162	select HAVE_FUNCTION_TRACER
163	select HAVE_FUNCTION_ERROR_INJECTION
164	select HAVE_FUNCTION_GRAPH_TRACER
165	select HAVE_GCC_PLUGINS
166	select HAVE_HW_BREAKPOINT if PERF_EVENTS
167	select HAVE_IRQ_TIME_ACCOUNTING
168	select HAVE_NMI
169	select HAVE_PATA_PLATFORM
170	select HAVE_PERF_EVENTS
171	select HAVE_PERF_REGS
172	select HAVE_PERF_USER_STACK_DUMP
173	select HAVE_REGS_AND_STACK_ACCESS_API
174	select HAVE_FUNCTION_ARG_ACCESS_API
175	select HAVE_FUTEX_CMPXCHG if FUTEX
176	select MMU_GATHER_RCU_TABLE_FREE
177	select HAVE_RSEQ
178	select HAVE_STACKPROTECTOR
179	select HAVE_SYSCALL_TRACEPOINTS
180	select HAVE_KPROBES
181	select HAVE_KRETPROBES
182	select HAVE_GENERIC_VDSO
183	select IOMMU_DMA if IOMMU_SUPPORT
184	select IRQ_DOMAIN
185	select IRQ_FORCED_THREADING
186	select MODULES_USE_ELF_RELA
187	select NEED_DMA_MAP_STATE
188	select NEED_SG_DMA_LENGTH
189	select OF
190	select OF_EARLY_FLATTREE
191	select PCI_DOMAINS_GENERIC if PCI
192	select PCI_ECAM if (ACPI && PCI)
193	select PCI_SYSCALL if PCI
194	select POWER_RESET
195	select POWER_SUPPLY
196	select SPARSE_IRQ
197	select SWIOTLB
198	select SYSCTL_EXCEPTION_TRACE
199	select THREAD_INFO_IN_TASK
200	help
201	  ARM 64-bit (AArch64) Linux support.
202
203config 64BIT
204	def_bool y
205
206config MMU
207	def_bool y
208
209config ARM64_PAGE_SHIFT
210	int
211	default 16 if ARM64_64K_PAGES
212	default 14 if ARM64_16K_PAGES
213	default 12
214
215config ARM64_CONT_SHIFT
216	int
217	default 5 if ARM64_64K_PAGES
218	default 7 if ARM64_16K_PAGES
219	default 4
220
221config ARCH_MMAP_RND_BITS_MIN
222       default 14 if ARM64_64K_PAGES
223       default 16 if ARM64_16K_PAGES
224       default 18
225
226# max bits determined by the following formula:
227#  VA_BITS - PAGE_SHIFT - 3
228config ARCH_MMAP_RND_BITS_MAX
229       default 19 if ARM64_VA_BITS=36
230       default 24 if ARM64_VA_BITS=39
231       default 27 if ARM64_VA_BITS=42
232       default 30 if ARM64_VA_BITS=47
233       default 29 if ARM64_VA_BITS=48 && ARM64_64K_PAGES
234       default 31 if ARM64_VA_BITS=48 && ARM64_16K_PAGES
235       default 33 if ARM64_VA_BITS=48
236       default 14 if ARM64_64K_PAGES
237       default 16 if ARM64_16K_PAGES
238       default 18
239
240config ARCH_MMAP_RND_COMPAT_BITS_MIN
241       default 7 if ARM64_64K_PAGES
242       default 9 if ARM64_16K_PAGES
243       default 11
244
245config ARCH_MMAP_RND_COMPAT_BITS_MAX
246       default 16
247
248config NO_IOPORT_MAP
249	def_bool y if !PCI
250
251config STACKTRACE_SUPPORT
252	def_bool y
253
254config ILLEGAL_POINTER_VALUE
255	hex
256	default 0xdead000000000000
257
258config LOCKDEP_SUPPORT
259	def_bool y
260
261config TRACE_IRQFLAGS_SUPPORT
262	def_bool y
263
264config GENERIC_BUG
265	def_bool y
266	depends on BUG
267
268config GENERIC_BUG_RELATIVE_POINTERS
269	def_bool y
270	depends on GENERIC_BUG
271
272config GENERIC_HWEIGHT
273	def_bool y
274
275config GENERIC_CSUM
276        def_bool y
277
278config GENERIC_CALIBRATE_DELAY
279	def_bool y
280
281config ZONE_DMA
282	bool "Support DMA zone" if EXPERT
283	default y
284
285config ZONE_DMA32
286	bool "Support DMA32 zone" if EXPERT
287	default y
288
289config ARCH_ENABLE_MEMORY_HOTPLUG
290	def_bool y
291
292config ARCH_ENABLE_MEMORY_HOTREMOVE
293	def_bool y
294
295config SMP
296	def_bool y
297
298config KERNEL_MODE_NEON
299	def_bool y
300
301config FIX_EARLYCON_MEM
302	def_bool y
303
304config PGTABLE_LEVELS
305	int
306	default 2 if ARM64_16K_PAGES && ARM64_VA_BITS_36
307	default 2 if ARM64_64K_PAGES && ARM64_VA_BITS_42
308	default 3 if ARM64_64K_PAGES && (ARM64_VA_BITS_48 || ARM64_VA_BITS_52)
309	default 3 if ARM64_4K_PAGES && ARM64_VA_BITS_39
310	default 3 if ARM64_16K_PAGES && ARM64_VA_BITS_47
311	default 4 if !ARM64_64K_PAGES && ARM64_VA_BITS_48
312
313config ARCH_SUPPORTS_UPROBES
314	def_bool y
315
316config ARCH_PROC_KCORE_TEXT
317	def_bool y
318
319config BROKEN_GAS_INST
320	def_bool !$(as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n)
321
322config KASAN_SHADOW_OFFSET
323	hex
324	depends on KASAN
325	default 0xdfffa00000000000 if (ARM64_VA_BITS_48 || ARM64_VA_BITS_52) && !KASAN_SW_TAGS
326	default 0xdfffd00000000000 if ARM64_VA_BITS_47 && !KASAN_SW_TAGS
327	default 0xdffffe8000000000 if ARM64_VA_BITS_42 && !KASAN_SW_TAGS
328	default 0xdfffffd000000000 if ARM64_VA_BITS_39 && !KASAN_SW_TAGS
329	default 0xdffffffa00000000 if ARM64_VA_BITS_36 && !KASAN_SW_TAGS
330	default 0xefff900000000000 if (ARM64_VA_BITS_48 || ARM64_VA_BITS_52) && KASAN_SW_TAGS
331	default 0xefffc80000000000 if ARM64_VA_BITS_47 && KASAN_SW_TAGS
332	default 0xeffffe4000000000 if ARM64_VA_BITS_42 && KASAN_SW_TAGS
333	default 0xefffffc800000000 if ARM64_VA_BITS_39 && KASAN_SW_TAGS
334	default 0xeffffff900000000 if ARM64_VA_BITS_36 && KASAN_SW_TAGS
335	default 0xffffffffffffffff
336
337source "arch/arm64/Kconfig.platforms"
338
339menu "Kernel Features"
340
341menu "ARM errata workarounds via the alternatives framework"
342
343config ARM64_WORKAROUND_CLEAN_CACHE
344	bool
345
346config ARM64_ERRATUM_826319
347	bool "Cortex-A53: 826319: System might deadlock if a write cannot complete until read data is accepted"
348	default y
349	select ARM64_WORKAROUND_CLEAN_CACHE
350	help
351	  This option adds an alternative code sequence to work around ARM
352	  erratum 826319 on Cortex-A53 parts up to r0p2 with an AMBA 4 ACE or
353	  AXI master interface and an L2 cache.
354
355	  If a Cortex-A53 uses an AMBA AXI4 ACE interface to other processors
356	  and is unable to accept a certain write via this interface, it will
357	  not progress on read data presented on the read data channel and the
358	  system can deadlock.
359
360	  The workaround promotes data cache clean instructions to
361	  data cache clean-and-invalidate.
362	  Please note that this does not necessarily enable the workaround,
363	  as it depends on the alternative framework, which will only patch
364	  the kernel if an affected CPU is detected.
365
366	  If unsure, say Y.
367
368config ARM64_ERRATUM_827319
369	bool "Cortex-A53: 827319: Data cache clean instructions might cause overlapping transactions to the interconnect"
370	default y
371	select ARM64_WORKAROUND_CLEAN_CACHE
372	help
373	  This option adds an alternative code sequence to work around ARM
374	  erratum 827319 on Cortex-A53 parts up to r0p2 with an AMBA 5 CHI
375	  master interface and an L2 cache.
376
377	  Under certain conditions this erratum can cause a clean line eviction
378	  to occur at the same time as another transaction to the same address
379	  on the AMBA 5 CHI interface, which can cause data corruption if the
380	  interconnect reorders the two transactions.
381
382	  The workaround promotes data cache clean instructions to
383	  data cache clean-and-invalidate.
384	  Please note that this does not necessarily enable the workaround,
385	  as it depends on the alternative framework, which will only patch
386	  the kernel if an affected CPU is detected.
387
388	  If unsure, say Y.
389
390config ARM64_ERRATUM_824069
391	bool "Cortex-A53: 824069: Cache line might not be marked as clean after a CleanShared snoop"
392	default y
393	select ARM64_WORKAROUND_CLEAN_CACHE
394	help
395	  This option adds an alternative code sequence to work around ARM
396	  erratum 824069 on Cortex-A53 parts up to r0p2 when it is connected
397	  to a coherent interconnect.
398
399	  If a Cortex-A53 processor is executing a store or prefetch for
400	  write instruction at the same time as a processor in another
401	  cluster is executing a cache maintenance operation to the same
402	  address, then this erratum might cause a clean cache line to be
403	  incorrectly marked as dirty.
404
405	  The workaround promotes data cache clean instructions to
406	  data cache clean-and-invalidate.
407	  Please note that this option does not necessarily enable the
408	  workaround, as it depends on the alternative framework, which will
409	  only patch the kernel if an affected CPU is detected.
410
411	  If unsure, say Y.
412
413config ARM64_ERRATUM_819472
414	bool "Cortex-A53: 819472: Store exclusive instructions might cause data corruption"
415	default y
416	select ARM64_WORKAROUND_CLEAN_CACHE
417	help
418	  This option adds an alternative code sequence to work around ARM
419	  erratum 819472 on Cortex-A53 parts up to r0p1 with an L2 cache
420	  present when it is connected to a coherent interconnect.
421
422	  If the processor is executing a load and store exclusive sequence at
423	  the same time as a processor in another cluster is executing a cache
424	  maintenance operation to the same address, then this erratum might
425	  cause data corruption.
426
427	  The workaround promotes data cache clean instructions to
428	  data cache clean-and-invalidate.
429	  Please note that this does not necessarily enable the workaround,
430	  as it depends on the alternative framework, which will only patch
431	  the kernel if an affected CPU is detected.
432
433	  If unsure, say Y.
434
435config ARM64_ERRATUM_832075
436	bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads"
437	default y
438	help
439	  This option adds an alternative code sequence to work around ARM
440	  erratum 832075 on Cortex-A57 parts up to r1p2.
441
442	  Affected Cortex-A57 parts might deadlock when exclusive load/store
443	  instructions to Write-Back memory are mixed with Device loads.
444
445	  The workaround is to promote device loads to use Load-Acquire
446	  semantics.
447	  Please note that this does not necessarily enable the workaround,
448	  as it depends on the alternative framework, which will only patch
449	  the kernel if an affected CPU is detected.
450
451	  If unsure, say Y.
452
453config ARM64_ERRATUM_834220
454	bool "Cortex-A57: 834220: Stage 2 translation fault might be incorrectly reported in presence of a Stage 1 fault"
455	depends on KVM
456	default y
457	help
458	  This option adds an alternative code sequence to work around ARM
459	  erratum 834220 on Cortex-A57 parts up to r1p2.
460
461	  Affected Cortex-A57 parts might report a Stage 2 translation
462	  fault as the result of a Stage 1 fault for load crossing a
463	  page boundary when there is a permission or device memory
464	  alignment fault at Stage 1 and a translation fault at Stage 2.
465
466	  The workaround is to verify that the Stage 1 translation
467	  doesn't generate a fault before handling the Stage 2 fault.
468	  Please note that this does not necessarily enable the workaround,
469	  as it depends on the alternative framework, which will only patch
470	  the kernel if an affected CPU is detected.
471
472	  If unsure, say Y.
473
474config ARM64_ERRATUM_845719
475	bool "Cortex-A53: 845719: a load might read incorrect data"
476	depends on COMPAT
477	default y
478	help
479	  This option adds an alternative code sequence to work around ARM
480	  erratum 845719 on Cortex-A53 parts up to r0p4.
481
482	  When running a compat (AArch32) userspace on an affected Cortex-A53
483	  part, a load at EL0 from a virtual address that matches the bottom 32
484	  bits of the virtual address used by a recent load at (AArch64) EL1
485	  might return incorrect data.
486
487	  The workaround is to write the contextidr_el1 register on exception
488	  return to a 32-bit task.
489	  Please note that this does not necessarily enable the workaround,
490	  as it depends on the alternative framework, which will only patch
491	  the kernel if an affected CPU is detected.
492
493	  If unsure, say Y.
494
495config ARM64_ERRATUM_843419
496	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
497	default y
498	select ARM64_MODULE_PLTS if MODULES
499	help
500	  This option links the kernel with '--fix-cortex-a53-843419' and
501	  enables PLT support to replace certain ADRP instructions, which can
502	  cause subsequent memory accesses to use an incorrect address on
503	  Cortex-A53 parts up to r0p4.
504
505	  If unsure, say Y.
506
507config ARM64_ERRATUM_1024718
508	bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
509	default y
510	help
511	  This option adds a workaround for ARM Cortex-A55 Erratum 1024718.
512
513	  Affected Cortex-A55 cores (r0p0, r0p1, r1p0) could cause incorrect
514	  update of the hardware dirty bit when the DBM/AP bits are updated
515	  without a break-before-make. The workaround is to disable the usage
516	  of hardware DBM locally on the affected cores. CPUs not affected by
517	  this erratum will continue to use the feature.
518
519	  If unsure, say Y.
520
521config ARM64_ERRATUM_1418040
522	bool "Cortex-A76/Neoverse-N1: MRC read following MRRC read of specific Generic Timer in AArch32 might give incorrect result"
523	default y
524	depends on COMPAT
525	help
526	  This option adds a workaround for ARM Cortex-A76/Neoverse-N1
527	  errata 1188873 and 1418040.
528
529	  Affected Cortex-A76/Neoverse-N1 cores (r0p0 to r3p1) could
530	  cause register corruption when accessing the timer registers
531	  from AArch32 userspace.
532
533	  If unsure, say Y.
534
535config ARM64_WORKAROUND_SPECULATIVE_AT
536	bool
537
538config ARM64_ERRATUM_1165522
539	bool "Cortex-A76: 1165522: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
540	default y
541	select ARM64_WORKAROUND_SPECULATIVE_AT
542	help
543	  This option adds a workaround for ARM Cortex-A76 erratum 1165522.
544
545	  Affected Cortex-A76 cores (r0p0, r1p0, r2p0) could end-up with
546	  corrupted TLBs by speculating an AT instruction during a guest
547	  context switch.
548
549	  If unsure, say Y.
550
551config ARM64_ERRATUM_1319367
552	bool "Cortex-A57/A72: 1319537: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
553	default y
554	select ARM64_WORKAROUND_SPECULATIVE_AT
555	help
556	  This option adds work arounds for ARM Cortex-A57 erratum 1319537
557	  and A72 erratum 1319367
558
559	  Cortex-A57 and A72 cores could end-up with corrupted TLBs by
560	  speculating an AT instruction during a guest context switch.
561
562	  If unsure, say Y.
563
564config ARM64_ERRATUM_1530923
565	bool "Cortex-A55: 1530923: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
566	default y
567	select ARM64_WORKAROUND_SPECULATIVE_AT
568	help
569	  This option adds a workaround for ARM Cortex-A55 erratum 1530923.
570
571	  Affected Cortex-A55 cores (r0p0, r0p1, r1p0, r2p0) could end-up with
572	  corrupted TLBs by speculating an AT instruction during a guest
573	  context switch.
574
575	  If unsure, say Y.
576
577config ARM64_WORKAROUND_REPEAT_TLBI
578	bool
579
580config ARM64_ERRATUM_1286807
581	bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation"
582	default y
583	select ARM64_WORKAROUND_REPEAT_TLBI
584	help
585	  This option adds a workaround for ARM Cortex-A76 erratum 1286807.
586
587	  On the affected Cortex-A76 cores (r0p0 to r3p0), if a virtual
588	  address for a cacheable mapping of a location is being
589	  accessed by a core while another core is remapping the virtual
590	  address to a new physical page using the recommended
591	  break-before-make sequence, then under very rare circumstances
592	  TLBI+DSB completes before a read using the translation being
593	  invalidated has been observed by other observers. The
594	  workaround repeats the TLBI+DSB operation.
595
596config ARM64_ERRATUM_1463225
597	bool "Cortex-A76: Software Step might prevent interrupt recognition"
598	default y
599	help
600	  This option adds a workaround for Arm Cortex-A76 erratum 1463225.
601
602	  On the affected Cortex-A76 cores (r0p0 to r3p1), software stepping
603	  of a system call instruction (SVC) can prevent recognition of
604	  subsequent interrupts when software stepping is disabled in the
605	  exception handler of the system call and either kernel debugging
606	  is enabled or VHE is in use.
607
608	  Work around the erratum by triggering a dummy step exception
609	  when handling a system call from a task that is being stepped
610	  in a VHE configuration of the kernel.
611
612	  If unsure, say Y.
613
614config ARM64_ERRATUM_1542419
615	bool "Neoverse-N1: workaround mis-ordering of instruction fetches"
616	default y
617	help
618	  This option adds a workaround for ARM Neoverse-N1 erratum
619	  1542419.
620
621	  Affected Neoverse-N1 cores could execute a stale instruction when
622	  modified by another CPU. The workaround depends on a firmware
623	  counterpart.
624
625	  Workaround the issue by hiding the DIC feature from EL0. This
626	  forces user-space to perform cache maintenance.
627
628	  If unsure, say Y.
629
630config CAVIUM_ERRATUM_22375
631	bool "Cavium erratum 22375, 24313"
632	default y
633	help
634	  Enable workaround for errata 22375 and 24313.
635
636	  This implements two gicv3-its errata workarounds for ThunderX. Both
637	  with a small impact affecting only ITS table allocation.
638
639	    erratum 22375: only alloc 8MB table size
640	    erratum 24313: ignore memory access type
641
642	  The fixes are in ITS initialization and basically ignore memory access
643	  type and table size provided by the TYPER and BASER registers.
644
645	  If unsure, say Y.
646
647config CAVIUM_ERRATUM_23144
648	bool "Cavium erratum 23144: ITS SYNC hang on dual socket system"
649	depends on NUMA
650	default y
651	help
652	  ITS SYNC command hang for cross node io and collections/cpu mapping.
653
654	  If unsure, say Y.
655
656config CAVIUM_ERRATUM_23154
657	bool "Cavium erratum 23154: Access to ICC_IAR1_EL1 is not sync'ed"
658	default y
659	help
660	  The gicv3 of ThunderX requires a modified version for
661	  reading the IAR status to ensure data synchronization
662	  (access to icc_iar1_el1 is not sync'ed before and after).
663
664	  If unsure, say Y.
665
666config CAVIUM_ERRATUM_27456
667	bool "Cavium erratum 27456: Broadcast TLBI instructions may cause icache corruption"
668	default y
669	help
670	  On ThunderX T88 pass 1.x through 2.1 parts, broadcast TLBI
671	  instructions may cause the icache to become corrupted if it
672	  contains data for a non-current ASID.  The fix is to
673	  invalidate the icache when changing the mm context.
674
675	  If unsure, say Y.
676
677config CAVIUM_ERRATUM_30115
678	bool "Cavium erratum 30115: Guest may disable interrupts in host"
679	default y
680	help
681	  On ThunderX T88 pass 1.x through 2.2, T81 pass 1.0 through
682	  1.2, and T83 Pass 1.0, KVM guest execution may disable
683	  interrupts in host. Trapping both GICv3 group-0 and group-1
684	  accesses sidesteps the issue.
685
686	  If unsure, say Y.
687
688config CAVIUM_TX2_ERRATUM_219
689	bool "Cavium ThunderX2 erratum 219: PRFM between TTBR change and ISB fails"
690	default y
691	help
692	  On Cavium ThunderX2, a load, store or prefetch instruction between a
693	  TTBR update and the corresponding context synchronizing operation can
694	  cause a spurious Data Abort to be delivered to any hardware thread in
695	  the CPU core.
696
697	  Work around the issue by avoiding the problematic code sequence and
698	  trapping KVM guest TTBRx_EL1 writes to EL2 when SMT is enabled. The
699	  trap handler performs the corresponding register access, skips the
700	  instruction and ensures context synchronization by virtue of the
701	  exception return.
702
703	  If unsure, say Y.
704
705config FUJITSU_ERRATUM_010001
706	bool "Fujitsu-A64FX erratum E#010001: Undefined fault may occur wrongly"
707	default y
708	help
709	  This option adds a workaround for Fujitsu-A64FX erratum E#010001.
710	  On some variants of the Fujitsu-A64FX cores ver(1.0, 1.1), memory
711	  accesses may cause undefined fault (Data abort, DFSC=0b111111).
712	  This fault occurs under a specific hardware condition when a
713	  load/store instruction performs an address translation using:
714	  case-1  TTBR0_EL1 with TCR_EL1.NFD0 == 1.
715	  case-2  TTBR0_EL2 with TCR_EL2.NFD0 == 1.
716	  case-3  TTBR1_EL1 with TCR_EL1.NFD1 == 1.
717	  case-4  TTBR1_EL2 with TCR_EL2.NFD1 == 1.
718
719	  The workaround is to ensure these bits are clear in TCR_ELx.
720	  The workaround only affects the Fujitsu-A64FX.
721
722	  If unsure, say Y.
723
724config HISILICON_ERRATUM_161600802
725	bool "Hip07 161600802: Erroneous redistributor VLPI base"
726	default y
727	help
728	  The HiSilicon Hip07 SoC uses the wrong redistributor base
729	  when issued ITS commands such as VMOVP and VMAPP, and requires
730	  a 128kB offset to be applied to the target address in this commands.
731
732	  If unsure, say Y.
733
734config QCOM_FALKOR_ERRATUM_1003
735	bool "Falkor E1003: Incorrect translation due to ASID change"
736	default y
737	help
738	  On Falkor v1, an incorrect ASID may be cached in the TLB when ASID
739	  and BADDR are changed together in TTBRx_EL1. Since we keep the ASID
740	  in TTBR1_EL1, this situation only occurs in the entry trampoline and
741	  then only for entries in the walk cache, since the leaf translation
742	  is unchanged. Work around the erratum by invalidating the walk cache
743	  entries for the trampoline before entering the kernel proper.
744
745config QCOM_FALKOR_ERRATUM_1009
746	bool "Falkor E1009: Prematurely complete a DSB after a TLBI"
747	default y
748	select ARM64_WORKAROUND_REPEAT_TLBI
749	help
750	  On Falkor v1, the CPU may prematurely complete a DSB following a
751	  TLBI xxIS invalidate maintenance operation. Repeat the TLBI operation
752	  one more time to fix the issue.
753
754	  If unsure, say Y.
755
756config QCOM_QDF2400_ERRATUM_0065
757	bool "QDF2400 E0065: Incorrect GITS_TYPER.ITT_Entry_size"
758	default y
759	help
760	  On Qualcomm Datacenter Technologies QDF2400 SoC, ITS hardware reports
761	  ITE size incorrectly. The GITS_TYPER.ITT_Entry_size field should have
762	  been indicated as 16Bytes (0xf), not 8Bytes (0x7).
763
764	  If unsure, say Y.
765
766config QCOM_FALKOR_ERRATUM_E1041
767	bool "Falkor E1041: Speculative instruction fetches might cause errant memory access"
768	default y
769	help
770	  Falkor CPU may speculatively fetch instructions from an improper
771	  memory location when MMU translation is changed from SCTLR_ELn[M]=1
772	  to SCTLR_ELn[M]=0. Prefix an ISB instruction to fix the problem.
773
774	  If unsure, say Y.
775
776config SOCIONEXT_SYNQUACER_PREITS
777	bool "Socionext Synquacer: Workaround for GICv3 pre-ITS"
778	default y
779	help
780	  Socionext Synquacer SoCs implement a separate h/w block to generate
781	  MSI doorbell writes with non-zero values for the device ID.
782
783	  If unsure, say Y.
784
785endmenu
786
787
788choice
789	prompt "Page size"
790	default ARM64_4K_PAGES
791	help
792	  Page size (translation granule) configuration.
793
794config ARM64_4K_PAGES
795	bool "4KB"
796	help
797	  This feature enables 4KB pages support.
798
799config ARM64_16K_PAGES
800	bool "16KB"
801	help
802	  The system will use 16KB pages support. AArch32 emulation
803	  requires applications compiled with 16K (or a multiple of 16K)
804	  aligned segments.
805
806config ARM64_64K_PAGES
807	bool "64KB"
808	help
809	  This feature enables 64KB pages support (4KB by default)
810	  allowing only two levels of page tables and faster TLB
811	  look-up. AArch32 emulation requires applications compiled
812	  with 64K aligned segments.
813
814endchoice
815
816choice
817	prompt "Virtual address space size"
818	default ARM64_VA_BITS_39 if ARM64_4K_PAGES
819	default ARM64_VA_BITS_47 if ARM64_16K_PAGES
820	default ARM64_VA_BITS_42 if ARM64_64K_PAGES
821	help
822	  Allows choosing one of multiple possible virtual address
823	  space sizes. The level of translation table is determined by
824	  a combination of page size and virtual address space size.
825
826config ARM64_VA_BITS_36
827	bool "36-bit" if EXPERT
828	depends on ARM64_16K_PAGES
829
830config ARM64_VA_BITS_39
831	bool "39-bit"
832	depends on ARM64_4K_PAGES
833
834config ARM64_VA_BITS_42
835	bool "42-bit"
836	depends on ARM64_64K_PAGES
837
838config ARM64_VA_BITS_47
839	bool "47-bit"
840	depends on ARM64_16K_PAGES
841
842config ARM64_VA_BITS_48
843	bool "48-bit"
844
845config ARM64_VA_BITS_52
846	bool "52-bit"
847	depends on ARM64_64K_PAGES && (ARM64_PAN || !ARM64_SW_TTBR0_PAN)
848	help
849	  Enable 52-bit virtual addressing for userspace when explicitly
850	  requested via a hint to mmap(). The kernel will also use 52-bit
851	  virtual addresses for its own mappings (provided HW support for
852	  this feature is available, otherwise it reverts to 48-bit).
853
854	  NOTE: Enabling 52-bit virtual addressing in conjunction with
855	  ARMv8.3 Pointer Authentication will result in the PAC being
856	  reduced from 7 bits to 3 bits, which may have a significant
857	  impact on its susceptibility to brute-force attacks.
858
859	  If unsure, select 48-bit virtual addressing instead.
860
861endchoice
862
863config ARM64_FORCE_52BIT
864	bool "Force 52-bit virtual addresses for userspace"
865	depends on ARM64_VA_BITS_52 && EXPERT
866	help
867	  For systems with 52-bit userspace VAs enabled, the kernel will attempt
868	  to maintain compatibility with older software by providing 48-bit VAs
869	  unless a hint is supplied to mmap.
870
871	  This configuration option disables the 48-bit compatibility logic, and
872	  forces all userspace addresses to be 52-bit on HW that supports it. One
873	  should only enable this configuration option for stress testing userspace
874	  memory management code. If unsure say N here.
875
876config ARM64_VA_BITS
877	int
878	default 36 if ARM64_VA_BITS_36
879	default 39 if ARM64_VA_BITS_39
880	default 42 if ARM64_VA_BITS_42
881	default 47 if ARM64_VA_BITS_47
882	default 48 if ARM64_VA_BITS_48
883	default 52 if ARM64_VA_BITS_52
884
885choice
886	prompt "Physical address space size"
887	default ARM64_PA_BITS_48
888	help
889	  Choose the maximum physical address range that the kernel will
890	  support.
891
892config ARM64_PA_BITS_48
893	bool "48-bit"
894
895config ARM64_PA_BITS_52
896	bool "52-bit (ARMv8.2)"
897	depends on ARM64_64K_PAGES
898	depends on ARM64_PAN || !ARM64_SW_TTBR0_PAN
899	help
900	  Enable support for a 52-bit physical address space, introduced as
901	  part of the ARMv8.2-LPA extension.
902
903	  With this enabled, the kernel will also continue to work on CPUs that
904	  do not support ARMv8.2-LPA, but with some added memory overhead (and
905	  minor performance overhead).
906
907endchoice
908
909config ARM64_PA_BITS
910	int
911	default 48 if ARM64_PA_BITS_48
912	default 52 if ARM64_PA_BITS_52
913
914choice
915	prompt "Endianness"
916	default CPU_LITTLE_ENDIAN
917	help
918	  Select the endianness of data accesses performed by the CPU. Userspace
919	  applications will need to be compiled and linked for the endianness
920	  that is selected here.
921
922config CPU_BIG_ENDIAN
923       bool "Build big-endian kernel"
924       help
925	  Say Y if you plan on running a kernel with a big-endian userspace.
926
927config CPU_LITTLE_ENDIAN
928	bool "Build little-endian kernel"
929	help
930	  Say Y if you plan on running a kernel with a little-endian userspace.
931	  This is usually the case for distributions targeting arm64.
932
933endchoice
934
935config SCHED_MC
936	bool "Multi-core scheduler support"
937	help
938	  Multi-core scheduler support improves the CPU scheduler's decision
939	  making when dealing with multi-core CPU chips at a cost of slightly
940	  increased overhead in some places. If unsure say N here.
941
942config SCHED_SMT
943	bool "SMT scheduler support"
944	help
945	  Improves the CPU scheduler's decision making when dealing with
946	  MultiThreading at a cost of slightly increased overhead in some
947	  places. If unsure say N here.
948
949config NR_CPUS
950	int "Maximum number of CPUs (2-4096)"
951	range 2 4096
952	default "256"
953
954config HOTPLUG_CPU
955	bool "Support for hot-pluggable CPUs"
956	select GENERIC_IRQ_MIGRATION
957	help
958	  Say Y here to experiment with turning CPUs off and on.  CPUs
959	  can be controlled through /sys/devices/system/cpu.
960
961# Common NUMA Features
962config NUMA
963	bool "NUMA Memory Allocation and Scheduler Support"
964	select ACPI_NUMA if ACPI
965	select OF_NUMA
966	help
967	  Enable NUMA (Non-Uniform Memory Access) support.
968
969	  The kernel will try to allocate memory used by a CPU on the
970	  local memory of the CPU and add some more
971	  NUMA awareness to the kernel.
972
973config NODES_SHIFT
974	int "Maximum NUMA Nodes (as a power of 2)"
975	range 1 10
976	default "2"
977	depends on NEED_MULTIPLE_NODES
978	help
979	  Specify the maximum number of NUMA Nodes available on the target
980	  system.  Increases memory reserved to accommodate various tables.
981
982config USE_PERCPU_NUMA_NODE_ID
983	def_bool y
984	depends on NUMA
985
986config HAVE_SETUP_PER_CPU_AREA
987	def_bool y
988	depends on NUMA
989
990config NEED_PER_CPU_EMBED_FIRST_CHUNK
991	def_bool y
992	depends on NUMA
993
994config HOLES_IN_ZONE
995	def_bool y
996
997source "kernel/Kconfig.hz"
998
999config ARCH_SUPPORTS_DEBUG_PAGEALLOC
1000	def_bool y
1001
1002config ARCH_SPARSEMEM_ENABLE
1003	def_bool y
1004	select SPARSEMEM_VMEMMAP_ENABLE
1005
1006config ARCH_SPARSEMEM_DEFAULT
1007	def_bool ARCH_SPARSEMEM_ENABLE
1008
1009config ARCH_SELECT_MEMORY_MODEL
1010	def_bool ARCH_SPARSEMEM_ENABLE
1011
1012config ARCH_FLATMEM_ENABLE
1013	def_bool !NUMA
1014
1015config HAVE_ARCH_PFN_VALID
1016	def_bool y
1017
1018config HW_PERF_EVENTS
1019	def_bool y
1020	depends on ARM_PMU
1021
1022config SYS_SUPPORTS_HUGETLBFS
1023	def_bool y
1024
1025config ARCH_WANT_HUGE_PMD_SHARE
1026
1027config ARCH_HAS_CACHE_LINE_SIZE
1028	def_bool y
1029
1030config ARCH_ENABLE_SPLIT_PMD_PTLOCK
1031	def_bool y if PGTABLE_LEVELS > 2
1032
1033# Supported by clang >= 7.0
1034config CC_HAVE_SHADOW_CALL_STACK
1035	def_bool $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18)
1036
1037config SECCOMP
1038	bool "Enable seccomp to safely compute untrusted bytecode"
1039	help
1040	  This kernel feature is useful for number crunching applications
1041	  that may need to compute untrusted bytecode during their
1042	  execution. By using pipes or other transports made available to
1043	  the process as file descriptors supporting the read/write
1044	  syscalls, it's possible to isolate those applications in
1045	  their own address space using seccomp. Once seccomp is
1046	  enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
1047	  and the task is only allowed to execute a few safe syscalls
1048	  defined by each seccomp mode.
1049
1050config PARAVIRT
1051	bool "Enable paravirtualization code"
1052	help
1053	  This changes the kernel so it can modify itself when it is run
1054	  under a hypervisor, potentially improving performance significantly
1055	  over full virtualization.
1056
1057config PARAVIRT_TIME_ACCOUNTING
1058	bool "Paravirtual steal time accounting"
1059	select PARAVIRT
1060	help
1061	  Select this option to enable fine granularity task steal time
1062	  accounting. Time spent executing other tasks in parallel with
1063	  the current vCPU is discounted from the vCPU power. To account for
1064	  that, there can be a small performance impact.
1065
1066	  If in doubt, say N here.
1067
1068config KEXEC
1069	depends on PM_SLEEP_SMP
1070	select KEXEC_CORE
1071	bool "kexec system call"
1072	help
1073	  kexec is a system call that implements the ability to shutdown your
1074	  current kernel, and to start another kernel.  It is like a reboot
1075	  but it is independent of the system firmware.   And like a reboot
1076	  you can start any kernel with it, not just Linux.
1077
1078config KEXEC_FILE
1079	bool "kexec file based system call"
1080	select KEXEC_CORE
1081	help
1082	  This is new version of kexec system call. This system call is
1083	  file based and takes file descriptors as system call argument
1084	  for kernel and initramfs as opposed to list of segments as
1085	  accepted by previous system call.
1086
1087config KEXEC_SIG
1088	bool "Verify kernel signature during kexec_file_load() syscall"
1089	depends on KEXEC_FILE
1090	help
1091	  Select this option to verify a signature with loaded kernel
1092	  image. If configured, any attempt of loading a image without
1093	  valid signature will fail.
1094
1095	  In addition to that option, you need to enable signature
1096	  verification for the corresponding kernel image type being
1097	  loaded in order for this to work.
1098
1099config KEXEC_IMAGE_VERIFY_SIG
1100	bool "Enable Image signature verification support"
1101	default y
1102	depends on KEXEC_SIG
1103	depends on EFI && SIGNED_PE_FILE_VERIFICATION
1104	help
1105	  Enable Image signature verification support.
1106
1107comment "Support for PE file signature verification disabled"
1108	depends on KEXEC_SIG
1109	depends on !EFI || !SIGNED_PE_FILE_VERIFICATION
1110
1111config CRASH_DUMP
1112	bool "Build kdump crash kernel"
1113	help
1114	  Generate crash dump after being started by kexec. This should
1115	  be normally only set in special crash dump kernels which are
1116	  loaded in the main kernel with kexec-tools into a specially
1117	  reserved region and then later executed after a crash by
1118	  kdump/kexec.
1119
1120	  For more details see Documentation/admin-guide/kdump/kdump.rst
1121
1122config XEN_DOM0
1123	def_bool y
1124	depends on XEN
1125
1126config XEN
1127	bool "Xen guest support on ARM64"
1128	depends on ARM64 && OF
1129	select SWIOTLB_XEN
1130	select PARAVIRT
1131	help
1132	  Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
1133
1134config FORCE_MAX_ZONEORDER
1135	int
1136	default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
1137	default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE)
1138	default "11"
1139	help
1140	  The kernel memory allocator divides physically contiguous memory
1141	  blocks into "zones", where each zone is a power of two number of
1142	  pages.  This option selects the largest power of two that the kernel
1143	  keeps in the memory allocator.  If you need to allocate very large
1144	  blocks of physically contiguous memory, then you may need to
1145	  increase this value.
1146
1147	  This config option is actually maximum order plus one. For example,
1148	  a value of 11 means that the largest free memory block is 2^10 pages.
1149
1150	  We make sure that we can allocate upto a HugePage size for each configuration.
1151	  Hence we have :
1152		MAX_ORDER = (PMD_SHIFT - PAGE_SHIFT) + 1 => PAGE_SHIFT - 2
1153
1154	  However for 4K, we choose a higher default value, 11 as opposed to 10, giving us
1155	  4M allocations matching the default size used by generic code.
1156
1157config UNMAP_KERNEL_AT_EL0
1158	bool "Unmap kernel when running in userspace (aka \"KAISER\")" if EXPERT
1159	default y
1160	help
1161	  Speculation attacks against some high-performance processors can
1162	  be used to bypass MMU permission checks and leak kernel data to
1163	  userspace. This can be defended against by unmapping the kernel
1164	  when running in userspace, mapping it back in on exception entry
1165	  via a trampoline page in the vector table.
1166
1167	  If unsure, say Y.
1168
1169config HARDEN_BRANCH_PREDICTOR
1170	bool "Harden the branch predictor against aliasing attacks" if EXPERT
1171	default y
1172	help
1173	  Speculation attacks against some high-performance processors rely on
1174	  being able to manipulate the branch predictor for a victim context by
1175	  executing aliasing branches in the attacker context.  Such attacks
1176	  can be partially mitigated against by clearing internal branch
1177	  predictor state and limiting the prediction logic in some situations.
1178
1179	  This config option will take CPU-specific actions to harden the
1180	  branch predictor against aliasing attacks and may rely on specific
1181	  instruction sequences or control bits being set by the system
1182	  firmware.
1183
1184	  If unsure, say Y.
1185
1186config HARDEN_EL2_VECTORS
1187	bool "Harden EL2 vector mapping against system register leak" if EXPERT
1188	default y
1189	help
1190	  Speculation attacks against some high-performance processors can
1191	  be used to leak privileged information such as the vector base
1192	  register, resulting in a potential defeat of the EL2 layout
1193	  randomization.
1194
1195	  This config option will map the vectors to a fixed location,
1196	  independent of the EL2 code mapping, so that revealing VBAR_EL2
1197	  to an attacker does not give away any extra information. This
1198	  only gets enabled on affected CPUs.
1199
1200	  If unsure, say Y.
1201
1202config ARM64_SSBD
1203	bool "Speculative Store Bypass Disable" if EXPERT
1204	default y
1205	help
1206	  This enables mitigation of the bypassing of previous stores
1207	  by speculative loads.
1208
1209	  If unsure, say Y.
1210
1211config RODATA_FULL_DEFAULT_ENABLED
1212	bool "Apply r/o permissions of VM areas also to their linear aliases"
1213	default y
1214	help
1215	  Apply read-only attributes of VM areas to the linear alias of
1216	  the backing pages as well. This prevents code or read-only data
1217	  from being modified (inadvertently or intentionally) via another
1218	  mapping of the same memory page. This additional enhancement can
1219	  be turned off at runtime by passing rodata=[off|on] (and turned on
1220	  with rodata=full if this option is set to 'n')
1221
1222	  This requires the linear region to be mapped down to pages,
1223	  which may adversely affect performance in some cases.
1224
1225config ARM64_SW_TTBR0_PAN
1226	bool "Emulate Privileged Access Never using TTBR0_EL1 switching"
1227	help
1228	  Enabling this option prevents the kernel from accessing
1229	  user-space memory directly by pointing TTBR0_EL1 to a reserved
1230	  zeroed area and reserved ASID. The user access routines
1231	  restore the valid TTBR0_EL1 temporarily.
1232
1233config ARM64_TAGGED_ADDR_ABI
1234	bool "Enable the tagged user addresses syscall ABI"
1235	default y
1236	help
1237	  When this option is enabled, user applications can opt in to a
1238	  relaxed ABI via prctl() allowing tagged addresses to be passed
1239	  to system calls as pointer arguments. For details, see
1240	  Documentation/arm64/tagged-address-abi.rst.
1241
1242menuconfig COMPAT
1243	bool "Kernel support for 32-bit EL0"
1244	depends on ARM64_4K_PAGES || EXPERT
1245	select COMPAT_BINFMT_ELF if BINFMT_ELF
1246	select HAVE_UID16
1247	select OLD_SIGSUSPEND3
1248	select COMPAT_OLD_SIGACTION
1249	help
1250	  This option enables support for a 32-bit EL0 running under a 64-bit
1251	  kernel at EL1. AArch32-specific components such as system calls,
1252	  the user helper functions, VFP support and the ptrace interface are
1253	  handled appropriately by the kernel.
1254
1255	  If you use a page size other than 4KB (i.e, 16KB or 64KB), please be aware
1256	  that you will only be able to execute AArch32 binaries that were compiled
1257	  with page size aligned segments.
1258
1259	  If you want to execute 32-bit userspace applications, say Y.
1260
1261if COMPAT
1262
1263config KUSER_HELPERS
1264	bool "Enable kuser helpers page for 32-bit applications"
1265	default y
1266	help
1267	  Warning: disabling this option may break 32-bit user programs.
1268
1269	  Provide kuser helpers to compat tasks. The kernel provides
1270	  helper code to userspace in read only form at a fixed location
1271	  to allow userspace to be independent of the CPU type fitted to
1272	  the system. This permits binaries to be run on ARMv4 through
1273	  to ARMv8 without modification.
1274
1275	  See Documentation/arm/kernel_user_helpers.rst for details.
1276
1277	  However, the fixed address nature of these helpers can be used
1278	  by ROP (return orientated programming) authors when creating
1279	  exploits.
1280
1281	  If all of the binaries and libraries which run on your platform
1282	  are built specifically for your platform, and make no use of
1283	  these helpers, then you can turn this option off to hinder
1284	  such exploits. However, in that case, if a binary or library
1285	  relying on those helpers is run, it will not function correctly.
1286
1287	  Say N here only if you are absolutely certain that you do not
1288	  need these helpers; otherwise, the safe option is to say Y.
1289
1290config COMPAT_VDSO
1291	bool "Enable vDSO for 32-bit applications"
1292	depends on !CPU_BIG_ENDIAN && "$(CROSS_COMPILE_COMPAT)" != ""
1293	select GENERIC_COMPAT_VDSO
1294	default y
1295	help
1296	  Place in the process address space of 32-bit applications an
1297	  ELF shared object providing fast implementations of gettimeofday
1298	  and clock_gettime.
1299
1300	  You must have a 32-bit build of glibc 2.22 or later for programs
1301	  to seamlessly take advantage of this.
1302
1303config THUMB2_COMPAT_VDSO
1304	bool "Compile the 32-bit vDSO for Thumb-2 mode" if EXPERT
1305	depends on COMPAT_VDSO
1306	default y
1307	help
1308	  Compile the compat vDSO with '-mthumb -fomit-frame-pointer' if y,
1309	  otherwise with '-marm'.
1310
1311menuconfig ARMV8_DEPRECATED
1312	bool "Emulate deprecated/obsolete ARMv8 instructions"
1313	depends on SYSCTL
1314	help
1315	  Legacy software support may require certain instructions
1316	  that have been deprecated or obsoleted in the architecture.
1317
1318	  Enable this config to enable selective emulation of these
1319	  features.
1320
1321	  If unsure, say Y
1322
1323if ARMV8_DEPRECATED
1324
1325config SWP_EMULATION
1326	bool "Emulate SWP/SWPB instructions"
1327	help
1328	  ARMv8 obsoletes the use of A32 SWP/SWPB instructions such that
1329	  they are always undefined. Say Y here to enable software
1330	  emulation of these instructions for userspace using LDXR/STXR.
1331	  This feature can be controlled at runtime with the abi.swp
1332	  sysctl which is disabled by default.
1333
1334	  In some older versions of glibc [<=2.8] SWP is used during futex
1335	  trylock() operations with the assumption that the code will not
1336	  be preempted. This invalid assumption may be more likely to fail
1337	  with SWP emulation enabled, leading to deadlock of the user
1338	  application.
1339
1340	  NOTE: when accessing uncached shared regions, LDXR/STXR rely
1341	  on an external transaction monitoring block called a global
1342	  monitor to maintain update atomicity. If your system does not
1343	  implement a global monitor, this option can cause programs that
1344	  perform SWP operations to uncached memory to deadlock.
1345
1346	  If unsure, say Y
1347
1348config CP15_BARRIER_EMULATION
1349	bool "Emulate CP15 Barrier instructions"
1350	help
1351	  The CP15 barrier instructions - CP15ISB, CP15DSB, and
1352	  CP15DMB - are deprecated in ARMv8 (and ARMv7). It is
1353	  strongly recommended to use the ISB, DSB, and DMB
1354	  instructions instead.
1355
1356	  Say Y here to enable software emulation of these
1357	  instructions for AArch32 userspace code. When this option is
1358	  enabled, CP15 barrier usage is traced which can help
1359	  identify software that needs updating. This feature can be
1360	  controlled at runtime with the abi.cp15_barrier sysctl.
1361
1362	  If unsure, say Y
1363
1364config SETEND_EMULATION
1365	bool "Emulate SETEND instruction"
1366	help
1367	  The SETEND instruction alters the data-endianness of the
1368	  AArch32 EL0, and is deprecated in ARMv8.
1369
1370	  Say Y here to enable software emulation of the instruction
1371	  for AArch32 userspace code. This feature can be controlled
1372	  at runtime with the abi.setend sysctl.
1373
1374	  Note: All the cpus on the system must have mixed endian support at EL0
1375	  for this feature to be enabled. If a new CPU - which doesn't support mixed
1376	  endian - is hotplugged in after this feature has been enabled, there could
1377	  be unexpected results in the applications.
1378
1379	  If unsure, say Y
1380endif
1381
1382endif
1383
1384menu "ARMv8.1 architectural features"
1385
1386config ARM64_HW_AFDBM
1387	bool "Support for hardware updates of the Access and Dirty page flags"
1388	default y
1389	help
1390	  The ARMv8.1 architecture extensions introduce support for
1391	  hardware updates of the access and dirty information in page
1392	  table entries. When enabled in TCR_EL1 (HA and HD bits) on
1393	  capable processors, accesses to pages with PTE_AF cleared will
1394	  set this bit instead of raising an access flag fault.
1395	  Similarly, writes to read-only pages with the DBM bit set will
1396	  clear the read-only bit (AP[2]) instead of raising a
1397	  permission fault.
1398
1399	  Kernels built with this configuration option enabled continue
1400	  to work on pre-ARMv8.1 hardware and the performance impact is
1401	  minimal. If unsure, say Y.
1402
1403config ARM64_PAN
1404	bool "Enable support for Privileged Access Never (PAN)"
1405	default y
1406	help
1407	 Privileged Access Never (PAN; part of the ARMv8.1 Extensions)
1408	 prevents the kernel or hypervisor from accessing user-space (EL0)
1409	 memory directly.
1410
1411	 Choosing this option will cause any unprotected (not using
1412	 copy_to_user et al) memory access to fail with a permission fault.
1413
1414	 The feature is detected at runtime, and will remain as a 'nop'
1415	 instruction if the cpu does not implement the feature.
1416
1417config ARM64_LSE_ATOMICS
1418	bool
1419	default ARM64_USE_LSE_ATOMICS
1420	depends on $(as-instr,.arch_extension lse)
1421
1422config ARM64_USE_LSE_ATOMICS
1423	bool "Atomic instructions"
1424	depends on JUMP_LABEL
1425	default y
1426	help
1427	  As part of the Large System Extensions, ARMv8.1 introduces new
1428	  atomic instructions that are designed specifically to scale in
1429	  very large systems.
1430
1431	  Say Y here to make use of these instructions for the in-kernel
1432	  atomic routines. This incurs a small overhead on CPUs that do
1433	  not support these instructions and requires the kernel to be
1434	  built with binutils >= 2.25 in order for the new instructions
1435	  to be used.
1436
1437config ARM64_VHE
1438	bool "Enable support for Virtualization Host Extensions (VHE)"
1439	default y
1440	help
1441	  Virtualization Host Extensions (VHE) allow the kernel to run
1442	  directly at EL2 (instead of EL1) on processors that support
1443	  it. This leads to better performance for KVM, as they reduce
1444	  the cost of the world switch.
1445
1446	  Selecting this option allows the VHE feature to be detected
1447	  at runtime, and does not affect processors that do not
1448	  implement this feature.
1449
1450endmenu
1451
1452menu "ARMv8.2 architectural features"
1453
1454config ARM64_UAO
1455	bool "Enable support for User Access Override (UAO)"
1456	default y
1457	help
1458	  User Access Override (UAO; part of the ARMv8.2 Extensions)
1459	  causes the 'unprivileged' variant of the load/store instructions to
1460	  be overridden to be privileged.
1461
1462	  This option changes get_user() and friends to use the 'unprivileged'
1463	  variant of the load/store instructions. This ensures that user-space
1464	  really did have access to the supplied memory. When addr_limit is
1465	  set to kernel memory the UAO bit will be set, allowing privileged
1466	  access to kernel memory.
1467
1468	  Choosing this option will cause copy_to_user() et al to use user-space
1469	  memory permissions.
1470
1471	  The feature is detected at runtime, the kernel will use the
1472	  regular load/store instructions if the cpu does not implement the
1473	  feature.
1474
1475config ARM64_PMEM
1476	bool "Enable support for persistent memory"
1477	select ARCH_HAS_PMEM_API
1478	select ARCH_HAS_UACCESS_FLUSHCACHE
1479	help
1480	  Say Y to enable support for the persistent memory API based on the
1481	  ARMv8.2 DCPoP feature.
1482
1483	  The feature is detected at runtime, and the kernel will use DC CVAC
1484	  operations if DC CVAP is not supported (following the behaviour of
1485	  DC CVAP itself if the system does not define a point of persistence).
1486
1487config ARM64_RAS_EXTN
1488	bool "Enable support for RAS CPU Extensions"
1489	default y
1490	help
1491	  CPUs that support the Reliability, Availability and Serviceability
1492	  (RAS) Extensions, part of ARMv8.2 are able to track faults and
1493	  errors, classify them and report them to software.
1494
1495	  On CPUs with these extensions system software can use additional
1496	  barriers to determine if faults are pending and read the
1497	  classification from a new set of registers.
1498
1499	  Selecting this feature will allow the kernel to use these barriers
1500	  and access the new registers if the system supports the extension.
1501	  Platform RAS features may additionally depend on firmware support.
1502
1503config ARM64_CNP
1504	bool "Enable support for Common Not Private (CNP) translations"
1505	default y
1506	depends on ARM64_PAN || !ARM64_SW_TTBR0_PAN
1507	help
1508	  Common Not Private (CNP) allows translation table entries to
1509	  be shared between different PEs in the same inner shareable
1510	  domain, so the hardware can use this fact to optimise the
1511	  caching of such entries in the TLB.
1512
1513	  Selecting this option allows the CNP feature to be detected
1514	  at runtime, and does not affect PEs that do not implement
1515	  this feature.
1516
1517endmenu
1518
1519menu "ARMv8.3 architectural features"
1520
1521config ARM64_PTR_AUTH
1522	bool "Enable support for pointer authentication"
1523	default y
1524	depends on !KVM || ARM64_VHE
1525	depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
1526	# Modern compilers insert a .note.gnu.property section note for PAC
1527	# which is only understood by binutils starting with version 2.33.1.
1528	depends on LD_IS_LLD || LD_VERSION >= 233010000 || (CC_IS_GCC && GCC_VERSION < 90100)
1529	depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
1530	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
1531	help
1532	  Pointer authentication (part of the ARMv8.3 Extensions) provides
1533	  instructions for signing and authenticating pointers against secret
1534	  keys, which can be used to mitigate Return Oriented Programming (ROP)
1535	  and other attacks.
1536
1537	  This option enables these instructions at EL0 (i.e. for userspace).
1538	  Choosing this option will cause the kernel to initialise secret keys
1539	  for each process at exec() time, with these keys being
1540	  context-switched along with the process.
1541
1542	  If the compiler supports the -mbranch-protection or
1543	  -msign-return-address flag (e.g. GCC 7 or later), then this option
1544	  will also cause the kernel itself to be compiled with return address
1545	  protection. In this case, and if the target hardware is known to
1546	  support pointer authentication, then CONFIG_STACKPROTECTOR can be
1547	  disabled with minimal loss of protection.
1548
1549	  The feature is detected at runtime. If the feature is not present in
1550	  hardware it will not be advertised to userspace/KVM guest nor will it
1551	  be enabled. However, KVM guest also require VHE mode and hence
1552	  CONFIG_ARM64_VHE=y option to use this feature.
1553
1554	  If the feature is present on the boot CPU but not on a late CPU, then
1555	  the late CPU will be parked. Also, if the boot CPU does not have
1556	  address auth and the late CPU has then the late CPU will still boot
1557	  but with the feature disabled. On such a system, this option should
1558	  not be selected.
1559
1560	  This feature works with FUNCTION_GRAPH_TRACER option only if
1561	  DYNAMIC_FTRACE_WITH_REGS is enabled.
1562
1563config CC_HAS_BRANCH_PROT_PAC_RET
1564	# GCC 9 or later, clang 8 or later
1565	def_bool $(cc-option,-mbranch-protection=pac-ret+leaf)
1566
1567config CC_HAS_SIGN_RETURN_ADDRESS
1568	# GCC 7, 8
1569	def_bool $(cc-option,-msign-return-address=all)
1570
1571config AS_HAS_PAC
1572	def_bool $(cc-option,-Wa$(comma)-march=armv8.3-a)
1573
1574config AS_HAS_CFI_NEGATE_RA_STATE
1575	def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
1576
1577endmenu
1578
1579menu "ARMv8.4 architectural features"
1580
1581config ARM64_AMU_EXTN
1582	bool "Enable support for the Activity Monitors Unit CPU extension"
1583	default y
1584	help
1585	  The activity monitors extension is an optional extension introduced
1586	  by the ARMv8.4 CPU architecture. This enables support for version 1
1587	  of the activity monitors architecture, AMUv1.
1588
1589	  To enable the use of this extension on CPUs that implement it, say Y.
1590
1591	  Note that for architectural reasons, firmware _must_ implement AMU
1592	  support when running on CPUs that present the activity monitors
1593	  extension. The required support is present in:
1594	    * Version 1.5 and later of the ARM Trusted Firmware
1595
1596	  For kernels that have this configuration enabled but boot with broken
1597	  firmware, you may need to say N here until the firmware is fixed.
1598	  Otherwise you may experience firmware panics or lockups when
1599	  accessing the counter registers. Even if you are not observing these
1600	  symptoms, the values returned by the register reads might not
1601	  correctly reflect reality. Most commonly, the value read will be 0,
1602	  indicating that the counter is not enabled.
1603
1604config AS_HAS_ARMV8_4
1605	def_bool $(cc-option,-Wa$(comma)-march=armv8.4-a)
1606
1607config ARM64_TLB_RANGE
1608	bool "Enable support for tlbi range feature"
1609	default y
1610	depends on AS_HAS_ARMV8_4
1611	help
1612	  ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a
1613	  range of input addresses.
1614
1615	  The feature introduces new assembly instructions, and they were
1616	  support when binutils >= 2.30.
1617
1618endmenu
1619
1620menu "ARMv8.5 architectural features"
1621
1622config ARM64_BTI
1623	bool "Branch Target Identification support"
1624	default y
1625	help
1626	  Branch Target Identification (part of the ARMv8.5 Extensions)
1627	  provides a mechanism to limit the set of locations to which computed
1628	  branch instructions such as BR or BLR can jump.
1629
1630	  To make use of BTI on CPUs that support it, say Y.
1631
1632	  BTI is intended to provide complementary protection to other control
1633	  flow integrity protection mechanisms, such as the Pointer
1634	  authentication mechanism provided as part of the ARMv8.3 Extensions.
1635	  For this reason, it does not make sense to enable this option without
1636	  also enabling support for pointer authentication.  Thus, when
1637	  enabling this option you should also select ARM64_PTR_AUTH=y.
1638
1639	  Userspace binaries must also be specifically compiled to make use of
1640	  this mechanism.  If you say N here or the hardware does not support
1641	  BTI, such binaries can still run, but you get no additional
1642	  enforcement of branch destinations.
1643
1644config ARM64_BTI_KERNEL
1645	bool "Use Branch Target Identification for kernel"
1646	default y
1647	depends on ARM64_BTI
1648	depends on ARM64_PTR_AUTH
1649	depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
1650	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697
1651	depends on !CC_IS_GCC || GCC_VERSION >= 100100
1652	# https://reviews.llvm.org/rGb8ae3fdfa579dbf366b1bb1cbfdbf8c51db7fa55
1653	depends on !CC_IS_CLANG || CLANG_VERSION >= 100001
1654	depends on !(CC_IS_CLANG && GCOV_KERNEL)
1655	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
1656	help
1657	  Build the kernel with Branch Target Identification annotations
1658	  and enable enforcement of this for kernel code. When this option
1659	  is enabled and the system supports BTI all kernel code including
1660	  modular code must have BTI enabled.
1661
1662config CC_HAS_BRANCH_PROT_PAC_RET_BTI
1663	# GCC 9 or later, clang 8 or later
1664	def_bool $(cc-option,-mbranch-protection=pac-ret+leaf+bti)
1665
1666config ARM64_E0PD
1667	bool "Enable support for E0PD"
1668	default y
1669	help
1670	  E0PD (part of the ARMv8.5 extensions) allows us to ensure
1671	  that EL0 accesses made via TTBR1 always fault in constant time,
1672	  providing similar benefits to KASLR as those provided by KPTI, but
1673	  with lower overhead and without disrupting legitimate access to
1674	  kernel memory such as SPE.
1675
1676	  This option enables E0PD for TTBR1 where available.
1677
1678config ARCH_RANDOM
1679	bool "Enable support for random number generation"
1680	default y
1681	help
1682	  Random number generation (part of the ARMv8.5 Extensions)
1683	  provides a high bandwidth, cryptographically secure
1684	  hardware random number generator.
1685
1686endmenu
1687
1688config ARM64_SVE
1689	bool "ARM Scalable Vector Extension support"
1690	default y
1691	depends on !KVM || ARM64_VHE
1692	help
1693	  The Scalable Vector Extension (SVE) is an extension to the AArch64
1694	  execution state which complements and extends the SIMD functionality
1695	  of the base architecture to support much larger vectors and to enable
1696	  additional vectorisation opportunities.
1697
1698	  To enable use of this extension on CPUs that implement it, say Y.
1699
1700	  On CPUs that support the SVE2 extensions, this option will enable
1701	  those too.
1702
1703	  Note that for architectural reasons, firmware _must_ implement SVE
1704	  support when running on SVE capable hardware.  The required support
1705	  is present in:
1706
1707	    * version 1.5 and later of the ARM Trusted Firmware
1708	    * the AArch64 boot wrapper since commit 5e1261e08abf
1709	      ("bootwrapper: SVE: Enable SVE for EL2 and below").
1710
1711	  For other firmware implementations, consult the firmware documentation
1712	  or vendor.
1713
1714	  If you need the kernel to boot on SVE-capable hardware with broken
1715	  firmware, you may need to say N here until you get your firmware
1716	  fixed.  Otherwise, you may experience firmware panics or lockups when
1717	  booting the kernel.  If unsure and you are not observing these
1718	  symptoms, you should assume that it is safe to say Y.
1719
1720	  CPUs that support SVE are architecturally required to support the
1721	  Virtualization Host Extensions (VHE), so the kernel makes no
1722	  provision for supporting SVE alongside KVM without VHE enabled.
1723	  Thus, you will need to enable CONFIG_ARM64_VHE if you want to support
1724	  KVM in the same kernel image.
1725
1726config ARM64_MODULE_PLTS
1727	bool "Use PLTs to allow module memory to spill over into vmalloc area"
1728	depends on MODULES
1729	select HAVE_MOD_ARCH_SPECIFIC
1730	help
1731	  Allocate PLTs when loading modules so that jumps and calls whose
1732	  targets are too far away for their relative offsets to be encoded
1733	  in the instructions themselves can be bounced via veneers in the
1734	  module's PLT. This allows modules to be allocated in the generic
1735	  vmalloc area after the dedicated module memory area has been
1736	  exhausted.
1737
1738	  When running with address space randomization (KASLR), the module
1739	  region itself may be too far away for ordinary relative jumps and
1740	  calls, and so in that case, module PLTs are required and cannot be
1741	  disabled.
1742
1743	  Specific errata workaround(s) might also force module PLTs to be
1744	  enabled (ARM64_ERRATUM_843419).
1745
1746config ARM64_PSEUDO_NMI
1747	bool "Support for NMI-like interrupts"
1748	select ARM_GIC_V3
1749	help
1750	  Adds support for mimicking Non-Maskable Interrupts through the use of
1751	  GIC interrupt priority. This support requires version 3 or later of
1752	  ARM GIC.
1753
1754	  This high priority configuration for interrupts needs to be
1755	  explicitly enabled by setting the kernel parameter
1756	  "irqchip.gicv3_pseudo_nmi" to 1.
1757
1758	  If unsure, say N
1759
1760if ARM64_PSEUDO_NMI
1761config ARM64_DEBUG_PRIORITY_MASKING
1762	bool "Debug interrupt priority masking"
1763	help
1764	  This adds runtime checks to functions enabling/disabling
1765	  interrupts when using priority masking. The additional checks verify
1766	  the validity of ICC_PMR_EL1 when calling concerned functions.
1767
1768	  If unsure, say N
1769endif
1770
1771config RELOCATABLE
1772	bool "Build a relocatable kernel image" if EXPERT
1773	select ARCH_HAS_RELR
1774	default y
1775	help
1776	  This builds the kernel as a Position Independent Executable (PIE),
1777	  which retains all relocation metadata required to relocate the
1778	  kernel binary at runtime to a different virtual address than the
1779	  address it was linked at.
1780	  Since AArch64 uses the RELA relocation format, this requires a
1781	  relocation pass at runtime even if the kernel is loaded at the
1782	  same address it was linked at.
1783
1784config RANDOMIZE_BASE
1785	bool "Randomize the address of the kernel image"
1786	select ARM64_MODULE_PLTS if MODULES
1787	select RELOCATABLE
1788	help
1789	  Randomizes the virtual address at which the kernel image is
1790	  loaded, as a security feature that deters exploit attempts
1791	  relying on knowledge of the location of kernel internals.
1792
1793	  It is the bootloader's job to provide entropy, by passing a
1794	  random u64 value in /chosen/kaslr-seed at kernel entry.
1795
1796	  When booting via the UEFI stub, it will invoke the firmware's
1797	  EFI_RNG_PROTOCOL implementation (if available) to supply entropy
1798	  to the kernel proper. In addition, it will randomise the physical
1799	  location of the kernel Image as well.
1800
1801	  If unsure, say N.
1802
1803config RANDOMIZE_MODULE_REGION_FULL
1804	bool "Randomize the module region over a 4 GB range"
1805	depends on RANDOMIZE_BASE
1806	default y
1807	help
1808	  Randomizes the location of the module region inside a 4 GB window
1809	  covering the core kernel. This way, it is less likely for modules
1810	  to leak information about the location of core kernel data structures
1811	  but it does imply that function calls between modules and the core
1812	  kernel will need to be resolved via veneers in the module PLT.
1813
1814	  When this option is not set, the module region will be randomized over
1815	  a limited range that contains the [_stext, _etext] interval of the
1816	  core kernel, so branch relocations are always in range.
1817
1818config CC_HAVE_STACKPROTECTOR_SYSREG
1819	def_bool $(cc-option,-mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0)
1820
1821config STACKPROTECTOR_PER_TASK
1822	def_bool y
1823	depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_SYSREG
1824
1825endmenu
1826
1827menu "Boot options"
1828
1829config ARM64_ACPI_PARKING_PROTOCOL
1830	bool "Enable support for the ARM64 ACPI parking protocol"
1831	depends on ACPI
1832	help
1833	  Enable support for the ARM64 ACPI parking protocol. If disabled
1834	  the kernel will not allow booting through the ARM64 ACPI parking
1835	  protocol even if the corresponding data is present in the ACPI
1836	  MADT table.
1837
1838config CMDLINE
1839	string "Default kernel command string"
1840	default ""
1841	help
1842	  Provide a set of default command-line options at build time by
1843	  entering them here. As a minimum, you should specify the the
1844	  root device (e.g. root=/dev/nfs).
1845
1846config CMDLINE_FORCE
1847	bool "Always use the default kernel command string"
1848	depends on CMDLINE != ""
1849	help
1850	  Always use the default kernel command string, even if the boot
1851	  loader passes other arguments to the kernel.
1852	  This is useful if you cannot or don't want to change the
1853	  command-line options your boot loader passes to the kernel.
1854
1855config EFI_STUB
1856	bool
1857
1858config EFI
1859	bool "UEFI runtime support"
1860	depends on OF && !CPU_BIG_ENDIAN
1861	depends on KERNEL_MODE_NEON
1862	select ARCH_SUPPORTS_ACPI
1863	select LIBFDT
1864	select UCS2_STRING
1865	select EFI_PARAMS_FROM_FDT
1866	select EFI_RUNTIME_WRAPPERS
1867	select EFI_STUB
1868	select EFI_GENERIC_STUB
1869	default y
1870	help
1871	  This option provides support for runtime services provided
1872	  by UEFI firmware (such as non-volatile variables, realtime
1873          clock, and platform reset). A UEFI stub is also provided to
1874	  allow the kernel to be booted as an EFI application. This
1875	  is only useful on systems that have UEFI firmware.
1876
1877config DMI
1878	bool "Enable support for SMBIOS (DMI) tables"
1879	depends on EFI
1880	default y
1881	help
1882	  This enables SMBIOS/DMI feature for systems.
1883
1884	  This option is only useful on systems that have UEFI firmware.
1885	  However, even with this option, the resultant kernel should
1886	  continue to boot on existing non-UEFI platforms.
1887
1888endmenu
1889
1890config SYSVIPC_COMPAT
1891	def_bool y
1892	depends on COMPAT && SYSVIPC
1893
1894config ARCH_ENABLE_HUGEPAGE_MIGRATION
1895	def_bool y
1896	depends on HUGETLB_PAGE && MIGRATION
1897
1898menu "Power management options"
1899
1900source "kernel/power/Kconfig"
1901
1902config ARCH_HIBERNATION_POSSIBLE
1903	def_bool y
1904	depends on CPU_PM
1905
1906config ARCH_HIBERNATION_HEADER
1907	def_bool y
1908	depends on HIBERNATION
1909
1910config ARCH_SUSPEND_POSSIBLE
1911	def_bool y
1912
1913endmenu
1914
1915menu "CPU Power Management"
1916
1917source "drivers/cpuidle/Kconfig"
1918
1919source "drivers/cpufreq/Kconfig"
1920
1921endmenu
1922
1923source "drivers/firmware/Kconfig"
1924
1925source "drivers/acpi/Kconfig"
1926
1927source "arch/arm64/kvm/Kconfig"
1928
1929if CRYPTO
1930source "arch/arm64/crypto/Kconfig"
1931endif
1932