xref: /linux/arch/arm64/Kconfig (revision 8804d970fab45726b3c7cd7f240b31122aa94219)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
28c2c3df3SCatalin Marinasconfig ARM64
38c2c3df3SCatalin Marinas	def_bool y
46251d380SBesar Wicaksono	select ACPI_APMT if ACPI
5b6197b93SSuthikulpanit, Suravee	select ACPI_CCA_REQUIRED if ACPI
6d8f4f161SLorenzo Pieralisi	select ACPI_GENERIC_GSI if ACPI
75f1ae4ebSFu Wei	select ACPI_GTDT if ACPI
846800e38SGavin Shan	select ACPI_HOTPLUG_CPU if ACPI_PROCESSOR && HOTPLUG_CPU
9c6bb8f89SLorenzo Pieralisi	select ACPI_IORT if ACPI
106933de0cSAl Stone	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
1152146173SSinan Kaya	select ACPI_MCFG if (ACPI && PCI)
12888125a7SAleksey Makarov	select ACPI_SPCR_TABLE if ACPI
130ce82232SJeremy Linton	select ACPI_PPTT if ACPI
1409587a09SZong Li	select ARCH_HAS_DEBUG_WX
156dd8b1a0SCatalin Marinas	select ARCH_BINFMT_ELF_EXTRA_PHDRS
16ab7876a9SDave Martin	select ARCH_BINFMT_ELF_STATE
171e866974SAnshuman Khandual	select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
1891024b3cSAnshuman Khandual	select ARCH_ENABLE_MEMORY_HOTPLUG
1991024b3cSAnshuman Khandual	select ARCH_ENABLE_MEMORY_HOTREMOVE
2066f24fa7SAnshuman Khandual	select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
211e866974SAnshuman Khandual	select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
22c2280be8SAnshuman Khandual	select ARCH_HAS_CACHE_LINE_SIZE
2342be24a4SSuzuki K Poulose	select ARCH_HAS_CC_PLATFORM
242792d84eSKees Cook	select ARCH_HAS_CURRENT_STACK_POINTER
25ec6d06efSLaura Abbott	select ARCH_HAS_DEBUG_VIRTUAL
26399145f9SAnshuman Khandual	select ARCH_HAS_DEBUG_VM_PGTABLE
27de6c85bfSChristoph Hellwig	select ARCH_HAS_DMA_OPS if XEN
2813bf5cedSChristoph Hellwig	select ARCH_HAS_DMA_PREP_COHERENT
2938b04a74SJon Masters	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
30e75bef2aSRobin Murphy	select ARCH_HAS_FAST_MULTIPLIER
316974f0c4SDaniel Micay	select ARCH_HAS_FORTIFY_SOURCE
32957e3facSRiku Voipio	select ARCH_HAS_GCOV_PROFILE_ALL
334eb0716eSAlexandre Ghiti	select ARCH_HAS_GIGANTIC_PAGE
345e4c7549SAlexander Potapenko	select ARCH_HAS_KCOV
3571883ae3SSamuel Holland	select ARCH_HAS_KERNEL_FPU_SUPPORT if KERNEL_MODE_NEON
36d8ae8a37SChristoph Hellwig	select ARCH_HAS_KEEPINITRD
37f1e3a12bSMathieu Desnoyers	select ARCH_HAS_MEMBARRIER_SYNC_CORE
38e7bafbf7SWill Deacon	select ARCH_HAS_MEM_ENCRYPT
390061b6e1SJeff Xu	select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
406cc9203bSPaul E. McKenney	select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
410ebeea8cSDaniel Borkmann	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
4262df5870SYicong Yang	select ARCH_HAS_NONLEAF_PMD_YOUNG if ARM64_HAFT
43c8597e2dSMark Rutland	select ARCH_HAS_PREEMPT_LAZY
44f9aad622SAnshuman Khandual	select ARCH_HAS_PTDUMP
453010a5eaSLaurent Dufour	select ARCH_HAS_PTE_SPECIAL
4671ce1ab5SKinsey Ho	select ARCH_HAS_HW_PTE_YOUNG
47347cb6afSChristoph Hellwig	select ARCH_HAS_SETUP_DMA_OPS
484739d53fSArd Biesheuvel	select ARCH_HAS_SET_DIRECT_MAP
49d2852a22SDaniel Borkmann	select ARCH_HAS_SET_MEMORY
5042be24a4SSuzuki K Poulose	select ARCH_HAS_MEM_ENCRYPT
5142be24a4SSuzuki K Poulose	select ARCH_HAS_FORCE_DMA_UNENCRYPTED
525fc57df2SMark Brown	select ARCH_STACKWALK
53ad21fc4fSLaura Abbott	select ARCH_HAS_STRICT_KERNEL_RWX
54ad21fc4fSLaura Abbott	select ARCH_HAS_STRICT_MODULE_RWX
55886643b7SChristoph Hellwig	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
56886643b7SChristoph Hellwig	select ARCH_HAS_SYNC_DMA_FOR_CPU
574378a7d4SMark Rutland	select ARCH_HAS_SYSCALL_WRAPPER
581f85008eSLorenzo Pieralisi	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
5963703f37SKefeng Wang	select ARCH_HAS_ZONE_DMA_SET if EXPERT
60ab7876a9SDave Martin	select ARCH_HAVE_ELF_PROT
61396a5d4aSStephen Boyd	select ARCH_HAVE_NMI_SAFE_CMPXCHG
62d593d64fSPrasad Sodagudi	select ARCH_HAVE_TRACE_MMIO_ACCESS
637ef858daSThomas Gleixner	select ARCH_INLINE_READ_LOCK if !PREEMPTION
647ef858daSThomas Gleixner	select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
657ef858daSThomas Gleixner	select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPTION
667ef858daSThomas Gleixner	select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPTION
677ef858daSThomas Gleixner	select ARCH_INLINE_READ_UNLOCK if !PREEMPTION
687ef858daSThomas Gleixner	select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPTION
697ef858daSThomas Gleixner	select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPTION
707ef858daSThomas Gleixner	select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPTION
717ef858daSThomas Gleixner	select ARCH_INLINE_WRITE_LOCK if !PREEMPTION
727ef858daSThomas Gleixner	select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPTION
737ef858daSThomas Gleixner	select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPTION
747ef858daSThomas Gleixner	select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPTION
757ef858daSThomas Gleixner	select ARCH_INLINE_WRITE_UNLOCK if !PREEMPTION
767ef858daSThomas Gleixner	select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPTION
777ef858daSThomas Gleixner	select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPTION
787ef858daSThomas Gleixner	select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPTION
797ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPTION
807ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPTION
817ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_LOCK if !PREEMPTION
827ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPTION
837ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPTION
847ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPTION
857ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_UNLOCK if !PREEMPTION
867ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
877ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
887ef858daSThomas Gleixner	select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
89350e88baSMike Rapoport	select ARCH_KEEP_MEMBLOCK
9004d5ea46SAneesh Kumar K.V	select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
91c63c8700SSudeep Holla	select ARCH_USE_CMPXCHG_LOCKREF
92bf7f15c5SWill Deacon	select ARCH_USE_GNU_PROPERTY
93dce44566SAnshuman Khandual	select ARCH_USE_MEMTEST
94087133acSWill Deacon	select ARCH_USE_QUEUED_RWLOCKS
95c1109047SWill Deacon	select ARCH_USE_QUEUED_SPINLOCKS
9650479d58SMark Brown	select ARCH_USE_SYM_ANNOTATIONS
975d6ad668SMike Rapoport	select ARCH_SUPPORTS_DEBUG_PAGEALLOC
98855f9a8eSAnshuman Khandual	select ARCH_SUPPORTS_HUGETLBFS
99c484f256SJonathan (Zhixiong) Zhang	select ARCH_SUPPORTS_MEMORY_FAILURE
1005287569aSSami Tolvanen	select ARCH_SUPPORTS_SHADOW_CALL_STACK if CC_HAVE_SHADOW_CALL_STACK
101112b6a8eSSami Tolvanen	select ARCH_SUPPORTS_LTO_CLANG if CPU_LITTLE_ENDIAN
102112b6a8eSSami Tolvanen	select ARCH_SUPPORTS_LTO_CLANG_THIN
10323ef9d43SKees Cook	select ARCH_SUPPORTS_CFI
1044badad35SPeter Zijlstra	select ARCH_SUPPORTS_ATOMIC_RMW
10542a7ba16SNick Desaulniers	select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
10656166230SGanapatrao Kulkarni	select ARCH_SUPPORTS_NUMA_BALANCING
10742b25471SKefeng Wang	select ARCH_SUPPORTS_PAGE_TABLE_CHECK
108cd7f176aSSuren Baghdasaryan	select ARCH_SUPPORTS_PER_VMA_LOCK
1093e509c9bSPeter Xu	select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE
110d8fccd9cSSebastian Andrzej Siewior	select ARCH_SUPPORTS_RT
1117bd291abSPeter Zijlstra	select ARCH_SUPPORTS_SCHED_SMT
1127bd291abSPeter Zijlstra	select ARCH_SUPPORTS_SCHED_CLUSTER
1137bd291abSPeter Zijlstra	select ARCH_SUPPORTS_SCHED_MC
11443b3dfddSBarry Song	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
11584c187afSYury Norov	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
11681c22041SDaniel Borkmann	select ARCH_WANT_DEFAULT_BPF_JIT
11767f3977fSAlexandre Ghiti	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
118b6f35981SCatalin Marinas	select ARCH_WANT_FRAME_POINTERS
1193876d4a3SAlexandre Ghiti	select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
12059612b24SNathan Chancellor	select ARCH_WANT_LD_ORPHAN_WARN
1219456a159SAnshuman Khandual	select ARCH_WANTS_EXECMEM_LATE
12251c2ee6dSNick Desaulniers	select ARCH_WANTS_NO_INSTR
123d0637c50SBarry Song	select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES
124918327e9SKees Cook	select ARCH_HAS_UBSAN
12525c92a37SCatalin Marinas	select ARM_AMBA
1261aee5d7aSMark Rutland	select ARM_ARCH_TIMER
127c4188edcSCatalin Marinas	select ARM_GIC
128875cbf3eSAKASHI Takahiro	select AUDIT_ARCH_COMPAT_GENERIC
1293ee80364SArnd Bergmann	select ARM_GIC_V2M if PCI
130021f6537SMarc Zyngier	select ARM_GIC_V3
1313ee80364SArnd Bergmann	select ARM_GIC_V3_ITS if PCI
13253bb952aSLorenzo Pieralisi	select ARM_GIC_V5
133bff60792SMark Rutland	select ARM_PSCI_FW
13410916706SShile Zhang	select BUILDTIME_TABLE_SORT
135db2789b5SCatalin Marinas	select CLONE_BACKWARDS
1367ca2ef33SDeepak Saxena	select COMMON_CLK
137166936baSLorenzo Pieralisi	select CPU_PM if (SUSPEND || CPU_IDLE)
1383fbd56f0SChristoph Lameter (Ampere)	select CPUMASK_OFFSTACK if NR_CPUS > 256
1397bc13fd3SWill Deacon	select DCACHE_WORD_ACCESS
1409f0cb917SSteven Rostedt	select HAVE_EXTRA_IPI_TRACEPOINTS
141cfce092dSMark Rutland	select DYNAMIC_FTRACE if FUNCTION_TRACER
1421c1a429eSCatalin Marinas	select DMA_BOUNCE_UNALIGNED_KMALLOC
1430c3b3171SChristoph Hellwig	select DMA_DIRECT_REMAP
144ef37566cSCatalin Marinas	select EDAC_SUPPORT
1452f34f173SYang Shi	select FRAME_POINTER
14647a15aa5SMark Rutland	select FUNCTION_ALIGNMENT_4B
147baaf553dSMark Rutland	select FUNCTION_ALIGNMENT_8B if DYNAMIC_FTRACE_WITH_CALL_OPS
148d4932f9eSLaura Abbott	select GENERIC_ALLOCATOR
1492ef7a295SJuri Lelli	select GENERIC_ARCH_TOPOLOGY
1504b3dc967SWill Deacon	select GENERIC_CLOCKEVENTS_BROADCAST
1513be1a5c4SArd Biesheuvel	select GENERIC_CPU_AUTOPROBE
152d127db1aSJames Morse	select GENERIC_CPU_DEVICES
15361ae1321SMian Yousaf Kaukab	select GENERIC_CPU_VULNERABILITIES
154bf4b558eSMark Salter	select GENERIC_EARLY_IOREMAP
1552314ee4dSLeo Yan	select GENERIC_IDLE_POLL_SETUP
156f23eab0bSKefeng Wang	select GENERIC_IOREMAP
157b3cf0785SJinjie Ruan	select GENERIC_IRQ_ENTRY
158d3afc7f1SMarc Zyngier	select GENERIC_IRQ_IPI
159bad6722eSEliav Farber	select GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD
1608c2c3df3SCatalin Marinas	select GENERIC_IRQ_PROBE
1618c2c3df3SCatalin Marinas	select GENERIC_IRQ_SHOW
1626544e67bSSudeep Holla	select GENERIC_IRQ_SHOW_LEVEL
1636585bd82SPalmer Dabbelt	select GENERIC_LIB_DEVMEM_IS_ALLOWED
164cb61f676SArnd Bergmann	select GENERIC_PCI_IOMAP
16565cd4f6cSStephen Boyd	select GENERIC_SCHED_CLOCK
1668c2c3df3SCatalin Marinas	select GENERIC_SMP_IDLE_THREAD
1678c2c3df3SCatalin Marinas	select GENERIC_TIME_VSYSCALL
16828b1a824SVincenzo Frascino	select GENERIC_GETTIMEOFDAY
1698c2c3df3SCatalin Marinas	select HARDIRQS_SW_RESEND
170fcbfe812SNiklas Schnelle	select HAS_IOPORT
17145544eeeSKalesh Singh	select HAVE_MOVE_PMD
172f5308c89SKalesh Singh	select HAVE_MOVE_PUD
173eb01d42aSChristoph Hellwig	select HAVE_PCI
1749f9a35a7STomasz Nowicki	select HAVE_ACPI_APEI if (ACPI && EFI)
1752a19be61SVlastimil Babka	select HAVE_ALIGNED_STRUCT_PAGE
176875cbf3eSAKASHI Takahiro	select HAVE_ARCH_AUDITSYSCALL
1778e7a4cefSYalin Wang	select HAVE_ARCH_BITREVERSE
178689eae42SAmit Daniel Kachhap	select HAVE_ARCH_COMPILER_H
179e9207223SKefeng Wang	select HAVE_ARCH_HUGE_VMALLOC
180324420bfSArd Biesheuvel	select HAVE_ARCH_HUGE_VMAP
1819732cafdSJiang Liu	select HAVE_ARCH_JUMP_LABEL
182c296146cSArd Biesheuvel	select HAVE_ARCH_JUMP_LABEL_RELATIVE
1830383808eSArd Biesheuvel	select HAVE_ARCH_KASAN
18462e2397cSMasahiro Yamada	select HAVE_ARCH_KASAN_VMALLOC
18562e2397cSMasahiro Yamada	select HAVE_ARCH_KASAN_SW_TAGS
18662e2397cSMasahiro Yamada	select HAVE_ARCH_KASAN_HW_TAGS if ARM64_MTE
187dd03762aSKefeng Wang	# Some instrumentation may be unsound, hence EXPERT
188dd03762aSKefeng Wang	select HAVE_ARCH_KCSAN if EXPERT
189840b2398SMarco Elver	select HAVE_ARCH_KFENCE
1909529247dSVijaya Kumar K	select HAVE_ARCH_KGDB
19157fbad15SKees Cook	select HAVE_ARCH_KSTACK_ERASE
1928f0d3aa9SDaniel Cashman	select HAVE_ARCH_MMAP_RND_BITS
1938f0d3aa9SDaniel Cashman	select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
194271ca788SArd Biesheuvel	select HAVE_ARCH_PREL32_RELOCATIONS
19570918779SKees Cook	select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
196a1ae65b2SAKASHI Takahiro	select HAVE_ARCH_SECCOMP_FILTER
1979e8084d3SKees Cook	select HAVE_ARCH_THREAD_STRUCT_WHITELIST
1988c2c3df3SCatalin Marinas	select HAVE_ARCH_TRACEHOOK
1998ee70879SYang Shi	select HAVE_ARCH_TRANSPARENT_HUGEPAGE
200e3067861SMark Rutland	select HAVE_ARCH_VMAP_STACK
2018ee70879SYang Shi	select HAVE_ARM_SMCCC
2022ff2b7ecSMasahiro Yamada	select HAVE_ASM_MODVERSIONS
2036077776bSDaniel Borkmann	select HAVE_EBPF_JIT
204af64d2aaSAKASHI Takahiro	select HAVE_C_RECORDMCOUNT
2055284e1b4SSteve Capper	select HAVE_CMPXCHG_DOUBLE
20695eff6b2SWill Deacon	select HAVE_CMPXCHG_LOCAL
20724a9c541SFrederic Weisbecker	select HAVE_CONTEXT_TRACKING_USER
208b69ec42bSCatalin Marinas	select HAVE_DEBUG_KMEMLEAK
2096ac2104dSLaura Abbott	select HAVE_DMA_CONTIGUOUS
210bd7d38dbSAKASHI Takahiro	select HAVE_DYNAMIC_FTRACE
2112aa6ac03SFlorent Revest	select HAVE_DYNAMIC_FTRACE_WITH_ARGS \
212b3d6121eSMark Rutland		if (GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS || \
213b3d6121eSMark Rutland		    CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS)
2142aa6ac03SFlorent Revest	select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS \
2152aa6ac03SFlorent Revest		if DYNAMIC_FTRACE_WITH_ARGS && DYNAMIC_FTRACE_WITH_CALL_OPS
216baaf553dSMark Rutland	select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS \
21723ef9d43SKees Cook		if (DYNAMIC_FTRACE_WITH_ARGS && !CFI && \
218a743f26dSStephen Boyd		    (CC_IS_CLANG || !CC_OPTIMIZE_FOR_SIZE))
219a31d793dSSami Tolvanen	select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \
22026299b3fSMark Rutland		if DYNAMIC_FTRACE_WITH_ARGS
2218c3526fbSFlorent Revest	select HAVE_SAMPLE_FTRACE_DIRECT
2228c3526fbSFlorent Revest	select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
223b3d09d06SSteven Rostedt	select HAVE_BUILDTIME_MCOUNT_SORT
22450afc33aSWill Deacon	select HAVE_EFFICIENT_UNALIGNED_ACCESS
22525176ad0SDavid Hildenbrand	select HAVE_GUP_FAST
226a762e926SMasami Hiramatsu (Google)	select HAVE_FTRACE_GRAPH_FUNC
227819e50e2SAKASHI Takahiro	select HAVE_FUNCTION_TRACER
22842d038c4SLeo Yan	select HAVE_FUNCTION_ERROR_INJECTION
229a3ed4157SMasami Hiramatsu (Google)	select HAVE_FUNCTION_GRAPH_FREGS
230819e50e2SAKASHI Takahiro	select HAVE_FUNCTION_GRAPH_TRACER
2316b90bd4bSEmese Revfy	select HAVE_GCC_PLUGINS
232d7a0fe9eSDouglas Anderson	select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && \
233d7a0fe9eSDouglas Anderson		HW_PERF_EVENTS && HAVE_PERF_EVENTS_NMI
2348c2c3df3SCatalin Marinas	select HAVE_HW_BREAKPOINT if PERF_EVENTS
235893dea9cSKefeng Wang	select HAVE_IOREMAP_PROT
23624da208dSWill Deacon	select HAVE_IRQ_TIME_ACCOUNTING
2378e7a67caSCatalin Marinas	select HAVE_LIVEPATCH
238ea3752baSMark Rutland	select HAVE_MOD_ARCH_SPECIFIC
239396a5d4aSStephen Boyd	select HAVE_NMI
2408c2c3df3SCatalin Marinas	select HAVE_PERF_EVENTS
241d7a0fe9eSDouglas Anderson	select HAVE_PERF_EVENTS_NMI if ARM64_PSEUDO_NMI
2422ee0d7fdSJean Pihet	select HAVE_PERF_REGS
2432ee0d7fdSJean Pihet	select HAVE_PERF_USER_STACK_DUMP
2441b2d3451SMark Rutland	select HAVE_PREEMPT_DYNAMIC_KEY
2450a8ea52cSDavid A. Long	select HAVE_REGS_AND_STACK_ACCESS_API
2468e7a67caSCatalin Marinas	select HAVE_RELIABLE_STACKTRACE
247a68773bdSNicolas Saenz Julienne	select HAVE_POSIX_CPU_TIMERS_TASK_WORK
248a823c35fSMasami Hiramatsu	select HAVE_FUNCTION_ARG_ACCESS_API
249ff2e6d72SPeter Zijlstra	select MMU_GATHER_RCU_TABLE_FREE
250409d5db4SWill Deacon	select HAVE_RSEQ
251d077242dSAlice Ryhl	select HAVE_RUST if RUSTC_SUPPORTS_ARM64
252d148eac0SMasahiro Yamada	select HAVE_STACKPROTECTOR
253055b1212SAKASHI Takahiro	select HAVE_SYSCALL_TRACEPOINTS
2542dd0e8d2SSandeepa Prabhu	select HAVE_KPROBES
255cd1ee3b1SMasami Hiramatsu	select HAVE_KRETPROBES
25628b1a824SVincenzo Frascino	select HAVE_GENERIC_VDSO
257b3091f17SThomas Gleixner	select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
258eed4583bSYicong Yang	select HOTPLUG_SMT if HOTPLUG_CPU
2598c2c3df3SCatalin Marinas	select IRQ_DOMAIN
260e8557d1fSAnders Roxell	select IRQ_FORCED_THREADING
261727c2a53SMarc Zyngier	select JUMP_LABEL
262f6f37d93SAndrey Konovalov	select KASAN_VMALLOC if KASAN
263ae870a68SLinus Torvalds	select LOCK_MM_AND_FIND_VMA
264fea2acaaSCatalin Marinas	select MODULES_USE_ELF_RELA
265f616ab59SChristoph Hellwig	select NEED_DMA_MAP_STATE
26686596f0aSChristoph Hellwig	select NEED_SG_DMA_LENGTH
2678c2c3df3SCatalin Marinas	select OF
2688c2c3df3SCatalin Marinas	select OF_EARLY_FLATTREE
2692eac9c2dSChristoph Hellwig	select PCI_DOMAINS_GENERIC if PCI
27052146173SSinan Kaya	select PCI_ECAM if (ACPI && PCI)
27120f1b79dSChristoph Hellwig	select PCI_SYSCALL if PCI
272aa1e8ec1SCatalin Marinas	select POWER_RESET
273aa1e8ec1SCatalin Marinas	select POWER_SUPPLY
2748c2c3df3SCatalin Marinas	select SPARSE_IRQ
27509230cbcSChristoph Hellwig	select SWIOTLB
2767ac57a89SCatalin Marinas	select SYSCTL_EXCEPTION_TRACE
277c02433ddSMark Rutland	select THREAD_INFO_IN_TASK
2787677f7fdSAxel Rasmussen	select HAVE_ARCH_USERFAULTFD_MINOR if USERFAULTFD
2795b32510aSRyan Roberts	select HAVE_ARCH_USERFAULTFD_WP if USERFAULTFD
2804aae683fSMasahiro Yamada	select TRACE_IRQFLAGS_SUPPORT
2813381da25SMark Rutland	select TRACE_IRQFLAGS_NMI_SUPPORT
2828eb858c4SQi Zheng	select HAVE_SOFTIRQ_ON_OWN_STACK
283410e471fSchenqiwu	select USER_STACKTRACE_SUPPORT
284712676eaSAdhemerval Zanella	select VDSO_GETRANDOM
285ef6861b8SBreno Leitao	select VMAP_STACK
2868c2c3df3SCatalin Marinas	help
2878c2c3df3SCatalin Marinas	  ARM 64-bit (AArch64) Linux support.
2888c2c3df3SCatalin Marinas
289d077242dSAlice Ryhlconfig RUSTC_SUPPORTS_ARM64
290d077242dSAlice Ryhl	def_bool y
291d077242dSAlice Ryhl	depends on CPU_LITTLE_ENDIAN
292d077242dSAlice Ryhl	# Shadow call stack is only supported on certain rustc versions.
293d077242dSAlice Ryhl	#
294d077242dSAlice Ryhl	# When using the UNWIND_PATCH_PAC_INTO_SCS option, rustc version 1.80+ is
295d077242dSAlice Ryhl	# required due to use of the -Zfixed-x18 flag.
296d077242dSAlice Ryhl	#
297d077242dSAlice Ryhl	# Otherwise, rustc version 1.82+ is required due to use of the
298d077242dSAlice Ryhl	# -Zsanitizer=shadow-call-stack flag.
299d077242dSAlice Ryhl	depends on !SHADOW_CALL_STACK || RUSTC_VERSION >= 108200 || RUSTC_VERSION >= 108000 && UNWIND_PATCH_PAC_INTO_SCS
300d077242dSAlice Ryhl
30126299b3fSMark Rutlandconfig CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS
30245bd8951SNathan Chancellor	def_bool CC_IS_CLANG
30345bd8951SNathan Chancellor	# https://github.com/ClangBuiltLinux/linux/issues/1507
30445bd8951SNathan Chancellor	depends on AS_IS_GNU || (AS_IS_LLVM && (LD_IS_LLD || LD_VERSION >= 23600))
30545bd8951SNathan Chancellor
30626299b3fSMark Rutlandconfig GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS
30745bd8951SNathan Chancellor	def_bool CC_IS_GCC
30845bd8951SNathan Chancellor	depends on $(cc-option,-fpatchable-function-entry=2)
30945bd8951SNathan Chancellor
3108c2c3df3SCatalin Marinasconfig 64BIT
3118c2c3df3SCatalin Marinas	def_bool y
3128c2c3df3SCatalin Marinas
3138c2c3df3SCatalin Marinasconfig MMU
3148c2c3df3SCatalin Marinas	def_bool y
3158c2c3df3SCatalin Marinas
316c0d6de32SGavin Shanconfig ARM64_CONT_PTE_SHIFT
317030c4d24SMark Rutland	int
318d3e5bab9SArnd Bergmann	default 5 if PAGE_SIZE_64KB
319d3e5bab9SArnd Bergmann	default 7 if PAGE_SIZE_16KB
320030c4d24SMark Rutland	default 4
321030c4d24SMark Rutland
322e6765941SGavin Shanconfig ARM64_CONT_PMD_SHIFT
323e6765941SGavin Shan	int
324d3e5bab9SArnd Bergmann	default 5 if PAGE_SIZE_64KB
325d3e5bab9SArnd Bergmann	default 5 if PAGE_SIZE_16KB
326e6765941SGavin Shan	default 4
327e6765941SGavin Shan
3288f0d3aa9SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MIN
329d3e5bab9SArnd Bergmann	default 14 if PAGE_SIZE_64KB
330d3e5bab9SArnd Bergmann	default 16 if PAGE_SIZE_16KB
3318f0d3aa9SDaniel Cashman	default 18
3328f0d3aa9SDaniel Cashman
3338f0d3aa9SDaniel Cashman# max bits determined by the following formula:
33451ecb29fSAnshuman Khandual#  VA_BITS - PTDESC_TABLE_SHIFT
3358f0d3aa9SDaniel Cashmanconfig ARCH_MMAP_RND_BITS_MAX
3368f0d3aa9SDaniel Cashman	default 19 if ARM64_VA_BITS=36
3378f0d3aa9SDaniel Cashman	default 24 if ARM64_VA_BITS=39
3388f0d3aa9SDaniel Cashman	default 27 if ARM64_VA_BITS=42
3398f0d3aa9SDaniel Cashman	default 30 if ARM64_VA_BITS=47
340f101c564SKornel Dulęba	default 29 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) && ARM64_64K_PAGES
341f101c564SKornel Dulęba	default 31 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52) && ARM64_16K_PAGES
342f101c564SKornel Dulęba	default 33 if (ARM64_VA_BITS=48 || ARM64_VA_BITS=52)
3438f0d3aa9SDaniel Cashman	default 14 if ARM64_64K_PAGES
3448f0d3aa9SDaniel Cashman	default 16 if ARM64_16K_PAGES
3458f0d3aa9SDaniel Cashman	default 18
3468f0d3aa9SDaniel Cashman
3478f0d3aa9SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
3488f0d3aa9SDaniel Cashman	default 7 if ARM64_64K_PAGES
3498f0d3aa9SDaniel Cashman	default 9 if ARM64_16K_PAGES
3508f0d3aa9SDaniel Cashman	default 11
3518f0d3aa9SDaniel Cashman
3528f0d3aa9SDaniel Cashmanconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
3538f0d3aa9SDaniel Cashman	default 16
3548f0d3aa9SDaniel Cashman
355ce816fa8SUwe Kleine-Königconfig NO_IOPORT_MAP
356d1e6dc91SLiviu Dudau	def_bool y if !PCI
3578c2c3df3SCatalin Marinas
3588c2c3df3SCatalin Marinasconfig STACKTRACE_SUPPORT
3598c2c3df3SCatalin Marinas	def_bool y
3608c2c3df3SCatalin Marinas
361bf0c4e04SJeff Vander Stoepconfig ILLEGAL_POINTER_VALUE
362bf0c4e04SJeff Vander Stoep	hex
363bf0c4e04SJeff Vander Stoep	default 0xdead000000000000
364bf0c4e04SJeff Vander Stoep
3658c2c3df3SCatalin Marinasconfig LOCKDEP_SUPPORT
3668c2c3df3SCatalin Marinas	def_bool y
3678c2c3df3SCatalin Marinas
3689fb7410fSDave P Martinconfig GENERIC_BUG
3699fb7410fSDave P Martin	def_bool y
3709fb7410fSDave P Martin	depends on BUG
3719fb7410fSDave P Martin
3729fb7410fSDave P Martinconfig GENERIC_BUG_RELATIVE_POINTERS
3739fb7410fSDave P Martin	def_bool y
3749fb7410fSDave P Martin	depends on GENERIC_BUG
3759fb7410fSDave P Martin
3768c2c3df3SCatalin Marinasconfig GENERIC_HWEIGHT
3778c2c3df3SCatalin Marinas	def_bool y
3788c2c3df3SCatalin Marinas
3798c2c3df3SCatalin Marinasconfig GENERIC_CSUM
3808c2c3df3SCatalin Marinas	def_bool y
3818c2c3df3SCatalin Marinas
3828c2c3df3SCatalin Marinasconfig GENERIC_CALIBRATE_DELAY
3838c2c3df3SCatalin Marinas	def_bool y
3848c2c3df3SCatalin Marinas
3854b3dc967SWill Deaconconfig SMP
3864b3dc967SWill Deacon	def_bool y
3874b3dc967SWill Deacon
3884cfb3613SArd Biesheuvelconfig KERNEL_MODE_NEON
3894cfb3613SArd Biesheuvel	def_bool y
3904cfb3613SArd Biesheuvel
39192cc15fcSRob Herringconfig FIX_EARLYCON_MEM
39292cc15fcSRob Herring	def_bool y
39392cc15fcSRob Herring
3949f25e6adSKirill A. Shutemovconfig PGTABLE_LEVELS
3959f25e6adSKirill A. Shutemov	int
39621539939SSuzuki K. Poulose	default 2 if ARM64_16K_PAGES && ARM64_VA_BITS_36
3979f25e6adSKirill A. Shutemov	default 2 if ARM64_64K_PAGES && ARM64_VA_BITS_42
398b6d00d47SSteve Capper	default 3 if ARM64_64K_PAGES && (ARM64_VA_BITS_48 || ARM64_VA_BITS_52)
3999f25e6adSKirill A. Shutemov	default 3 if ARM64_4K_PAGES && ARM64_VA_BITS_39
40044eaacf1SSuzuki K. Poulose	default 3 if ARM64_16K_PAGES && ARM64_VA_BITS_47
401352b0395SArd Biesheuvel	default 4 if ARM64_16K_PAGES && (ARM64_VA_BITS_48 || ARM64_VA_BITS_52)
40244eaacf1SSuzuki K. Poulose	default 4 if !ARM64_64K_PAGES && ARM64_VA_BITS_48
403352b0395SArd Biesheuvel	default 5 if ARM64_4K_PAGES && ARM64_VA_BITS_52
4049f25e6adSKirill A. Shutemov
4059842ceaeSPratyush Anandconfig ARCH_SUPPORTS_UPROBES
4069842ceaeSPratyush Anand	def_bool y
4079842ceaeSPratyush Anand
4088f360948SArd Biesheuvelconfig ARCH_PROC_KCORE_TEXT
4098f360948SArd Biesheuvel	def_bool y
4108f360948SArd Biesheuvel
4118bf9284dSVladimir Murzinconfig BROKEN_GAS_INST
4128bf9284dSVladimir Murzin	def_bool !$(as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n)
4138bf9284dSVladimir Murzin
4149df3f508SMark Rutlandconfig BUILTIN_RETURN_ADDRESS_STRIPS_PAC
4159df3f508SMark Rutland	bool
416cf63fe35SMike Rapoport (IBM)	# Clang's __builtin_return_address() strips the PAC since 12.0.0
417fafdea34SNathan Chancellor	# https://github.com/llvm/llvm-project/commit/2a96f47c5ffca84cd774ad402cacd137f4bf45e2
418634e4ff9SNathan Chancellor	default y if CC_IS_CLANG
4199df3f508SMark Rutland	# GCC's __builtin_return_address() strips the PAC since 11.1.0,
4209df3f508SMark Rutland	# and this was backported to 10.2.0, 9.4.0, 8.5.0, but not earlier
4219df3f508SMark Rutland	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94891
4229df3f508SMark Rutland	default y if CC_IS_GCC && (GCC_VERSION >= 110100)
4239df3f508SMark Rutland	default y if CC_IS_GCC && (GCC_VERSION >= 100200) && (GCC_VERSION < 110000)
4249df3f508SMark Rutland	default y if CC_IS_GCC && (GCC_VERSION >=  90400) && (GCC_VERSION < 100000)
4259df3f508SMark Rutland	default y if CC_IS_GCC && (GCC_VERSION >=  80500) && (GCC_VERSION <  90000)
4269df3f508SMark Rutland	default n
4279df3f508SMark Rutland
4286bd1d0beSSteve Capperconfig KASAN_SHADOW_OFFSET
4296bd1d0beSSteve Capper	hex
4300fea6e9aSAndrey Konovalov	depends on KASAN_GENERIC || KASAN_SW_TAGS
431352b0395SArd Biesheuvel	default 0xdfff800000000000 if (ARM64_VA_BITS_48 || (ARM64_VA_BITS_52 && !ARM64_16K_PAGES)) && !KASAN_SW_TAGS
432352b0395SArd Biesheuvel	default 0xdfffc00000000000 if (ARM64_VA_BITS_47 || ARM64_VA_BITS_52) && ARM64_16K_PAGES && !KASAN_SW_TAGS
433f4693c27SArd Biesheuvel	default 0xdffffe0000000000 if ARM64_VA_BITS_42 && !KASAN_SW_TAGS
434f4693c27SArd Biesheuvel	default 0xdfffffc000000000 if ARM64_VA_BITS_39 && !KASAN_SW_TAGS
435f4693c27SArd Biesheuvel	default 0xdffffff800000000 if ARM64_VA_BITS_36 && !KASAN_SW_TAGS
436352b0395SArd Biesheuvel	default 0xefff800000000000 if (ARM64_VA_BITS_48 || (ARM64_VA_BITS_52 && !ARM64_16K_PAGES)) && KASAN_SW_TAGS
437352b0395SArd Biesheuvel	default 0xefffc00000000000 if (ARM64_VA_BITS_47 || ARM64_VA_BITS_52) && ARM64_16K_PAGES && KASAN_SW_TAGS
438f4693c27SArd Biesheuvel	default 0xeffffe0000000000 if ARM64_VA_BITS_42 && KASAN_SW_TAGS
439f4693c27SArd Biesheuvel	default 0xefffffc000000000 if ARM64_VA_BITS_39 && KASAN_SW_TAGS
440f4693c27SArd Biesheuvel	default 0xeffffff800000000 if ARM64_VA_BITS_36 && KASAN_SW_TAGS
4416bd1d0beSSteve Capper	default 0xffffffffffffffff
4426bd1d0beSSteve Capper
44368c76ad4SArd Biesheuvelconfig UNWIND_TABLES
44468c76ad4SArd Biesheuvel	bool
44568c76ad4SArd Biesheuvel
4466a377491SOlof Johanssonsource "arch/arm64/Kconfig.platforms"
4478c2c3df3SCatalin Marinas
4488c2c3df3SCatalin Marinasmenu "Kernel Features"
4498c2c3df3SCatalin Marinas
450c0a01b84SAndre Przywaramenu "ARM errata workarounds via the alternatives framework"
451c0a01b84SAndre Przywara
4526df696cdSOliver Uptonconfig AMPERE_ERRATUM_AC03_CPU_38
4536df696cdSOliver Upton        bool "AmpereOne: AC03_CPU_38: Certain bits in the Virtualization Translation Control Register and Translation Control Registers do not follow RES0 semantics"
4546df696cdSOliver Upton	default y
4556df696cdSOliver Upton	help
4566df696cdSOliver Upton	  This option adds an alternative code sequence to work around Ampere
457db0d8a84SD Scott Phillips	  errata AC03_CPU_38 and AC04_CPU_10 on AmpereOne.
4586df696cdSOliver Upton
4596df696cdSOliver Upton	  The affected design reports FEAT_HAFDBS as not implemented in
4606df696cdSOliver Upton	  ID_AA64MMFR1_EL1.HAFDBS, but (V)TCR_ELx.{HA,HD} are not RES0
4616df696cdSOliver Upton	  as required by the architecture. The unadvertised HAFDBS
4626df696cdSOliver Upton	  implementation suffers from an additional erratum where hardware
4636df696cdSOliver Upton	  A/D updates can occur after a PTE has been marked invalid.
4646df696cdSOliver Upton
4656df696cdSOliver Upton	  The workaround forces KVM to explicitly set VTCR_EL2.HA to 0,
4666df696cdSOliver Upton	  which avoids enabling unadvertised hardware Access Flag management
4676df696cdSOliver Upton	  at stage-2.
4686df696cdSOliver Upton
4696df696cdSOliver Upton	  If unsure, say Y.
4706df696cdSOliver Upton
471fed55f49SD Scott Phillipsconfig AMPERE_ERRATUM_AC04_CPU_23
472fed55f49SD Scott Phillips        bool "AmpereOne: AC04_CPU_23:  Failure to synchronize writes to HCR_EL2 may corrupt address translations."
473fed55f49SD Scott Phillips	default y
474fed55f49SD Scott Phillips	help
475fed55f49SD Scott Phillips	  This option adds an alternative code sequence to work around Ampere
476fed55f49SD Scott Phillips	  errata AC04_CPU_23 on AmpereOne.
477fed55f49SD Scott Phillips
478fed55f49SD Scott Phillips	  Updates to HCR_EL2 can rarely corrupt simultaneous translations for
479fed55f49SD Scott Phillips	  data addresses initiated by load/store instructions. Only
480fed55f49SD Scott Phillips	  instruction initiated translations are vulnerable, not translations
481fed55f49SD Scott Phillips	  from prefetches for example. A DSB before the store to HCR_EL2 is
482fed55f49SD Scott Phillips	  sufficient to prevent older instructions from hitting the window
483fed55f49SD Scott Phillips	  for corruption, and an ISB after is sufficient to prevent younger
484fed55f49SD Scott Phillips	  instructions from hitting the window for corruption.
485fed55f49SD Scott Phillips
486fed55f49SD Scott Phillips	  If unsure, say Y.
487fed55f49SD Scott Phillips
488c9460dcbSSuzuki K Pouloseconfig ARM64_WORKAROUND_CLEAN_CACHE
489bc15cf70SWill Deacon	bool
490c9460dcbSSuzuki K Poulose
491c0a01b84SAndre Przywaraconfig ARM64_ERRATUM_826319
492c0a01b84SAndre Przywara	bool "Cortex-A53: 826319: System might deadlock if a write cannot complete until read data is accepted"
493c0a01b84SAndre Przywara	default y
494c9460dcbSSuzuki K Poulose	select ARM64_WORKAROUND_CLEAN_CACHE
495c0a01b84SAndre Przywara	help
496c0a01b84SAndre Przywara	  This option adds an alternative code sequence to work around ARM
497c0a01b84SAndre Przywara	  erratum 826319 on Cortex-A53 parts up to r0p2 with an AMBA 4 ACE or
498c0a01b84SAndre Przywara	  AXI master interface and an L2 cache.
499c0a01b84SAndre Przywara
500c0a01b84SAndre Przywara	  If a Cortex-A53 uses an AMBA AXI4 ACE interface to other processors
501c0a01b84SAndre Przywara	  and is unable to accept a certain write via this interface, it will
502c0a01b84SAndre Przywara	  not progress on read data presented on the read data channel and the
503c0a01b84SAndre Przywara	  system can deadlock.
504c0a01b84SAndre Przywara
505c0a01b84SAndre Przywara	  The workaround promotes data cache clean instructions to
506c0a01b84SAndre Przywara	  data cache clean-and-invalidate.
507c0a01b84SAndre Przywara	  Please note that this does not necessarily enable the workaround,
508c0a01b84SAndre Przywara	  as it depends on the alternative framework, which will only patch
509c0a01b84SAndre Przywara	  the kernel if an affected CPU is detected.
510c0a01b84SAndre Przywara
511c0a01b84SAndre Przywara	  If unsure, say Y.
512c0a01b84SAndre Przywara
513c0a01b84SAndre Przywaraconfig ARM64_ERRATUM_827319
514c0a01b84SAndre Przywara	bool "Cortex-A53: 827319: Data cache clean instructions might cause overlapping transactions to the interconnect"
515c0a01b84SAndre Przywara	default y
516c9460dcbSSuzuki K Poulose	select ARM64_WORKAROUND_CLEAN_CACHE
517c0a01b84SAndre Przywara	help
518c0a01b84SAndre Przywara	  This option adds an alternative code sequence to work around ARM
519c0a01b84SAndre Przywara	  erratum 827319 on Cortex-A53 parts up to r0p2 with an AMBA 5 CHI
520c0a01b84SAndre Przywara	  master interface and an L2 cache.
521c0a01b84SAndre Przywara
522c0a01b84SAndre Przywara	  Under certain conditions this erratum can cause a clean line eviction
523c0a01b84SAndre Przywara	  to occur at the same time as another transaction to the same address
524c0a01b84SAndre Przywara	  on the AMBA 5 CHI interface, which can cause data corruption if the
525c0a01b84SAndre Przywara	  interconnect reorders the two transactions.
526c0a01b84SAndre Przywara
527c0a01b84SAndre Przywara	  The workaround promotes data cache clean instructions to
528c0a01b84SAndre Przywara	  data cache clean-and-invalidate.
529c0a01b84SAndre Przywara	  Please note that this does not necessarily enable the workaround,
530c0a01b84SAndre Przywara	  as it depends on the alternative framework, which will only patch
531c0a01b84SAndre Przywara	  the kernel if an affected CPU is detected.
532c0a01b84SAndre Przywara
533c0a01b84SAndre Przywara	  If unsure, say Y.
534c0a01b84SAndre Przywara
535c0a01b84SAndre Przywaraconfig ARM64_ERRATUM_824069
536c0a01b84SAndre Przywara	bool "Cortex-A53: 824069: Cache line might not be marked as clean after a CleanShared snoop"
537c0a01b84SAndre Przywara	default y
538c9460dcbSSuzuki K Poulose	select ARM64_WORKAROUND_CLEAN_CACHE
539c0a01b84SAndre Przywara	help
540c0a01b84SAndre Przywara	  This option adds an alternative code sequence to work around ARM
541c0a01b84SAndre Przywara	  erratum 824069 on Cortex-A53 parts up to r0p2 when it is connected
542c0a01b84SAndre Przywara	  to a coherent interconnect.
543c0a01b84SAndre Przywara
544c0a01b84SAndre Przywara	  If a Cortex-A53 processor is executing a store or prefetch for
545c0a01b84SAndre Przywara	  write instruction at the same time as a processor in another
546c0a01b84SAndre Przywara	  cluster is executing a cache maintenance operation to the same
547c0a01b84SAndre Przywara	  address, then this erratum might cause a clean cache line to be
548c0a01b84SAndre Przywara	  incorrectly marked as dirty.
549c0a01b84SAndre Przywara
550c0a01b84SAndre Przywara	  The workaround promotes data cache clean instructions to
551c0a01b84SAndre Przywara	  data cache clean-and-invalidate.
552c0a01b84SAndre Przywara	  Please note that this option does not necessarily enable the
553c0a01b84SAndre Przywara	  workaround, as it depends on the alternative framework, which will
554c0a01b84SAndre Przywara	  only patch the kernel if an affected CPU is detected.
555c0a01b84SAndre Przywara
556c0a01b84SAndre Przywara	  If unsure, say Y.
557c0a01b84SAndre Przywara
558c0a01b84SAndre Przywaraconfig ARM64_ERRATUM_819472
559c0a01b84SAndre Przywara	bool "Cortex-A53: 819472: Store exclusive instructions might cause data corruption"
560c0a01b84SAndre Przywara	default y
561c9460dcbSSuzuki K Poulose	select ARM64_WORKAROUND_CLEAN_CACHE
562c0a01b84SAndre Przywara	help
563c0a01b84SAndre Przywara	  This option adds an alternative code sequence to work around ARM
564c0a01b84SAndre Przywara	  erratum 819472 on Cortex-A53 parts up to r0p1 with an L2 cache
565c0a01b84SAndre Przywara	  present when it is connected to a coherent interconnect.
566c0a01b84SAndre Przywara
567c0a01b84SAndre Przywara	  If the processor is executing a load and store exclusive sequence at
568c0a01b84SAndre Przywara	  the same time as a processor in another cluster is executing a cache
569c0a01b84SAndre Przywara	  maintenance operation to the same address, then this erratum might
570c0a01b84SAndre Przywara	  cause data corruption.
571c0a01b84SAndre Przywara
572c0a01b84SAndre Przywara	  The workaround promotes data cache clean instructions to
573c0a01b84SAndre Przywara	  data cache clean-and-invalidate.
574c0a01b84SAndre Przywara	  Please note that this does not necessarily enable the workaround,
575c0a01b84SAndre Przywara	  as it depends on the alternative framework, which will only patch
576c0a01b84SAndre Przywara	  the kernel if an affected CPU is detected.
577c0a01b84SAndre Przywara
578c0a01b84SAndre Przywara	  If unsure, say Y.
579c0a01b84SAndre Przywara
580c0a01b84SAndre Przywaraconfig ARM64_ERRATUM_832075
581c0a01b84SAndre Przywara	bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads"
582c0a01b84SAndre Przywara	default y
583c0a01b84SAndre Przywara	help
584c0a01b84SAndre Przywara	  This option adds an alternative code sequence to work around ARM
585c0a01b84SAndre Przywara	  erratum 832075 on Cortex-A57 parts up to r1p2.
586c0a01b84SAndre Przywara
587c0a01b84SAndre Przywara	  Affected Cortex-A57 parts might deadlock when exclusive load/store
588c0a01b84SAndre Przywara	  instructions to Write-Back memory are mixed with Device loads.
589c0a01b84SAndre Przywara
590c0a01b84SAndre Przywara	  The workaround is to promote device loads to use Load-Acquire
591c0a01b84SAndre Przywara	  semantics.
592c0a01b84SAndre Przywara	  Please note that this does not necessarily enable the workaround,
593c0a01b84SAndre Przywara	  as it depends on the alternative framework, which will only patch
594c0a01b84SAndre Przywara	  the kernel if an affected CPU is detected.
595c0a01b84SAndre Przywara
596c0a01b84SAndre Przywara	  If unsure, say Y.
597c0a01b84SAndre Przywara
598498cd5c3SMarc Zyngierconfig ARM64_ERRATUM_834220
5998c10cc10SWill Deacon	bool "Cortex-A57: 834220: Stage 2 translation fault might be incorrectly reported in presence of a Stage 1 fault (rare)"
600498cd5c3SMarc Zyngier	depends on KVM
601498cd5c3SMarc Zyngier	help
602498cd5c3SMarc Zyngier	  This option adds an alternative code sequence to work around ARM
603498cd5c3SMarc Zyngier	  erratum 834220 on Cortex-A57 parts up to r1p2.
604498cd5c3SMarc Zyngier
605498cd5c3SMarc Zyngier	  Affected Cortex-A57 parts might report a Stage 2 translation
606498cd5c3SMarc Zyngier	  fault as the result of a Stage 1 fault for load crossing a
607498cd5c3SMarc Zyngier	  page boundary when there is a permission or device memory
608498cd5c3SMarc Zyngier	  alignment fault at Stage 1 and a translation fault at Stage 2.
609498cd5c3SMarc Zyngier
610498cd5c3SMarc Zyngier	  The workaround is to verify that the Stage 1 translation
611498cd5c3SMarc Zyngier	  doesn't generate a fault before handling the Stage 2 fault.
612498cd5c3SMarc Zyngier	  Please note that this does not necessarily enable the workaround,
613498cd5c3SMarc Zyngier	  as it depends on the alternative framework, which will only patch
614498cd5c3SMarc Zyngier	  the kernel if an affected CPU is detected.
615498cd5c3SMarc Zyngier
6168c10cc10SWill Deacon	  If unsure, say N.
617498cd5c3SMarc Zyngier
61844b3834bSJames Morseconfig ARM64_ERRATUM_1742098
61944b3834bSJames Morse	bool "Cortex-A57/A72: 1742098: ELR recorded incorrectly on interrupt taken between cryptographic instructions in a sequence"
62044b3834bSJames Morse	depends on COMPAT
62144b3834bSJames Morse	default y
62244b3834bSJames Morse	help
62344b3834bSJames Morse	  This option removes the AES hwcap for aarch32 user-space to
62444b3834bSJames Morse	  workaround erratum 1742098 on Cortex-A57 and Cortex-A72.
62544b3834bSJames Morse
62644b3834bSJames Morse	  Affected parts may corrupt the AES state if an interrupt is
62744b3834bSJames Morse	  taken between a pair of AES instructions. These instructions
62844b3834bSJames Morse	  are only present if the cryptography extensions are present.
62944b3834bSJames Morse	  All software should have a fallback implementation for CPUs
63044b3834bSJames Morse	  that don't implement the cryptography extensions.
63144b3834bSJames Morse
63244b3834bSJames Morse	  If unsure, say Y.
63344b3834bSJames Morse
634905e8c5dSWill Deaconconfig ARM64_ERRATUM_845719
635905e8c5dSWill Deacon	bool "Cortex-A53: 845719: a load might read incorrect data"
636905e8c5dSWill Deacon	depends on COMPAT
637905e8c5dSWill Deacon	default y
638905e8c5dSWill Deacon	help
639905e8c5dSWill Deacon	  This option adds an alternative code sequence to work around ARM
640905e8c5dSWill Deacon	  erratum 845719 on Cortex-A53 parts up to r0p4.
641905e8c5dSWill Deacon
642905e8c5dSWill Deacon	  When running a compat (AArch32) userspace on an affected Cortex-A53
643905e8c5dSWill Deacon	  part, a load at EL0 from a virtual address that matches the bottom 32
644905e8c5dSWill Deacon	  bits of the virtual address used by a recent load at (AArch64) EL1
645905e8c5dSWill Deacon	  might return incorrect data.
646905e8c5dSWill Deacon
647905e8c5dSWill Deacon	  The workaround is to write the contextidr_el1 register on exception
648905e8c5dSWill Deacon	  return to a 32-bit task.
649905e8c5dSWill Deacon	  Please note that this does not necessarily enable the workaround,
650905e8c5dSWill Deacon	  as it depends on the alternative framework, which will only patch
651905e8c5dSWill Deacon	  the kernel if an affected CPU is detected.
652905e8c5dSWill Deacon
653905e8c5dSWill Deacon	  If unsure, say Y.
654905e8c5dSWill Deacon
655df057cc7SWill Deaconconfig ARM64_ERRATUM_843419
656df057cc7SWill Deacon	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
657df057cc7SWill Deacon	default y
658df057cc7SWill Deacon	help
6596ffe9923SWill Deacon	  This option links the kernel with '--fix-cortex-a53-843419' and
660a257e025SArd Biesheuvel	  enables PLT support to replace certain ADRP instructions, which can
661a257e025SArd Biesheuvel	  cause subsequent memory accesses to use an incorrect address on
662a257e025SArd Biesheuvel	  Cortex-A53 parts up to r0p4.
663df057cc7SWill Deacon
664df057cc7SWill Deacon	  If unsure, say Y.
665df057cc7SWill Deacon
666ece1397cSSuzuki K Pouloseconfig ARM64_ERRATUM_1024718
667ece1397cSSuzuki K Poulose	bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
668ece1397cSSuzuki K Poulose	default y
669ece1397cSSuzuki K Poulose	help
670bc15cf70SWill Deacon	  This option adds a workaround for ARM Cortex-A55 Erratum 1024718.
671ece1397cSSuzuki K Poulose
672c0b15c25SSuzuki K Poulose	  Affected Cortex-A55 cores (all revisions) could cause incorrect
673ece1397cSSuzuki K Poulose	  update of the hardware dirty bit when the DBM/AP bits are updated
674ece1397cSSuzuki K Poulose	  without a break-before-make. The workaround is to disable the usage
675ece1397cSSuzuki K Poulose	  of hardware DBM locally on the affected cores. CPUs not affected by
676bc15cf70SWill Deacon	  this erratum will continue to use the feature.
677e41ceed0SJungseok Lee
6788c2c3df3SCatalin Marinas	  If unsure, say Y.
679e41ceed0SJungseok Lee
680a5325089SMarc Zyngierconfig ARM64_ERRATUM_1418040
6816989303aSMarc Zyngier	bool "Cortex-A76/Neoverse-N1: MRC read following MRRC read of specific Generic Timer in AArch32 might give incorrect result"
68295b861a4SMarc Zyngier	default y
683c2b5bba3SMarc Zyngier	depends on COMPAT
68495b861a4SMarc Zyngier	help
68524cf262dSWill Deacon	  This option adds a workaround for ARM Cortex-A76/Neoverse-N1
686a5325089SMarc Zyngier	  errata 1188873 and 1418040.
68795b861a4SMarc Zyngier
688a5325089SMarc Zyngier	  Affected Cortex-A76/Neoverse-N1 cores (r0p0 to r3p1) could
6896989303aSMarc Zyngier	  cause register corruption when accessing the timer registers
6906989303aSMarc Zyngier	  from AArch32 userspace.
69195b861a4SMarc Zyngier
69295b861a4SMarc Zyngier	  If unsure, say Y.
69395b861a4SMarc Zyngier
69402ab1f50SAndrew Scullconfig ARM64_WORKAROUND_SPECULATIVE_AT
695e85d68faSSteven Price	bool
696e85d68faSSteven Price
697a457b0f7SMarc Zyngierconfig ARM64_ERRATUM_1165522
69802ab1f50SAndrew Scull	bool "Cortex-A76: 1165522: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
699a457b0f7SMarc Zyngier	default y
70002ab1f50SAndrew Scull	select ARM64_WORKAROUND_SPECULATIVE_AT
701a457b0f7SMarc Zyngier	help
702bc15cf70SWill Deacon	  This option adds a workaround for ARM Cortex-A76 erratum 1165522.
703a457b0f7SMarc Zyngier
704a457b0f7SMarc Zyngier	  Affected Cortex-A76 cores (r0p0, r1p0, r2p0) could end-up with
705a457b0f7SMarc Zyngier	  corrupted TLBs by speculating an AT instruction during a guest
706a457b0f7SMarc Zyngier	  context switch.
707a457b0f7SMarc Zyngier
708a457b0f7SMarc Zyngier	  If unsure, say Y.
709a457b0f7SMarc Zyngier
71002ab1f50SAndrew Scullconfig ARM64_ERRATUM_1319367
71102ab1f50SAndrew Scull	bool "Cortex-A57/A72: 1319537: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
712275fa0eaSSteven Price	default y
71302ab1f50SAndrew Scull	select ARM64_WORKAROUND_SPECULATIVE_AT
71402ab1f50SAndrew Scull	help
71502ab1f50SAndrew Scull	  This option adds work arounds for ARM Cortex-A57 erratum 1319537
71602ab1f50SAndrew Scull	  and A72 erratum 1319367
71702ab1f50SAndrew Scull
71802ab1f50SAndrew Scull	  Cortex-A57 and A72 cores could end-up with corrupted TLBs by
71902ab1f50SAndrew Scull	  speculating an AT instruction during a guest context switch.
72002ab1f50SAndrew Scull
72102ab1f50SAndrew Scull	  If unsure, say Y.
72202ab1f50SAndrew Scull
72302ab1f50SAndrew Scullconfig ARM64_ERRATUM_1530923
72402ab1f50SAndrew Scull	bool "Cortex-A55: 1530923: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
72502ab1f50SAndrew Scull	default y
72602ab1f50SAndrew Scull	select ARM64_WORKAROUND_SPECULATIVE_AT
727275fa0eaSSteven Price	help
728275fa0eaSSteven Price	  This option adds a workaround for ARM Cortex-A55 erratum 1530923.
729275fa0eaSSteven Price
730275fa0eaSSteven Price	  Affected Cortex-A55 cores (r0p0, r0p1, r1p0, r2p0) could end-up with
731275fa0eaSSteven Price	  corrupted TLBs by speculating an AT instruction during a guest
732275fa0eaSSteven Price	  context switch.
733275fa0eaSSteven Price
734275fa0eaSSteven Price	  If unsure, say Y.
735275fa0eaSSteven Price
736ebcea694SGeert Uytterhoevenconfig ARM64_WORKAROUND_REPEAT_TLBI
737ebcea694SGeert Uytterhoeven	bool
738ebcea694SGeert Uytterhoeven
739171df580SJames Morseconfig ARM64_ERRATUM_2441007
7408c10cc10SWill Deacon	bool "Cortex-A55: Completion of affected memory accesses might not be guaranteed by completion of a TLBI (rare)"
741171df580SJames Morse	select ARM64_WORKAROUND_REPEAT_TLBI
742171df580SJames Morse	help
743171df580SJames Morse	  This option adds a workaround for ARM Cortex-A55 erratum #2441007.
744171df580SJames Morse
745171df580SJames Morse	  Under very rare circumstances, affected Cortex-A55 CPUs
746171df580SJames Morse	  may not handle a race between a break-before-make sequence on one
747171df580SJames Morse	  CPU, and another CPU accessing the same page. This could allow a
748171df580SJames Morse	  store to a page that has been unmapped.
749171df580SJames Morse
750171df580SJames Morse	  Work around this by adding the affected CPUs to the list that needs
751171df580SJames Morse	  TLB sequences to be done twice.
752171df580SJames Morse
7538c10cc10SWill Deacon	  If unsure, say N.
754171df580SJames Morse
755ce8c80c5SCatalin Marinasconfig ARM64_ERRATUM_1286807
7568c10cc10SWill Deacon	bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation (rare)"
757ce8c80c5SCatalin Marinas	select ARM64_WORKAROUND_REPEAT_TLBI
758ce8c80c5SCatalin Marinas	help
759bc15cf70SWill Deacon	  This option adds a workaround for ARM Cortex-A76 erratum 1286807.
760ce8c80c5SCatalin Marinas
761ce8c80c5SCatalin Marinas	  On the affected Cortex-A76 cores (r0p0 to r3p0), if a virtual
762ce8c80c5SCatalin Marinas	  address for a cacheable mapping of a location is being
763ce8c80c5SCatalin Marinas	  accessed by a core while another core is remapping the virtual
764ce8c80c5SCatalin Marinas	  address to a new physical page using the recommended
765ce8c80c5SCatalin Marinas	  break-before-make sequence, then under very rare circumstances
766ce8c80c5SCatalin Marinas	  TLBI+DSB completes before a read using the translation being
767ce8c80c5SCatalin Marinas	  invalidated has been observed by other observers. The
768ce8c80c5SCatalin Marinas	  workaround repeats the TLBI+DSB operation.
769ce8c80c5SCatalin Marinas
7708c10cc10SWill Deacon	  If unsure, say N.
7718c10cc10SWill Deacon
772969f5ea6SWill Deaconconfig ARM64_ERRATUM_1463225
773969f5ea6SWill Deacon	bool "Cortex-A76: Software Step might prevent interrupt recognition"
774969f5ea6SWill Deacon	default y
775969f5ea6SWill Deacon	help
776969f5ea6SWill Deacon	  This option adds a workaround for Arm Cortex-A76 erratum 1463225.
777969f5ea6SWill Deacon
778969f5ea6SWill Deacon	  On the affected Cortex-A76 cores (r0p0 to r3p1), software stepping
779969f5ea6SWill Deacon	  of a system call instruction (SVC) can prevent recognition of
780969f5ea6SWill Deacon	  subsequent interrupts when software stepping is disabled in the
781969f5ea6SWill Deacon	  exception handler of the system call and either kernel debugging
782969f5ea6SWill Deacon	  is enabled or VHE is in use.
783969f5ea6SWill Deacon
784969f5ea6SWill Deacon	  Work around the erratum by triggering a dummy step exception
785969f5ea6SWill Deacon	  when handling a system call from a task that is being stepped
786969f5ea6SWill Deacon	  in a VHE configuration of the kernel.
787969f5ea6SWill Deacon
788969f5ea6SWill Deacon	  If unsure, say Y.
789969f5ea6SWill Deacon
79005460849SJames Morseconfig ARM64_ERRATUM_1542419
7918c10cc10SWill Deacon	bool "Neoverse-N1: workaround mis-ordering of instruction fetches (rare)"
79205460849SJames Morse	help
79305460849SJames Morse	  This option adds a workaround for ARM Neoverse-N1 erratum
79405460849SJames Morse	  1542419.
79505460849SJames Morse
79605460849SJames Morse	  Affected Neoverse-N1 cores could execute a stale instruction when
79705460849SJames Morse	  modified by another CPU. The workaround depends on a firmware
79805460849SJames Morse	  counterpart.
79905460849SJames Morse
80005460849SJames Morse	  Workaround the issue by hiding the DIC feature from EL0. This
80105460849SJames Morse	  forces user-space to perform cache maintenance.
80205460849SJames Morse
8038c10cc10SWill Deacon	  If unsure, say N.
80405460849SJames Morse
80596d389caSRob Herringconfig ARM64_ERRATUM_1508412
80696d389caSRob Herring	bool "Cortex-A77: 1508412: workaround deadlock on sequence of NC/Device load and store exclusive or PAR read"
80796d389caSRob Herring	default y
80896d389caSRob Herring	help
80996d389caSRob Herring	  This option adds a workaround for Arm Cortex-A77 erratum 1508412.
81096d389caSRob Herring
81196d389caSRob Herring	  Affected Cortex-A77 cores (r0p0, r1p0) could deadlock on a sequence
81296d389caSRob Herring	  of a store-exclusive or read of PAR_EL1 and a load with device or
81396d389caSRob Herring	  non-cacheable memory attributes. The workaround depends on a firmware
81496d389caSRob Herring	  counterpart.
81596d389caSRob Herring
81696d389caSRob Herring	  KVM guests must also have the workaround implemented or they can
81796d389caSRob Herring	  deadlock the system.
81896d389caSRob Herring
81996d389caSRob Herring	  Work around the issue by inserting DMB SY barriers around PAR_EL1
82096d389caSRob Herring	  register reads and warning KVM users. The DMB barrier is sufficient
82196d389caSRob Herring	  to prevent a speculative PAR_EL1 read.
82296d389caSRob Herring
82396d389caSRob Herring	  If unsure, say Y.
82496d389caSRob Herring
825b9d216fcSSuzuki K Pouloseconfig ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
826b9d216fcSSuzuki K Poulose	bool
827b9d216fcSSuzuki K Poulose
828297ae1ebSJames Morseconfig ARM64_ERRATUM_2051678
829297ae1ebSJames Morse	bool "Cortex-A510: 2051678: disable Hardware Update of the page table dirty bit"
830a4b92cebSMark Brown	default y
831297ae1ebSJames Morse	help
832297ae1ebSJames Morse	  This options adds the workaround for ARM Cortex-A510 erratum ARM64_ERRATUM_2051678.
8330ff74a23SKen Kurematsu	  Affected Cortex-A510 might not respect the ordering rules for
834297ae1ebSJames Morse	  hardware update of the page table's dirty bit. The workaround
835297ae1ebSJames Morse	  is to not enable the feature on affected CPUs.
836297ae1ebSJames Morse
837297ae1ebSJames Morse	  If unsure, say Y.
838297ae1ebSJames Morse
8391dd498e5SJames Morseconfig ARM64_ERRATUM_2077057
8401dd498e5SJames Morse	bool "Cortex-A510: 2077057: workaround software-step corrupting SPSR_EL2"
8414c11113cSMark Brown	default y
8421dd498e5SJames Morse	help
8431dd498e5SJames Morse	  This option adds the workaround for ARM Cortex-A510 erratum 2077057.
8441dd498e5SJames Morse	  Affected Cortex-A510 may corrupt SPSR_EL2 when the a step exception is
8451dd498e5SJames Morse	  expected, but a Pointer Authentication trap is taken instead. The
8461dd498e5SJames Morse	  erratum causes SPSR_EL1 to be copied to SPSR_EL2, which could allow
8471dd498e5SJames Morse	  EL1 to cause a return to EL2 with a guest controlled ELR_EL2.
8481dd498e5SJames Morse
8491dd498e5SJames Morse	  This can only happen when EL2 is stepping EL1.
8501dd498e5SJames Morse
8511dd498e5SJames Morse	  When these conditions occur, the SPSR_EL2 value is unchanged from the
8521dd498e5SJames Morse	  previous guest entry, and can be restored from the in-memory copy.
8531dd498e5SJames Morse
8541dd498e5SJames Morse	  If unsure, say Y.
8551dd498e5SJames Morse
8561bdb0fbbSJames Morseconfig ARM64_ERRATUM_2658417
8571bdb0fbbSJames Morse	bool "Cortex-A510: 2658417: remove BF16 support due to incorrect result"
8581bdb0fbbSJames Morse	default y
8591bdb0fbbSJames Morse	help
8601bdb0fbbSJames Morse	  This option adds the workaround for ARM Cortex-A510 erratum 2658417.
8611bdb0fbbSJames Morse	  Affected Cortex-A510 (r0p0 to r1p1) may produce the wrong result for
8621bdb0fbbSJames Morse	  BFMMLA or VMMLA instructions in rare circumstances when a pair of
8631bdb0fbbSJames Morse	  A510 CPUs are using shared neon hardware. As the sharing is not
8641bdb0fbbSJames Morse	  discoverable by the kernel, hide the BF16 HWCAP to indicate that
8651bdb0fbbSJames Morse	  user-space should not be using these instructions.
8661bdb0fbbSJames Morse
8671bdb0fbbSJames Morse	  If unsure, say Y.
8681bdb0fbbSJames Morse
869b9d216fcSSuzuki K Pouloseconfig ARM64_ERRATUM_2119858
870eb30d838SAnshuman Khandual	bool "Cortex-A710/X2: 2119858: workaround TRBE overwriting trace data in FILL mode"
871b9d216fcSSuzuki K Poulose	default y
872b9d216fcSSuzuki K Poulose	depends on CORESIGHT_TRBE
873b9d216fcSSuzuki K Poulose	select ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
874b9d216fcSSuzuki K Poulose	help
875eb30d838SAnshuman Khandual	  This option adds the workaround for ARM Cortex-A710/X2 erratum 2119858.
876b9d216fcSSuzuki K Poulose
877eb30d838SAnshuman Khandual	  Affected Cortex-A710/X2 cores could overwrite up to 3 cache lines of trace
878b9d216fcSSuzuki K Poulose	  data at the base of the buffer (pointed to by TRBASER_EL1) in FILL mode in
879b9d216fcSSuzuki K Poulose	  the event of a WRAP event.
880b9d216fcSSuzuki K Poulose
881b9d216fcSSuzuki K Poulose	  Work around the issue by always making sure we move the TRBPTR_EL1 by
882b9d216fcSSuzuki K Poulose	  256 bytes before enabling the buffer and filling the first 256 bytes of
883b9d216fcSSuzuki K Poulose	  the buffer with ETM ignore packets upon disabling.
884b9d216fcSSuzuki K Poulose
885b9d216fcSSuzuki K Poulose	  If unsure, say Y.
886b9d216fcSSuzuki K Poulose
887b9d216fcSSuzuki K Pouloseconfig ARM64_ERRATUM_2139208
888b9d216fcSSuzuki K Poulose	bool "Neoverse-N2: 2139208: workaround TRBE overwriting trace data in FILL mode"
889b9d216fcSSuzuki K Poulose	default y
890b9d216fcSSuzuki K Poulose	depends on CORESIGHT_TRBE
891b9d216fcSSuzuki K Poulose	select ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
892b9d216fcSSuzuki K Poulose	help
893b9d216fcSSuzuki K Poulose	  This option adds the workaround for ARM Neoverse-N2 erratum 2139208.
894b9d216fcSSuzuki K Poulose
895b9d216fcSSuzuki K Poulose	  Affected Neoverse-N2 cores could overwrite up to 3 cache lines of trace
896b9d216fcSSuzuki K Poulose	  data at the base of the buffer (pointed to by TRBASER_EL1) in FILL mode in
897b9d216fcSSuzuki K Poulose	  the event of a WRAP event.
898b9d216fcSSuzuki K Poulose
899b9d216fcSSuzuki K Poulose	  Work around the issue by always making sure we move the TRBPTR_EL1 by
900b9d216fcSSuzuki K Poulose	  256 bytes before enabling the buffer and filling the first 256 bytes of
901b9d216fcSSuzuki K Poulose	  the buffer with ETM ignore packets upon disabling.
902b9d216fcSSuzuki K Poulose
903b9d216fcSSuzuki K Poulose	  If unsure, say Y.
904b9d216fcSSuzuki K Poulose
905fa82d0b4SSuzuki K Pouloseconfig ARM64_WORKAROUND_TSB_FLUSH_FAILURE
906fa82d0b4SSuzuki K Poulose	bool
907fa82d0b4SSuzuki K Poulose
908fa82d0b4SSuzuki K Pouloseconfig ARM64_ERRATUM_2054223
909fa82d0b4SSuzuki K Poulose	bool "Cortex-A710: 2054223: workaround TSB instruction failing to flush trace"
910fa82d0b4SSuzuki K Poulose	default y
911fa82d0b4SSuzuki K Poulose	select ARM64_WORKAROUND_TSB_FLUSH_FAILURE
912fa82d0b4SSuzuki K Poulose	help
913fa82d0b4SSuzuki K Poulose	  Enable workaround for ARM Cortex-A710 erratum 2054223
914fa82d0b4SSuzuki K Poulose
915fa82d0b4SSuzuki K Poulose	  Affected cores may fail to flush the trace data on a TSB instruction, when
916fa82d0b4SSuzuki K Poulose	  the PE is in trace prohibited state. This will cause losing a few bytes
917fa82d0b4SSuzuki K Poulose	  of the trace cached.
918fa82d0b4SSuzuki K Poulose
919fa82d0b4SSuzuki K Poulose	  Workaround is to issue two TSB consecutively on affected cores.
920fa82d0b4SSuzuki K Poulose
921fa82d0b4SSuzuki K Poulose	  If unsure, say Y.
922fa82d0b4SSuzuki K Poulose
923fa82d0b4SSuzuki K Pouloseconfig ARM64_ERRATUM_2067961
924fa82d0b4SSuzuki K Poulose	bool "Neoverse-N2: 2067961: workaround TSB instruction failing to flush trace"
925fa82d0b4SSuzuki K Poulose	default y
926fa82d0b4SSuzuki K Poulose	select ARM64_WORKAROUND_TSB_FLUSH_FAILURE
927fa82d0b4SSuzuki K Poulose	help
928fa82d0b4SSuzuki K Poulose	  Enable workaround for ARM Neoverse-N2 erratum 2067961
929fa82d0b4SSuzuki K Poulose
930fa82d0b4SSuzuki K Poulose	  Affected cores may fail to flush the trace data on a TSB instruction, when
931fa82d0b4SSuzuki K Poulose	  the PE is in trace prohibited state. This will cause losing a few bytes
932fa82d0b4SSuzuki K Poulose	  of the trace cached.
933fa82d0b4SSuzuki K Poulose
934fa82d0b4SSuzuki K Poulose	  Workaround is to issue two TSB consecutively on affected cores.
935fa82d0b4SSuzuki K Poulose
936fa82d0b4SSuzuki K Poulose	  If unsure, say Y.
937fa82d0b4SSuzuki K Poulose
9388d81b2a3SSuzuki K Pouloseconfig ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
9398d81b2a3SSuzuki K Poulose	bool
9408d81b2a3SSuzuki K Poulose
9418d81b2a3SSuzuki K Pouloseconfig ARM64_ERRATUM_2253138
9428d81b2a3SSuzuki K Poulose	bool "Neoverse-N2: 2253138: workaround TRBE writing to address out-of-range"
9438d81b2a3SSuzuki K Poulose	depends on CORESIGHT_TRBE
9448d81b2a3SSuzuki K Poulose	default y
9458d81b2a3SSuzuki K Poulose	select ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
9468d81b2a3SSuzuki K Poulose	help
9478d81b2a3SSuzuki K Poulose	  This option adds the workaround for ARM Neoverse-N2 erratum 2253138.
9488d81b2a3SSuzuki K Poulose
9498d81b2a3SSuzuki K Poulose	  Affected Neoverse-N2 cores might write to an out-of-range address, not reserved
9508d81b2a3SSuzuki K Poulose	  for TRBE. Under some conditions, the TRBE might generate a write to the next
9518d81b2a3SSuzuki K Poulose	  virtually addressed page following the last page of the TRBE address space
9528d81b2a3SSuzuki K Poulose	  (i.e., the TRBLIMITR_EL1.LIMIT), instead of wrapping around to the base.
9538d81b2a3SSuzuki K Poulose
9548d81b2a3SSuzuki K Poulose	  Work around this in the driver by always making sure that there is a
9558d81b2a3SSuzuki K Poulose	  page beyond the TRBLIMITR_EL1.LIMIT, within the space allowed for the TRBE.
9568d81b2a3SSuzuki K Poulose
9578d81b2a3SSuzuki K Poulose	  If unsure, say Y.
9588d81b2a3SSuzuki K Poulose
9598d81b2a3SSuzuki K Pouloseconfig ARM64_ERRATUM_2224489
960eb30d838SAnshuman Khandual	bool "Cortex-A710/X2: 2224489: workaround TRBE writing to address out-of-range"
9618d81b2a3SSuzuki K Poulose	depends on CORESIGHT_TRBE
9628d81b2a3SSuzuki K Poulose	default y
9638d81b2a3SSuzuki K Poulose	select ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
9648d81b2a3SSuzuki K Poulose	help
965eb30d838SAnshuman Khandual	  This option adds the workaround for ARM Cortex-A710/X2 erratum 2224489.
9668d81b2a3SSuzuki K Poulose
967eb30d838SAnshuman Khandual	  Affected Cortex-A710/X2 cores might write to an out-of-range address, not reserved
9688d81b2a3SSuzuki K Poulose	  for TRBE. Under some conditions, the TRBE might generate a write to the next
9698d81b2a3SSuzuki K Poulose	  virtually addressed page following the last page of the TRBE address space
9708d81b2a3SSuzuki K Poulose	  (i.e., the TRBLIMITR_EL1.LIMIT), instead of wrapping around to the base.
9718d81b2a3SSuzuki K Poulose
9728d81b2a3SSuzuki K Poulose	  Work around this in the driver by always making sure that there is a
9738d81b2a3SSuzuki K Poulose	  page beyond the TRBLIMITR_EL1.LIMIT, within the space allowed for the TRBE.
9748d81b2a3SSuzuki K Poulose
9758d81b2a3SSuzuki K Poulose	  If unsure, say Y.
9768d81b2a3SSuzuki K Poulose
97739fdb65fSJames Morseconfig ARM64_ERRATUM_2441009
9788c10cc10SWill Deacon	bool "Cortex-A510: Completion of affected memory accesses might not be guaranteed by completion of a TLBI (rare)"
97939fdb65fSJames Morse	select ARM64_WORKAROUND_REPEAT_TLBI
98039fdb65fSJames Morse	help
98139fdb65fSJames Morse	  This option adds a workaround for ARM Cortex-A510 erratum #2441009.
98239fdb65fSJames Morse
98339fdb65fSJames Morse	  Under very rare circumstances, affected Cortex-A510 CPUs
98439fdb65fSJames Morse	  may not handle a race between a break-before-make sequence on one
98539fdb65fSJames Morse	  CPU, and another CPU accessing the same page. This could allow a
98639fdb65fSJames Morse	  store to a page that has been unmapped.
98739fdb65fSJames Morse
98839fdb65fSJames Morse	  Work around this by adding the affected CPUs to the list that needs
98939fdb65fSJames Morse	  TLB sequences to be done twice.
99039fdb65fSJames Morse
9918c10cc10SWill Deacon	  If unsure, say N.
99239fdb65fSJames Morse
993607a9afaSAnshuman Khandualconfig ARM64_ERRATUM_2064142
994607a9afaSAnshuman Khandual	bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled"
995ac0ba210SAnshuman Khandual	depends on CORESIGHT_TRBE
996607a9afaSAnshuman Khandual	default y
997607a9afaSAnshuman Khandual	help
998607a9afaSAnshuman Khandual	  This option adds the workaround for ARM Cortex-A510 erratum 2064142.
999607a9afaSAnshuman Khandual
1000607a9afaSAnshuman Khandual	  Affected Cortex-A510 core might fail to write into system registers after the
1001607a9afaSAnshuman Khandual	  TRBE has been disabled. Under some conditions after the TRBE has been disabled
1002607a9afaSAnshuman Khandual	  writes into TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1,
1003607a9afaSAnshuman Khandual	  and TRBTRG_EL1 will be ignored and will not be effected.
1004607a9afaSAnshuman Khandual
1005607a9afaSAnshuman Khandual	  Work around this in the driver by executing TSB CSYNC and DSB after collection
1006607a9afaSAnshuman Khandual	  is stopped and before performing a system register write to one of the affected
1007607a9afaSAnshuman Khandual	  registers.
1008607a9afaSAnshuman Khandual
1009607a9afaSAnshuman Khandual	  If unsure, say Y.
1010607a9afaSAnshuman Khandual
10113bd94a87SAnshuman Khandualconfig ARM64_ERRATUM_2038923
10123bd94a87SAnshuman Khandual	bool "Cortex-A510: 2038923: workaround TRBE corruption with enable"
1013f209e9feSAnshuman Khandual	depends on CORESIGHT_TRBE
10143bd94a87SAnshuman Khandual	default y
10153bd94a87SAnshuman Khandual	help
10163bd94a87SAnshuman Khandual	  This option adds the workaround for ARM Cortex-A510 erratum 2038923.
10173bd94a87SAnshuman Khandual
10183bd94a87SAnshuman Khandual	  Affected Cortex-A510 core might cause an inconsistent view on whether trace is
10193bd94a87SAnshuman Khandual	  prohibited within the CPU. As a result, the trace buffer or trace buffer state
10203bd94a87SAnshuman Khandual	  might be corrupted. This happens after TRBE buffer has been enabled by setting
10213bd94a87SAnshuman Khandual	  TRBLIMITR_EL1.E, followed by just a single context synchronization event before
10223bd94a87SAnshuman Khandual	  execution changes from a context, in which trace is prohibited to one where it
10233bd94a87SAnshuman Khandual	  isn't, or vice versa. In these mentioned conditions, the view of whether trace
10243bd94a87SAnshuman Khandual	  is prohibited is inconsistent between parts of the CPU, and the trace buffer or
10253bd94a87SAnshuman Khandual	  the trace buffer state might be corrupted.
10263bd94a87SAnshuman Khandual
10273bd94a87SAnshuman Khandual	  Work around this in the driver by preventing an inconsistent view of whether the
10283bd94a87SAnshuman Khandual	  trace is prohibited or not based on TRBLIMITR_EL1.E by immediately following a
10293bd94a87SAnshuman Khandual	  change to TRBLIMITR_EL1.E with at least one ISB instruction before an ERET, or
10303bd94a87SAnshuman Khandual	  two ISB instructions if no ERET is to take place.
10313bd94a87SAnshuman Khandual
10323bd94a87SAnshuman Khandual	  If unsure, say Y.
10333bd94a87SAnshuman Khandual
1034708e8af4SAnshuman Khandualconfig ARM64_ERRATUM_1902691
1035708e8af4SAnshuman Khandual	bool "Cortex-A510: 1902691: workaround TRBE trace corruption"
10363a828845SAnshuman Khandual	depends on CORESIGHT_TRBE
1037708e8af4SAnshuman Khandual	default y
1038708e8af4SAnshuman Khandual	help
1039708e8af4SAnshuman Khandual	  This option adds the workaround for ARM Cortex-A510 erratum 1902691.
1040708e8af4SAnshuman Khandual
1041708e8af4SAnshuman Khandual	  Affected Cortex-A510 core might cause trace data corruption, when being written
1042708e8af4SAnshuman Khandual	  into the memory. Effectively TRBE is broken and hence cannot be used to capture
1043708e8af4SAnshuman Khandual	  trace data.
1044708e8af4SAnshuman Khandual
1045708e8af4SAnshuman Khandual	  Work around this problem in the driver by just preventing TRBE initialization on
1046708e8af4SAnshuman Khandual	  affected cpus. The firmware must have disabled the access to TRBE for the kernel
1047708e8af4SAnshuman Khandual	  on such implementations. This will cover the kernel for any firmware that doesn't
1048708e8af4SAnshuman Khandual	  do this already.
1049708e8af4SAnshuman Khandual
1050708e8af4SAnshuman Khandual	  If unsure, say Y.
1051708e8af4SAnshuman Khandual
1052e89d120cSIonela Voinescuconfig ARM64_ERRATUM_2457168
1053e89d120cSIonela Voinescu	bool "Cortex-A510: 2457168: workaround for AMEVCNTR01 incrementing incorrectly"
1054e89d120cSIonela Voinescu	depends on ARM64_AMU_EXTN
1055e89d120cSIonela Voinescu	default y
1056e89d120cSIonela Voinescu	help
1057e89d120cSIonela Voinescu	  This option adds the workaround for ARM Cortex-A510 erratum 2457168.
1058e89d120cSIonela Voinescu
1059e89d120cSIonela Voinescu	  The AMU counter AMEVCNTR01 (constant counter) should increment at the same rate
1060e89d120cSIonela Voinescu	  as the system counter. On affected Cortex-A510 cores AMEVCNTR01 increments
1061e89d120cSIonela Voinescu	  incorrectly giving a significantly higher output value.
1062e89d120cSIonela Voinescu
1063e89d120cSIonela Voinescu	  Work around this problem by returning 0 when reading the affected counter in
1064e89d120cSIonela Voinescu	  key locations that results in disabling all users of this counter. This effect
1065e89d120cSIonela Voinescu	  is the same to firmware disabling affected counters.
1066e89d120cSIonela Voinescu
1067e89d120cSIonela Voinescu	  If unsure, say Y.
1068e89d120cSIonela Voinescu
10695db568e7SAnshuman Khandualconfig ARM64_ERRATUM_2645198
10705db568e7SAnshuman Khandual	bool "Cortex-A715: 2645198: Workaround possible [ESR|FAR]_ELx corruption"
10715db568e7SAnshuman Khandual	default y
10725db568e7SAnshuman Khandual	help
10735db568e7SAnshuman Khandual	  This option adds the workaround for ARM Cortex-A715 erratum 2645198.
10745db568e7SAnshuman Khandual
10755db568e7SAnshuman Khandual	  If a Cortex-A715 cpu sees a page mapping permissions change from executable
10765db568e7SAnshuman Khandual	  to non-executable, it may corrupt the ESR_ELx and FAR_ELx registers on the
10775db568e7SAnshuman Khandual	  next instruction abort caused by permission fault.
10785db568e7SAnshuman Khandual
10795db568e7SAnshuman Khandual	  Only user-space does executable to non-executable permission transition via
10805db568e7SAnshuman Khandual	  mprotect() system call. Workaround the problem by doing a break-before-make
10815db568e7SAnshuman Khandual	  TLB invalidation, for all changes to executable user space mappings.
10825db568e7SAnshuman Khandual
10835db568e7SAnshuman Khandual	  If unsure, say Y.
10845db568e7SAnshuman Khandual
1085546b7cdeSRob Herringconfig ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
1086546b7cdeSRob Herring	bool
1087546b7cdeSRob Herring
1088471470bcSRob Herringconfig ARM64_ERRATUM_2966298
1089471470bcSRob Herring	bool "Cortex-A520: 2966298: workaround for speculatively executed unprivileged load"
1090546b7cdeSRob Herring	select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
1091471470bcSRob Herring	default y
1092471470bcSRob Herring	help
1093471470bcSRob Herring	  This option adds the workaround for ARM Cortex-A520 erratum 2966298.
1094471470bcSRob Herring
1095471470bcSRob Herring	  On an affected Cortex-A520 core, a speculatively executed unprivileged
1096471470bcSRob Herring	  load might leak data from a privileged level via a cache side channel.
1097471470bcSRob Herring
1098471470bcSRob Herring	  Work around this problem by executing a TLBI before returning to EL0.
1099471470bcSRob Herring
1100471470bcSRob Herring	  If unsure, say Y.
1101471470bcSRob Herring
1102f827bcdaSRob Herringconfig ARM64_ERRATUM_3117295
1103f827bcdaSRob Herring	bool "Cortex-A510: 3117295: workaround for speculatively executed unprivileged load"
1104f827bcdaSRob Herring	select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
1105f827bcdaSRob Herring	default y
1106f827bcdaSRob Herring	help
1107f827bcdaSRob Herring	  This option adds the workaround for ARM Cortex-A510 erratum 3117295.
1108f827bcdaSRob Herring
1109f827bcdaSRob Herring	  On an affected Cortex-A510 core, a speculatively executed unprivileged
1110f827bcdaSRob Herring	  load might leak data from a privileged level via a cache side channel.
1111f827bcdaSRob Herring
1112f827bcdaSRob Herring	  Work around this problem by executing a TLBI before returning to EL0.
1113f827bcdaSRob Herring
1114f827bcdaSRob Herring	  If unsure, say Y.
1115f827bcdaSRob Herring
11167187bb7dSMark Rutlandconfig ARM64_ERRATUM_3194386
1117adeec61aSMark Rutland	bool "Cortex-*/Neoverse-*: workaround for MSR SSBS not self-synchronizing"
11187187bb7dSMark Rutland	default y
11197187bb7dSMark Rutland	help
1120ec768766SMark Rutland	  This option adds the workaround for the following errata:
1121ec768766SMark Rutland
1122adeec61aSMark Rutland	  * ARM Cortex-A76 erratum 3324349
1123adeec61aSMark Rutland	  * ARM Cortex-A77 erratum 3324348
1124adeec61aSMark Rutland	  * ARM Cortex-A78 erratum 3324344
1125adeec61aSMark Rutland	  * ARM Cortex-A78C erratum 3324346
1126adeec61aSMark Rutland	  * ARM Cortex-A78C erratum 3324347
112775b3c43eSMark Rutland	  * ARM Cortex-A710 erratam 3324338
1128081eb793SMark Rutland	  * ARM Cortex-A715 errartum 3456084
112975b3c43eSMark Rutland	  * ARM Cortex-A720 erratum 3456091
1130adeec61aSMark Rutland	  * ARM Cortex-A725 erratum 3456106
1131adeec61aSMark Rutland	  * ARM Cortex-X1 erratum 3324344
1132adeec61aSMark Rutland	  * ARM Cortex-X1C erratum 3324346
113375b3c43eSMark Rutland	  * ARM Cortex-X2 erratum 3324338
113475b3c43eSMark Rutland	  * ARM Cortex-X3 erratum 3324335
1135ec768766SMark Rutland	  * ARM Cortex-X4 erratum 3194386
113675b3c43eSMark Rutland	  * ARM Cortex-X925 erratum 3324334
1137adeec61aSMark Rutland	  * ARM Neoverse-N1 erratum 3324349
113875b3c43eSMark Rutland	  * ARM Neoverse N2 erratum 3324339
1139081eb793SMark Rutland	  * ARM Neoverse-N3 erratum 3456111
1140adeec61aSMark Rutland	  * ARM Neoverse-V1 erratum 3324341
114175b3c43eSMark Rutland	  * ARM Neoverse V2 erratum 3324336
1142ec768766SMark Rutland	  * ARM Neoverse-V3 erratum 3312417
11430c33aa18SMark Rutland	  * ARM Neoverse-V3AE erratum 3312417
11447187bb7dSMark Rutland
11457187bb7dSMark Rutland	  On affected cores "MSR SSBS, #0" instructions may not affect
11467187bb7dSMark Rutland	  subsequent speculative instructions, which may permit unexepected
11477187bb7dSMark Rutland	  speculative store bypassing.
11487187bb7dSMark Rutland
1149adeec61aSMark Rutland	  Work around this problem by placing a Speculation Barrier (SB) or
1150adeec61aSMark Rutland	  Instruction Synchronization Barrier (ISB) after kernel changes to
1151adeec61aSMark Rutland	  SSBS. The presence of the SSBS special-purpose register is hidden
1152adeec61aSMark Rutland	  from hwcaps and EL0 reads of ID_AA64PFR1_EL1, such that userspace
1153adeec61aSMark Rutland	  will use the PR_SPEC_STORE_BYPASS prctl to change SSBS.
11547187bb7dSMark Rutland
11557187bb7dSMark Rutland	  If unsure, say Y.
11567187bb7dSMark Rutland
115794100970SRobert Richterconfig CAVIUM_ERRATUM_22375
115894100970SRobert Richter	bool "Cavium erratum 22375, 24313"
115994100970SRobert Richter	default y
116094100970SRobert Richter	help
1161bc15cf70SWill Deacon	  Enable workaround for errata 22375 and 24313.
116294100970SRobert Richter
116394100970SRobert Richter	  This implements two gicv3-its errata workarounds for ThunderX. Both
1164bc15cf70SWill Deacon	  with a small impact affecting only ITS table allocation.
116594100970SRobert Richter
116694100970SRobert Richter	    erratum 22375: only alloc 8MB table size
116794100970SRobert Richter	    erratum 24313: ignore memory access type
116894100970SRobert Richter
116994100970SRobert Richter	  The fixes are in ITS initialization and basically ignore memory access
117094100970SRobert Richter	  type and table size provided by the TYPER and BASER registers.
117194100970SRobert Richter
117294100970SRobert Richter	  If unsure, say Y.
117394100970SRobert Richter
1174fbf8f40eSGanapatrao Kulkarniconfig CAVIUM_ERRATUM_23144
1175fbf8f40eSGanapatrao Kulkarni	bool "Cavium erratum 23144: ITS SYNC hang on dual socket system"
1176fbf8f40eSGanapatrao Kulkarni	depends on NUMA
1177fbf8f40eSGanapatrao Kulkarni	default y
1178fbf8f40eSGanapatrao Kulkarni	help
1179fbf8f40eSGanapatrao Kulkarni	  ITS SYNC command hang for cross node io and collections/cpu mapping.
1180fbf8f40eSGanapatrao Kulkarni
1181fbf8f40eSGanapatrao Kulkarni	  If unsure, say Y.
1182fbf8f40eSGanapatrao Kulkarni
11836d4e11c5SRobert Richterconfig CAVIUM_ERRATUM_23154
118424a147bcSLinu Cherian	bool "Cavium errata 23154 and 38545: GICv3 lacks HW synchronisation"
11856d4e11c5SRobert Richter	default y
11866d4e11c5SRobert Richter	help
118724a147bcSLinu Cherian	  The ThunderX GICv3 implementation requires a modified version for
11886d4e11c5SRobert Richter	  reading the IAR status to ensure data synchronization
11896d4e11c5SRobert Richter	  (access to icc_iar1_el1 is not sync'ed before and after).
11906d4e11c5SRobert Richter
119124a147bcSLinu Cherian	  It also suffers from erratum 38545 (also present on Marvell's
119224a147bcSLinu Cherian	  OcteonTX and OcteonTX2), resulting in deactivated interrupts being
119324a147bcSLinu Cherian	  spuriously presented to the CPU interface.
119424a147bcSLinu Cherian
11956d4e11c5SRobert Richter	  If unsure, say Y.
11966d4e11c5SRobert Richter
1197104a0c02SAndrew Pinskiconfig CAVIUM_ERRATUM_27456
1198104a0c02SAndrew Pinski	bool "Cavium erratum 27456: Broadcast TLBI instructions may cause icache corruption"
1199104a0c02SAndrew Pinski	default y
1200104a0c02SAndrew Pinski	help
1201104a0c02SAndrew Pinski	  On ThunderX T88 pass 1.x through 2.1 parts, broadcast TLBI
1202104a0c02SAndrew Pinski	  instructions may cause the icache to become corrupted if it
1203104a0c02SAndrew Pinski	  contains data for a non-current ASID.  The fix is to
1204104a0c02SAndrew Pinski	  invalidate the icache when changing the mm context.
1205104a0c02SAndrew Pinski
1206104a0c02SAndrew Pinski	  If unsure, say Y.
1207104a0c02SAndrew Pinski
1208690a3415SDavid Daneyconfig CAVIUM_ERRATUM_30115
1209690a3415SDavid Daney	bool "Cavium erratum 30115: Guest may disable interrupts in host"
1210690a3415SDavid Daney	default y
1211690a3415SDavid Daney	help
1212690a3415SDavid Daney	  On ThunderX T88 pass 1.x through 2.2, T81 pass 1.0 through
1213690a3415SDavid Daney	  1.2, and T83 Pass 1.0, KVM guest execution may disable
1214690a3415SDavid Daney	  interrupts in host. Trapping both GICv3 group-0 and group-1
1215690a3415SDavid Daney	  accesses sidesteps the issue.
1216690a3415SDavid Daney
1217690a3415SDavid Daney	  If unsure, say Y.
1218690a3415SDavid Daney
1219603afdc9SMarc Zyngierconfig CAVIUM_TX2_ERRATUM_219
1220603afdc9SMarc Zyngier	bool "Cavium ThunderX2 erratum 219: PRFM between TTBR change and ISB fails"
1221603afdc9SMarc Zyngier	default y
1222603afdc9SMarc Zyngier	help
1223603afdc9SMarc Zyngier	  On Cavium ThunderX2, a load, store or prefetch instruction between a
1224603afdc9SMarc Zyngier	  TTBR update and the corresponding context synchronizing operation can
1225603afdc9SMarc Zyngier	  cause a spurious Data Abort to be delivered to any hardware thread in
1226603afdc9SMarc Zyngier	  the CPU core.
1227603afdc9SMarc Zyngier
1228603afdc9SMarc Zyngier	  Work around the issue by avoiding the problematic code sequence and
1229603afdc9SMarc Zyngier	  trapping KVM guest TTBRx_EL1 writes to EL2 when SMT is enabled. The
1230603afdc9SMarc Zyngier	  trap handler performs the corresponding register access, skips the
1231603afdc9SMarc Zyngier	  instruction and ensures context synchronization by virtue of the
1232603afdc9SMarc Zyngier	  exception return.
1233603afdc9SMarc Zyngier
1234603afdc9SMarc Zyngier	  If unsure, say Y.
1235603afdc9SMarc Zyngier
1236ebcea694SGeert Uytterhoevenconfig FUJITSU_ERRATUM_010001
1237ebcea694SGeert Uytterhoeven	bool "Fujitsu-A64FX erratum E#010001: Undefined fault may occur wrongly"
1238ebcea694SGeert Uytterhoeven	default y
1239ebcea694SGeert Uytterhoeven	help
1240ebcea694SGeert Uytterhoeven	  This option adds a workaround for Fujitsu-A64FX erratum E#010001.
1241ebcea694SGeert Uytterhoeven	  On some variants of the Fujitsu-A64FX cores ver(1.0, 1.1), memory
1242ebcea694SGeert Uytterhoeven	  accesses may cause undefined fault (Data abort, DFSC=0b111111).
1243ebcea694SGeert Uytterhoeven	  This fault occurs under a specific hardware condition when a
1244ebcea694SGeert Uytterhoeven	  load/store instruction performs an address translation using:
1245ebcea694SGeert Uytterhoeven	  case-1  TTBR0_EL1 with TCR_EL1.NFD0 == 1.
1246ebcea694SGeert Uytterhoeven	  case-2  TTBR0_EL2 with TCR_EL2.NFD0 == 1.
1247ebcea694SGeert Uytterhoeven	  case-3  TTBR1_EL1 with TCR_EL1.NFD1 == 1.
1248ebcea694SGeert Uytterhoeven	  case-4  TTBR1_EL2 with TCR_EL2.NFD1 == 1.
1249ebcea694SGeert Uytterhoeven
1250ebcea694SGeert Uytterhoeven	  The workaround is to ensure these bits are clear in TCR_ELx.
1251ebcea694SGeert Uytterhoeven	  The workaround only affects the Fujitsu-A64FX.
1252ebcea694SGeert Uytterhoeven
1253ebcea694SGeert Uytterhoeven	  If unsure, say Y.
1254ebcea694SGeert Uytterhoeven
1255ebcea694SGeert Uytterhoevenconfig HISILICON_ERRATUM_161600802
1256ebcea694SGeert Uytterhoeven	bool "Hip07 161600802: Erroneous redistributor VLPI base"
1257ebcea694SGeert Uytterhoeven	default y
1258ebcea694SGeert Uytterhoeven	help
1259ebcea694SGeert Uytterhoeven	  The HiSilicon Hip07 SoC uses the wrong redistributor base
1260ebcea694SGeert Uytterhoeven	  when issued ITS commands such as VMOVP and VMAPP, and requires
1261ebcea694SGeert Uytterhoeven	  a 128kB offset to be applied to the target address in this commands.
1262ebcea694SGeert Uytterhoeven
1263ebcea694SGeert Uytterhoeven	  If unsure, say Y.
1264ebcea694SGeert Uytterhoeven
1265f82e62d4SZhou Wangconfig HISILICON_ERRATUM_162100801
1266f82e62d4SZhou Wang	bool "Hip09 162100801 erratum support"
1267f82e62d4SZhou Wang	default y
1268f82e62d4SZhou Wang	help
1269f82e62d4SZhou Wang	  When enabling GICv4.1 in hip09, VMAPP will fail to clear some caches
1270f82e62d4SZhou Wang	  during unmapping operation, which will cause some vSGIs lost.
1271f82e62d4SZhou Wang	  To fix the issue, invalidate related vPE cache through GICR_INVALLR
1272f82e62d4SZhou Wang	  after VMOVP.
1273f82e62d4SZhou Wang
1274f82e62d4SZhou Wang	  If unsure, say Y.
1275f82e62d4SZhou Wang
127638fd94b0SChristopher Covingtonconfig QCOM_FALKOR_ERRATUM_1003
127738fd94b0SChristopher Covington	bool "Falkor E1003: Incorrect translation due to ASID change"
127838fd94b0SChristopher Covington	default y
127938fd94b0SChristopher Covington	help
128038fd94b0SChristopher Covington	  On Falkor v1, an incorrect ASID may be cached in the TLB when ASID
1281d1777e68SWill Deacon	  and BADDR are changed together in TTBRx_EL1. Since we keep the ASID
1282d1777e68SWill Deacon	  in TTBR1_EL1, this situation only occurs in the entry trampoline and
1283d1777e68SWill Deacon	  then only for entries in the walk cache, since the leaf translation
1284d1777e68SWill Deacon	  is unchanged. Work around the erratum by invalidating the walk cache
1285d1777e68SWill Deacon	  entries for the trampoline before entering the kernel proper.
128638fd94b0SChristopher Covington
1287d9ff80f8SChristopher Covingtonconfig QCOM_FALKOR_ERRATUM_1009
1288d9ff80f8SChristopher Covington	bool "Falkor E1009: Prematurely complete a DSB after a TLBI"
1289d9ff80f8SChristopher Covington	default y
1290ce8c80c5SCatalin Marinas	select ARM64_WORKAROUND_REPEAT_TLBI
1291d9ff80f8SChristopher Covington	help
1292d9ff80f8SChristopher Covington	  On Falkor v1, the CPU may prematurely complete a DSB following a
1293d9ff80f8SChristopher Covington	  TLBI xxIS invalidate maintenance operation. Repeat the TLBI operation
1294d9ff80f8SChristopher Covington	  one more time to fix the issue.
1295d9ff80f8SChristopher Covington
1296d9ff80f8SChristopher Covington	  If unsure, say Y.
1297d9ff80f8SChristopher Covington
129890922a2dSShanker Donthineniconfig QCOM_QDF2400_ERRATUM_0065
129990922a2dSShanker Donthineni	bool "QDF2400 E0065: Incorrect GITS_TYPER.ITT_Entry_size"
130090922a2dSShanker Donthineni	default y
130190922a2dSShanker Donthineni	help
130290922a2dSShanker Donthineni	  On Qualcomm Datacenter Technologies QDF2400 SoC, ITS hardware reports
130390922a2dSShanker Donthineni	  ITE size incorrectly. The GITS_TYPER.ITT_Entry_size field should have
130490922a2dSShanker Donthineni	  been indicated as 16Bytes (0xf), not 8Bytes (0x7).
130590922a2dSShanker Donthineni
130690922a2dSShanker Donthineni	  If unsure, say Y.
130790922a2dSShanker Donthineni
1308932b50c7SShanker Donthineniconfig QCOM_FALKOR_ERRATUM_E1041
1309932b50c7SShanker Donthineni	bool "Falkor E1041: Speculative instruction fetches might cause errant memory access"
1310932b50c7SShanker Donthineni	default y
1311932b50c7SShanker Donthineni	help
1312932b50c7SShanker Donthineni	  Falkor CPU may speculatively fetch instructions from an improper
1313932b50c7SShanker Donthineni	  memory location when MMU translation is changed from SCTLR_ELn[M]=1
1314932b50c7SShanker Donthineni	  to SCTLR_ELn[M]=0. Prefix an ISB instruction to fix the problem.
1315932b50c7SShanker Donthineni
1316932b50c7SShanker Donthineni	  If unsure, say Y.
1317932b50c7SShanker Donthineni
131820109a85SRich Wileyconfig NVIDIA_CARMEL_CNP_ERRATUM
131920109a85SRich Wiley	bool "NVIDIA Carmel CNP: CNP on Carmel semantically different than ARM cores"
132020109a85SRich Wiley	default y
132120109a85SRich Wiley	help
132220109a85SRich Wiley	  If CNP is enabled on Carmel cores, non-sharable TLBIs on a core will not
132320109a85SRich Wiley	  invalidate shared TLB entries installed by a different core, as it would
132420109a85SRich Wiley	  on standard ARM cores.
132520109a85SRich Wiley
132620109a85SRich Wiley	  If unsure, say Y.
132720109a85SRich Wiley
13282d81e1bbSDmitry Osipenkoconfig ROCKCHIP_ERRATUM_3568002
13292d81e1bbSDmitry Osipenko	bool "Rockchip 3568002: GIC600 can not access physical addresses higher than 4GB"
13302d81e1bbSDmitry Osipenko	default y
13312d81e1bbSDmitry Osipenko	help
13322d81e1bbSDmitry Osipenko	  The Rockchip RK3566 and RK3568 GIC600 SoC integrations have AXI
13332d81e1bbSDmitry Osipenko	  addressing limited to the first 32bit of physical address space.
13342d81e1bbSDmitry Osipenko
13352d81e1bbSDmitry Osipenko	  If unsure, say Y.
13362d81e1bbSDmitry Osipenko
1337a8707f55SSebastian Reichelconfig ROCKCHIP_ERRATUM_3588001
1338a8707f55SSebastian Reichel	bool "Rockchip 3588001: GIC600 can not support shareability attributes"
1339a8707f55SSebastian Reichel	default y
1340a8707f55SSebastian Reichel	help
1341a8707f55SSebastian Reichel	  The Rockchip RK3588 GIC600 SoC integration does not support ACE/ACE-lite.
1342a8707f55SSebastian Reichel	  This means, that its sharability feature may not be used, even though it
1343a8707f55SSebastian Reichel	  is supported by the IP itself.
1344a8707f55SSebastian Reichel
1345a8707f55SSebastian Reichel	  If unsure, say Y.
1346a8707f55SSebastian Reichel
1347ebcea694SGeert Uytterhoevenconfig SOCIONEXT_SYNQUACER_PREITS
1348ebcea694SGeert Uytterhoeven	bool "Socionext Synquacer: Workaround for GICv3 pre-ITS"
13493e32131aSZhang Lei	default y
13503e32131aSZhang Lei	help
1351ebcea694SGeert Uytterhoeven	  Socionext Synquacer SoCs implement a separate h/w block to generate
1352ebcea694SGeert Uytterhoeven	  MSI doorbell writes with non-zero values for the device ID.
13533e32131aSZhang Lei
13543e32131aSZhang Lei	  If unsure, say Y.
13553e32131aSZhang Lei
13563cb7e662SJuerg Haefligerendmenu # "ARM errata workarounds via the alternatives framework"
13578c2c3df3SCatalin Marinas
13588c2c3df3SCatalin Marinaschoice
13598c2c3df3SCatalin Marinas	prompt "Page size"
13608c2c3df3SCatalin Marinas	default ARM64_4K_PAGES
13618c2c3df3SCatalin Marinas	help
13628c2c3df3SCatalin Marinas	  Page size (translation granule) configuration.
13638c2c3df3SCatalin Marinas
13648c2c3df3SCatalin Marinasconfig ARM64_4K_PAGES
13658c2c3df3SCatalin Marinas	bool "4KB"
1366d3e5bab9SArnd Bergmann	select HAVE_PAGE_SIZE_4KB
13678c2c3df3SCatalin Marinas	help
13688c2c3df3SCatalin Marinas	  This feature enables 4KB pages support.
13698c2c3df3SCatalin Marinas
137044eaacf1SSuzuki K. Pouloseconfig ARM64_16K_PAGES
137144eaacf1SSuzuki K. Poulose	bool "16KB"
1372d3e5bab9SArnd Bergmann	select HAVE_PAGE_SIZE_16KB
137344eaacf1SSuzuki K. Poulose	help
137444eaacf1SSuzuki K. Poulose	  The system will use 16KB pages support. AArch32 emulation
137544eaacf1SSuzuki K. Poulose	  requires applications compiled with 16K (or a multiple of 16K)
137644eaacf1SSuzuki K. Poulose	  aligned segments.
137744eaacf1SSuzuki K. Poulose
13788c2c3df3SCatalin Marinasconfig ARM64_64K_PAGES
13798c2c3df3SCatalin Marinas	bool "64KB"
1380d3e5bab9SArnd Bergmann	select HAVE_PAGE_SIZE_64KB
13818c2c3df3SCatalin Marinas	help
13828c2c3df3SCatalin Marinas	  This feature enables 64KB pages support (4KB by default)
13838c2c3df3SCatalin Marinas	  allowing only two levels of page tables and faster TLB
1384db488be3SSuzuki K. Poulose	  look-up. AArch32 emulation requires applications compiled
1385db488be3SSuzuki K. Poulose	  with 64K aligned segments.
13868c2c3df3SCatalin Marinas
13878c2c3df3SCatalin Marinasendchoice
13888c2c3df3SCatalin Marinas
13898c2c3df3SCatalin Marinaschoice
13908c2c3df3SCatalin Marinas	prompt "Virtual address space size"
13915d101654SArd Biesheuvel	default ARM64_VA_BITS_52
13928c2c3df3SCatalin Marinas	help
13938c2c3df3SCatalin Marinas	  Allows choosing one of multiple possible virtual address
13948c2c3df3SCatalin Marinas	  space sizes. The level of translation table is determined by
13958c2c3df3SCatalin Marinas	  a combination of page size and virtual address space size.
13968c2c3df3SCatalin Marinas
139721539939SSuzuki K. Pouloseconfig ARM64_VA_BITS_36
139856a3f30eSCatalin Marinas	bool "36-bit" if EXPERT
1399d3e5bab9SArnd Bergmann	depends on PAGE_SIZE_16KB
140021539939SSuzuki K. Poulose
14018c2c3df3SCatalin Marinasconfig ARM64_VA_BITS_39
14028c2c3df3SCatalin Marinas	bool "39-bit"
1403d3e5bab9SArnd Bergmann	depends on PAGE_SIZE_4KB
14048c2c3df3SCatalin Marinas
14058c2c3df3SCatalin Marinasconfig ARM64_VA_BITS_42
14068c2c3df3SCatalin Marinas	bool "42-bit"
1407d3e5bab9SArnd Bergmann	depends on PAGE_SIZE_64KB
14088c2c3df3SCatalin Marinas
140944eaacf1SSuzuki K. Pouloseconfig ARM64_VA_BITS_47
141044eaacf1SSuzuki K. Poulose	bool "47-bit"
1411d3e5bab9SArnd Bergmann	depends on PAGE_SIZE_16KB
141244eaacf1SSuzuki K. Poulose
14138c2c3df3SCatalin Marinasconfig ARM64_VA_BITS_48
14148c2c3df3SCatalin Marinas	bool "48-bit"
14158c2c3df3SCatalin Marinas
1416b6d00d47SSteve Capperconfig ARM64_VA_BITS_52
1417b6d00d47SSteve Capper	bool "52-bit"
141868d23da4SWill Deacon	help
141968d23da4SWill Deacon	  Enable 52-bit virtual addressing for userspace when explicitly
1420b6d00d47SSteve Capper	  requested via a hint to mmap(). The kernel will also use 52-bit
1421b6d00d47SSteve Capper	  virtual addresses for its own mappings (provided HW support for
1422b6d00d47SSteve Capper	  this feature is available, otherwise it reverts to 48-bit).
142368d23da4SWill Deacon
142468d23da4SWill Deacon	  NOTE: Enabling 52-bit virtual addressing in conjunction with
142568d23da4SWill Deacon	  ARMv8.3 Pointer Authentication will result in the PAC being
142668d23da4SWill Deacon	  reduced from 7 bits to 3 bits, which may have a significant
142768d23da4SWill Deacon	  impact on its susceptibility to brute-force attacks.
142868d23da4SWill Deacon
142968d23da4SWill Deacon	  If unsure, select 48-bit virtual addressing instead.
143068d23da4SWill Deacon
14318c2c3df3SCatalin Marinasendchoice
14328c2c3df3SCatalin Marinas
143368d23da4SWill Deaconconfig ARM64_FORCE_52BIT
143468d23da4SWill Deacon	bool "Force 52-bit virtual addresses for userspace"
1435b6d00d47SSteve Capper	depends on ARM64_VA_BITS_52 && EXPERT
143668d23da4SWill Deacon	help
143768d23da4SWill Deacon	  For systems with 52-bit userspace VAs enabled, the kernel will attempt
143868d23da4SWill Deacon	  to maintain compatibility with older software by providing 48-bit VAs
143968d23da4SWill Deacon	  unless a hint is supplied to mmap.
144068d23da4SWill Deacon
144168d23da4SWill Deacon	  This configuration option disables the 48-bit compatibility logic, and
144268d23da4SWill Deacon	  forces all userspace addresses to be 52-bit on HW that supports it. One
144368d23da4SWill Deacon	  should only enable this configuration option for stress testing userspace
144468d23da4SWill Deacon	  memory management code. If unsure say N here.
144568d23da4SWill Deacon
14468c2c3df3SCatalin Marinasconfig ARM64_VA_BITS
14478c2c3df3SCatalin Marinas	int
144821539939SSuzuki K. Poulose	default 36 if ARM64_VA_BITS_36
14498c2c3df3SCatalin Marinas	default 39 if ARM64_VA_BITS_39
14508c2c3df3SCatalin Marinas	default 42 if ARM64_VA_BITS_42
145144eaacf1SSuzuki K. Poulose	default 47 if ARM64_VA_BITS_47
1452b6d00d47SSteve Capper	default 48 if ARM64_VA_BITS_48
1453b6d00d47SSteve Capper	default 52 if ARM64_VA_BITS_52
14548c2c3df3SCatalin Marinas
1455982aa7c5SKristina Martsenkochoice
1456982aa7c5SKristina Martsenko	prompt "Physical address space size"
1457982aa7c5SKristina Martsenko	default ARM64_PA_BITS_48
1458982aa7c5SKristina Martsenko	help
1459982aa7c5SKristina Martsenko	  Choose the maximum physical address range that the kernel will
1460982aa7c5SKristina Martsenko	  support.
1461982aa7c5SKristina Martsenko
1462982aa7c5SKristina Martsenkoconfig ARM64_PA_BITS_48
1463982aa7c5SKristina Martsenko	bool "48-bit"
1464352b0395SArd Biesheuvel	depends on ARM64_64K_PAGES || !ARM64_VA_BITS_52
1465982aa7c5SKristina Martsenko
1466f77d2817SKristina Martsenkoconfig ARM64_PA_BITS_52
1467352b0395SArd Biesheuvel	bool "52-bit"
1468352b0395SArd Biesheuvel	depends on ARM64_64K_PAGES || ARM64_VA_BITS_52
1469f77d2817SKristina Martsenko	help
1470f77d2817SKristina Martsenko	  Enable support for a 52-bit physical address space, introduced as
1471f77d2817SKristina Martsenko	  part of the ARMv8.2-LPA extension.
1472f77d2817SKristina Martsenko
1473f77d2817SKristina Martsenko	  With this enabled, the kernel will also continue to work on CPUs that
1474f77d2817SKristina Martsenko	  do not support ARMv8.2-LPA, but with some added memory overhead (and
1475f77d2817SKristina Martsenko	  minor performance overhead).
1476f77d2817SKristina Martsenko
1477982aa7c5SKristina Martsenkoendchoice
1478982aa7c5SKristina Martsenko
1479982aa7c5SKristina Martsenkoconfig ARM64_PA_BITS
1480982aa7c5SKristina Martsenko	int
1481982aa7c5SKristina Martsenko	default 48 if ARM64_PA_BITS_48
1482f77d2817SKristina Martsenko	default 52 if ARM64_PA_BITS_52
1483982aa7c5SKristina Martsenko
1484db95ea78SArd Biesheuvelconfig ARM64_LPA2
1485db95ea78SArd Biesheuvel	def_bool y
1486db95ea78SArd Biesheuvel	depends on ARM64_PA_BITS_52 && !ARM64_64K_PAGES
1487db95ea78SArd Biesheuvel
1488d8e85e14SAnders Roxellchoice
1489d8e85e14SAnders Roxell	prompt "Endianness"
1490d8e85e14SAnders Roxell	default CPU_LITTLE_ENDIAN
1491d8e85e14SAnders Roxell	help
1492d8e85e14SAnders Roxell	  Select the endianness of data accesses performed by the CPU. Userspace
1493d8e85e14SAnders Roxell	  applications will need to be compiled and linked for the endianness
1494d8e85e14SAnders Roxell	  that is selected here.
1495d8e85e14SAnders Roxell
14968c2c3df3SCatalin Marinasconfig CPU_BIG_ENDIAN
14978c2c3df3SCatalin Marinas	bool "Build big-endian kernel"
1498*7f707257SLinus Torvalds	depends on BROKEN
14998c2c3df3SCatalin Marinas	help
1500d8e85e14SAnders Roxell	  Say Y if you plan on running a kernel with a big-endian userspace.
1501d8e85e14SAnders Roxell
1502d8e85e14SAnders Roxellconfig CPU_LITTLE_ENDIAN
1503d8e85e14SAnders Roxell	bool "Build little-endian kernel"
1504d8e85e14SAnders Roxell	help
1505d8e85e14SAnders Roxell	  Say Y if you plan on running a kernel with a little-endian userspace.
1506d8e85e14SAnders Roxell	  This is usually the case for distributions targeting arm64.
1507d8e85e14SAnders Roxell
1508d8e85e14SAnders Roxellendchoice
15098c2c3df3SCatalin Marinas
15108c2c3df3SCatalin Marinasconfig NR_CPUS
151162aa9655SGanapatrao Kulkarni	int "Maximum number of CPUs (2-4096)"
151262aa9655SGanapatrao Kulkarni	range 2 4096
15133fbd56f0SChristoph Lameter (Ampere)	default "512"
15148c2c3df3SCatalin Marinas
15158c2c3df3SCatalin Marinasconfig HOTPLUG_CPU
15168c2c3df3SCatalin Marinas	bool "Support for hot-pluggable CPUs"
1517217d453dSYang Yingliang	select GENERIC_IRQ_MIGRATION
15188c2c3df3SCatalin Marinas	help
15198c2c3df3SCatalin Marinas	  Say Y here to experiment with turning CPUs off and on.  CPUs
15208c2c3df3SCatalin Marinas	  can be controlled through /sys/devices/system/cpu.
15218c2c3df3SCatalin Marinas
15221a2db300SGanapatrao Kulkarni# Common NUMA Features
15231a2db300SGanapatrao Kulkarniconfig NUMA
15244399e6cdSRandy Dunlap	bool "NUMA Memory Allocation and Scheduler Support"
1525ae3c107cSAtish Patra	select GENERIC_ARCH_NUMA
15260c2a6cceSKefeng Wang	select OF_NUMA
15277ecd19cfSKefeng Wang	select HAVE_SETUP_PER_CPU_AREA
15287ecd19cfSKefeng Wang	select NEED_PER_CPU_EMBED_FIRST_CHUNK
15297ecd19cfSKefeng Wang	select NEED_PER_CPU_PAGE_FIRST_CHUNK
15307ecd19cfSKefeng Wang	select USE_PERCPU_NUMA_NODE_ID
15311a2db300SGanapatrao Kulkarni	help
15324399e6cdSRandy Dunlap	  Enable NUMA (Non-Uniform Memory Access) support.
15331a2db300SGanapatrao Kulkarni
15341a2db300SGanapatrao Kulkarni	  The kernel will try to allocate memory used by a CPU on the
15351a2db300SGanapatrao Kulkarni	  local memory of the CPU and add some more
15361a2db300SGanapatrao Kulkarni	  NUMA awareness to the kernel.
15371a2db300SGanapatrao Kulkarni
15381a2db300SGanapatrao Kulkarniconfig NODES_SHIFT
15391a2db300SGanapatrao Kulkarni	int "Maximum NUMA Nodes (as a power of 2)"
15401a2db300SGanapatrao Kulkarni	range 1 10
15412a13c13bSVanshidhar Konda	default "4"
1542a9ee6cf5SMike Rapoport	depends on NUMA
15431a2db300SGanapatrao Kulkarni	help
15441a2db300SGanapatrao Kulkarni	  Specify the maximum number of NUMA Nodes available on the target
15451a2db300SGanapatrao Kulkarni	  system.  Increases memory reserved to accommodate various tables.
15461a2db300SGanapatrao Kulkarni
15478636a1f9SMasahiro Yamadasource "kernel/Kconfig.hz"
15488c2c3df3SCatalin Marinas
15498c2c3df3SCatalin Marinasconfig ARCH_SPARSEMEM_ENABLE
15508c2c3df3SCatalin Marinas	def_bool y
15518c2c3df3SCatalin Marinas	select SPARSEMEM_VMEMMAP_ENABLE
1552e7d4bac4SNikunj Kela
15538c2c3df3SCatalin Marinasconfig HW_PERF_EVENTS
15546475b2d8SMark Rutland	def_bool y
15556475b2d8SMark Rutland	depends on ARM_PMU
15568c2c3df3SCatalin Marinas
1557afcf5441SDan Li# Supported by clang >= 7.0 or GCC >= 12.0.0
15585287569aSSami Tolvanenconfig CC_HAVE_SHADOW_CALL_STACK
15595287569aSSami Tolvanen	def_bool $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18)
15605287569aSSami Tolvanen
1561dfd57bc3SStefano Stabelliniconfig PARAVIRT
1562dfd57bc3SStefano Stabellini	bool "Enable paravirtualization code"
1563dfd57bc3SStefano Stabellini	help
1564dfd57bc3SStefano Stabellini	  This changes the kernel so it can modify itself when it is run
1565dfd57bc3SStefano Stabellini	  under a hypervisor, potentially improving performance significantly
1566dfd57bc3SStefano Stabellini	  over full virtualization.
1567dfd57bc3SStefano Stabellini
1568dfd57bc3SStefano Stabelliniconfig PARAVIRT_TIME_ACCOUNTING
1569dfd57bc3SStefano Stabellini	bool "Paravirtual steal time accounting"
1570dfd57bc3SStefano Stabellini	select PARAVIRT
1571dfd57bc3SStefano Stabellini	help
1572dfd57bc3SStefano Stabellini	  Select this option to enable fine granularity task steal time
1573dfd57bc3SStefano Stabellini	  accounting. Time spent executing other tasks in parallel with
1574dfd57bc3SStefano Stabellini	  the current vCPU is discounted from the vCPU power. To account for
1575dfd57bc3SStefano Stabellini	  that, there can be a small performance impact.
1576dfd57bc3SStefano Stabellini
1577dfd57bc3SStefano Stabellini	  If in doubt, say N here.
1578dfd57bc3SStefano Stabellini
157991506f7eSEric DeVolderconfig ARCH_SUPPORTS_KEXEC
158091506f7eSEric DeVolder	def_bool PM_SLEEP_SMP
1581d28f6df1SGeoff Levand
158291506f7eSEric DeVolderconfig ARCH_SUPPORTS_KEXEC_FILE
158391506f7eSEric DeVolder	def_bool y
15843ddd9992SAKASHI Takahiro
158591506f7eSEric DeVolderconfig ARCH_SELECTS_KEXEC_FILE
158691506f7eSEric DeVolder	def_bool y
1587732b7b93SAKASHI Takahiro	depends on KEXEC_FILE
158891506f7eSEric DeVolder	select HAVE_IMA_KEXEC if IMA
1589732b7b93SAKASHI Takahiro
159091506f7eSEric DeVolderconfig ARCH_SUPPORTS_KEXEC_SIG
159191506f7eSEric DeVolder	def_bool y
1592732b7b93SAKASHI Takahiro
159391506f7eSEric DeVolderconfig ARCH_SUPPORTS_KEXEC_IMAGE_VERIFY_SIG
159491506f7eSEric DeVolder	def_bool y
1595732b7b93SAKASHI Takahiro
159691506f7eSEric DeVolderconfig ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG
159791506f7eSEric DeVolder	def_bool y
1598732b7b93SAKASHI Takahiro
1599274cdcb1SAlexander Grafconfig ARCH_SUPPORTS_KEXEC_HANDOVER
1600274cdcb1SAlexander Graf	def_bool y
1601274cdcb1SAlexander Graf
160291506f7eSEric DeVolderconfig ARCH_SUPPORTS_CRASH_DUMP
160391506f7eSEric DeVolder	def_bool y
1604e62aaeacSAKASHI Takahiro
160531daa343SDave Vasilevskyconfig ARCH_DEFAULT_CRASH_DUMP
160631daa343SDave Vasilevsky	def_bool y
160731daa343SDave Vasilevsky
1608fdc26823SBaoquan Heconfig ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION
160985fcde40SBaoquan He	def_bool CRASH_RESERVE
1610fdc26823SBaoquan He
1611072e3d96SPavel Tatashinconfig TRANS_TABLE
1612072e3d96SPavel Tatashin	def_bool y
161308eae0efSPasha Tatashin	depends on HIBERNATION || KEXEC_CORE
1614072e3d96SPavel Tatashin
1615aa42aa13SStefano Stabelliniconfig XEN_DOM0
1616aa42aa13SStefano Stabellini	def_bool y
1617aa42aa13SStefano Stabellini	depends on XEN
1618aa42aa13SStefano Stabellini
1619aa42aa13SStefano Stabelliniconfig XEN
1620c2ba1f7dSJulien Grall	bool "Xen guest support on ARM64"
1621aa42aa13SStefano Stabellini	depends on ARM64 && OF
162283862ccfSStefano Stabellini	select SWIOTLB_XEN
1623dfd57bc3SStefano Stabellini	select PARAVIRT
1624aa42aa13SStefano Stabellini	help
1625aa42aa13SStefano Stabellini	  Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
1626aa42aa13SStefano Stabellini
16275a4c2a31SKefeng Wang# include/linux/mmzone.h requires the following to be true:
16285a4c2a31SKefeng Wang#
16295e0a760bSKirill A. Shutemov#   MAX_PAGE_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
16305a4c2a31SKefeng Wang#
16315e0a760bSKirill A. Shutemov# so the maximum value of MAX_PAGE_ORDER is SECTION_SIZE_BITS - PAGE_SHIFT:
16325a4c2a31SKefeng Wang#
16335e0a760bSKirill A. Shutemov#     | SECTION_SIZE_BITS |  PAGE_SHIFT  |  max MAX_PAGE_ORDER  |  default MAX_PAGE_ORDER |
16345e0a760bSKirill A. Shutemov# ----+-------------------+--------------+----------------------+-------------------------+
163523baf831SKirill A. Shutemov# 4K  |       27          |      12      |       15             |         10              |
163623baf831SKirill A. Shutemov# 16K |       27          |      14      |       13             |         11              |
163723baf831SKirill A. Shutemov# 64K |       29          |      16      |       13             |         13              |
16380192445cSZi Yanconfig ARCH_FORCE_MAX_ORDER
1639f3c37621SCatalin Marinas	int
164023baf831SKirill A. Shutemov	default "13" if ARM64_64K_PAGES
164123baf831SKirill A. Shutemov	default "11" if ARM64_16K_PAGES
164223baf831SKirill A. Shutemov	default "10"
164344eaacf1SSuzuki K. Poulose	help
16444632cb22SMike Rapoport (IBM)	  The kernel page allocator limits the size of maximal physically
16455e0a760bSKirill A. Shutemov	  contiguous allocations. The limit is called MAX_PAGE_ORDER and it
16464632cb22SMike Rapoport (IBM)	  defines the maximal power of two of number of pages that can be
16474632cb22SMike Rapoport (IBM)	  allocated as a single contiguous block. This option allows
16484632cb22SMike Rapoport (IBM)	  overriding the default setting when ability to allocate very
16494632cb22SMike Rapoport (IBM)	  large blocks of physically contiguous memory is required.
165044eaacf1SSuzuki K. Poulose
16514632cb22SMike Rapoport (IBM)	  The maximal size of allocation cannot exceed the size of the
16525e0a760bSKirill A. Shutemov	  section, so the value of MAX_PAGE_ORDER should satisfy
165344eaacf1SSuzuki K. Poulose
16545e0a760bSKirill A. Shutemov	    MAX_PAGE_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
165544eaacf1SSuzuki K. Poulose
16564632cb22SMike Rapoport (IBM)	  Don't change if unsure.
1657d03bb145SSteve Capper
1658084eb77cSWill Deaconconfig UNMAP_KERNEL_AT_EL0
16597540f70dSArd Biesheuvel	bool "Unmap kernel when running in userspace (KPTI)" if EXPERT
1660084eb77cSWill Deacon	default y
1661084eb77cSWill Deacon	help
16620617052dSWill Deacon	  Speculation attacks against some high-performance processors can
16630617052dSWill Deacon	  be used to bypass MMU permission checks and leak kernel data to
16640617052dSWill Deacon	  userspace. This can be defended against by unmapping the kernel
16650617052dSWill Deacon	  when running in userspace, mapping it back in on exception entry
16660617052dSWill Deacon	  via a trampoline page in the vector table.
1667084eb77cSWill Deacon
1668084eb77cSWill Deacon	  If unsure, say Y.
1669084eb77cSWill Deacon
1670558c303cSJames Morseconfig MITIGATE_SPECTRE_BRANCH_HISTORY
1671558c303cSJames Morse	bool "Mitigate Spectre style attacks against branch history" if EXPERT
1672558c303cSJames Morse	default y
1673558c303cSJames Morse	help
1674558c303cSJames Morse	  Speculation attacks against some high-performance processors can
1675558c303cSJames Morse	  make use of branch history to influence future speculation.
1676558c303cSJames Morse	  When taking an exception from user-space, a sequence of branches
1677558c303cSJames Morse	  or a firmware call overwrites the branch history.
1678558c303cSJames Morse
1679dd523791SWill Deaconconfig ARM64_SW_TTBR0_PAN
1680dd523791SWill Deacon	bool "Emulate Privileged Access Never using TTBR0_EL1 switching"
168186a6a68fSLinus Torvalds	depends on !KCSAN
168292b6919dSArd Biesheuvel	select ARM64_PAN
1683dd523791SWill Deacon	help
1684dd523791SWill Deacon	  Enabling this option prevents the kernel from accessing
1685dd523791SWill Deacon	  user-space memory directly by pointing TTBR0_EL1 to a reserved
1686dd523791SWill Deacon	  zeroed area and reserved ASID. The user access routines
1687dd523791SWill Deacon	  restore the valid TTBR0_EL1 temporarily.
1688dd523791SWill Deacon
168963f0c603SCatalin Marinasconfig ARM64_TAGGED_ADDR_ABI
169063f0c603SCatalin Marinas	bool "Enable the tagged user addresses syscall ABI"
169163f0c603SCatalin Marinas	default y
169263f0c603SCatalin Marinas	help
169363f0c603SCatalin Marinas	  When this option is enabled, user applications can opt in to a
169463f0c603SCatalin Marinas	  relaxed ABI via prctl() allowing tagged addresses to be passed
169563f0c603SCatalin Marinas	  to system calls as pointer arguments. For details, see
16966e4596c4SJonathan Corbet	  Documentation/arch/arm64/tagged-address-abi.rst.
169763f0c603SCatalin Marinas
1698dd523791SWill Deaconmenuconfig COMPAT
1699dd523791SWill Deacon	bool "Kernel support for 32-bit EL0"
1700dd523791SWill Deacon	depends on ARM64_4K_PAGES || EXPERT
1701dd523791SWill Deacon	select HAVE_UID16
1702dd523791SWill Deacon	select OLD_SIGSUSPEND3
1703dd523791SWill Deacon	select COMPAT_OLD_SIGACTION
1704dd523791SWill Deacon	help
1705dd523791SWill Deacon	  This option enables support for a 32-bit EL0 running under a 64-bit
1706dd523791SWill Deacon	  kernel at EL1. AArch32-specific components such as system calls,
1707dd523791SWill Deacon	  the user helper functions, VFP support and the ptrace interface are
1708dd523791SWill Deacon	  handled appropriately by the kernel.
1709dd523791SWill Deacon
1710dd523791SWill Deacon	  If you use a page size other than 4KB (i.e, 16KB or 64KB), please be aware
1711dd523791SWill Deacon	  that you will only be able to execute AArch32 binaries that were compiled
1712dd523791SWill Deacon	  with page size aligned segments.
1713dd523791SWill Deacon
1714dd523791SWill Deacon	  If you want to execute 32-bit userspace applications, say Y.
1715dd523791SWill Deacon
1716dd523791SWill Deaconif COMPAT
1717dd523791SWill Deacon
1718dd523791SWill Deaconconfig KUSER_HELPERS
17197c4791c9SWill Deacon	bool "Enable kuser helpers page for 32-bit applications"
1720dd523791SWill Deacon	default y
1721dd523791SWill Deacon	help
1722dd523791SWill Deacon	  Warning: disabling this option may break 32-bit user programs.
1723dd523791SWill Deacon
1724dd523791SWill Deacon	  Provide kuser helpers to compat tasks. The kernel provides
1725dd523791SWill Deacon	  helper code to userspace in read only form at a fixed location
1726dd523791SWill Deacon	  to allow userspace to be independent of the CPU type fitted to
1727dd523791SWill Deacon	  the system. This permits binaries to be run on ARMv4 through
1728dd523791SWill Deacon	  to ARMv8 without modification.
1729dd523791SWill Deacon
1730263638dcSJonathan Corbet	  See Documentation/arch/arm/kernel_user_helpers.rst for details.
1731dd523791SWill Deacon
1732dd523791SWill Deacon	  However, the fixed address nature of these helpers can be used
1733dd523791SWill Deacon	  by ROP (return orientated programming) authors when creating
1734dd523791SWill Deacon	  exploits.
1735dd523791SWill Deacon
1736dd523791SWill Deacon	  If all of the binaries and libraries which run on your platform
1737dd523791SWill Deacon	  are built specifically for your platform, and make no use of
1738dd523791SWill Deacon	  these helpers, then you can turn this option off to hinder
1739dd523791SWill Deacon	  such exploits. However, in that case, if a binary or library
1740dd523791SWill Deacon	  relying on those helpers is run, it will not function correctly.
1741dd523791SWill Deacon
1742dd523791SWill Deacon	  Say N here only if you are absolutely certain that you do not
1743dd523791SWill Deacon	  need these helpers; otherwise, the safe option is to say Y.
1744dd523791SWill Deacon
17457c4791c9SWill Deaconconfig COMPAT_VDSO
17467c4791c9SWill Deacon	bool "Enable vDSO for 32-bit applications"
17473e6f8d1fSNick Desaulniers	depends on !CPU_BIG_ENDIAN
17483e6f8d1fSNick Desaulniers	depends on (CC_IS_CLANG && LD_IS_LLD) || "$(CROSS_COMPILE_COMPAT)" != ""
17497c4791c9SWill Deacon	default y
17507c4791c9SWill Deacon	help
17517c4791c9SWill Deacon	  Place in the process address space of 32-bit applications an
17527c4791c9SWill Deacon	  ELF shared object providing fast implementations of gettimeofday
17537c4791c9SWill Deacon	  and clock_gettime.
17547c4791c9SWill Deacon
17557c4791c9SWill Deacon	  You must have a 32-bit build of glibc 2.22 or later for programs
17567c4791c9SWill Deacon	  to seamlessly take advantage of this.
1757dd523791SWill Deacon
1758625412c2SNick Desaulniersconfig THUMB2_COMPAT_VDSO
1759625412c2SNick Desaulniers	bool "Compile the 32-bit vDSO for Thumb-2 mode" if EXPERT
1760625412c2SNick Desaulniers	depends on COMPAT_VDSO
1761625412c2SNick Desaulniers	default y
1762625412c2SNick Desaulniers	help
1763625412c2SNick Desaulniers	  Compile the compat vDSO with '-mthumb -fomit-frame-pointer' if y,
1764625412c2SNick Desaulniers	  otherwise with '-marm'.
1765625412c2SNick Desaulniers
17663fc24ef3SArd Biesheuvelconfig COMPAT_ALIGNMENT_FIXUPS
17673fc24ef3SArd Biesheuvel	bool "Fix up misaligned multi-word loads and stores in user space"
17683fc24ef3SArd Biesheuvel
17691b907f46SWill Deaconmenuconfig ARMV8_DEPRECATED
17701b907f46SWill Deacon	bool "Emulate deprecated/obsolete ARMv8 instructions"
17716cfa7cc4SDave Martin	depends on SYSCTL
17721b907f46SWill Deacon	help
17731b907f46SWill Deacon	  Legacy software support may require certain instructions
17741b907f46SWill Deacon	  that have been deprecated or obsoleted in the architecture.
17751b907f46SWill Deacon
17761b907f46SWill Deacon	  Enable this config to enable selective emulation of these
17771b907f46SWill Deacon	  features.
17781b907f46SWill Deacon
17791b907f46SWill Deacon	  If unsure, say Y
17801b907f46SWill Deacon
17811b907f46SWill Deaconif ARMV8_DEPRECATED
17821b907f46SWill Deacon
17831b907f46SWill Deaconconfig SWP_EMULATION
17841b907f46SWill Deacon	bool "Emulate SWP/SWPB instructions"
17851b907f46SWill Deacon	help
17861b907f46SWill Deacon	  ARMv8 obsoletes the use of A32 SWP/SWPB instructions such that
17871b907f46SWill Deacon	  they are always undefined. Say Y here to enable software
17881b907f46SWill Deacon	  emulation of these instructions for userspace using LDXR/STXR.
1789dd720784SMark Brown	  This feature can be controlled at runtime with the abi.swp
1790dd720784SMark Brown	  sysctl which is disabled by default.
17911b907f46SWill Deacon
17921b907f46SWill Deacon	  In some older versions of glibc [<=2.8] SWP is used during futex
17931b907f46SWill Deacon	  trylock() operations with the assumption that the code will not
17941b907f46SWill Deacon	  be preempted. This invalid assumption may be more likely to fail
17951b907f46SWill Deacon	  with SWP emulation enabled, leading to deadlock of the user
17961b907f46SWill Deacon	  application.
17971b907f46SWill Deacon
17981b907f46SWill Deacon	  NOTE: when accessing uncached shared regions, LDXR/STXR rely
17991b907f46SWill Deacon	  on an external transaction monitoring block called a global
18001b907f46SWill Deacon	  monitor to maintain update atomicity. If your system does not
18011b907f46SWill Deacon	  implement a global monitor, this option can cause programs that
18021b907f46SWill Deacon	  perform SWP operations to uncached memory to deadlock.
18031b907f46SWill Deacon
18041b907f46SWill Deacon	  If unsure, say Y
18051b907f46SWill Deacon
18061b907f46SWill Deaconconfig CP15_BARRIER_EMULATION
18071b907f46SWill Deacon	bool "Emulate CP15 Barrier instructions"
18081b907f46SWill Deacon	help
18091b907f46SWill Deacon	  The CP15 barrier instructions - CP15ISB, CP15DSB, and
18101b907f46SWill Deacon	  CP15DMB - are deprecated in ARMv8 (and ARMv7). It is
18111b907f46SWill Deacon	  strongly recommended to use the ISB, DSB, and DMB
18121b907f46SWill Deacon	  instructions instead.
18131b907f46SWill Deacon
18141b907f46SWill Deacon	  Say Y here to enable software emulation of these
18151b907f46SWill Deacon	  instructions for AArch32 userspace code. When this option is
18161b907f46SWill Deacon	  enabled, CP15 barrier usage is traced which can help
1817dd720784SMark Brown	  identify software that needs updating. This feature can be
1818dd720784SMark Brown	  controlled at runtime with the abi.cp15_barrier sysctl.
18191b907f46SWill Deacon
18201b907f46SWill Deacon	  If unsure, say Y
18211b907f46SWill Deacon
18222d888f48SSuzuki K. Pouloseconfig SETEND_EMULATION
18232d888f48SSuzuki K. Poulose	bool "Emulate SETEND instruction"
18242d888f48SSuzuki K. Poulose	help
18252d888f48SSuzuki K. Poulose	  The SETEND instruction alters the data-endianness of the
18262d888f48SSuzuki K. Poulose	  AArch32 EL0, and is deprecated in ARMv8.
18272d888f48SSuzuki K. Poulose
18282d888f48SSuzuki K. Poulose	  Say Y here to enable software emulation of the instruction
1829dd720784SMark Brown	  for AArch32 userspace code. This feature can be controlled
1830dd720784SMark Brown	  at runtime with the abi.setend sysctl.
18312d888f48SSuzuki K. Poulose
18322d888f48SSuzuki K. Poulose	  Note: All the cpus on the system must have mixed endian support at EL0
18332d888f48SSuzuki K. Poulose	  for this feature to be enabled. If a new CPU - which doesn't support mixed
18342d888f48SSuzuki K. Poulose	  endian - is hotplugged in after this feature has been enabled, there could
18352d888f48SSuzuki K. Poulose	  be unexpected results in the applications.
18362d888f48SSuzuki K. Poulose
18372d888f48SSuzuki K. Poulose	  If unsure, say Y
18383cb7e662SJuerg Haefligerendif # ARMV8_DEPRECATED
18391b907f46SWill Deacon
18403cb7e662SJuerg Haefligerendif # COMPAT
1841ba42822aSCatalin Marinas
18420e4a0709SWill Deaconmenu "ARMv8.1 architectural features"
18430e4a0709SWill Deacon
18440e4a0709SWill Deaconconfig ARM64_HW_AFDBM
18450e4a0709SWill Deacon	bool "Support for hardware updates of the Access and Dirty page flags"
18460e4a0709SWill Deacon	default y
18470e4a0709SWill Deacon	help
18480e4a0709SWill Deacon	  The ARMv8.1 architecture extensions introduce support for
18490e4a0709SWill Deacon	  hardware updates of the access and dirty information in page
18500e4a0709SWill Deacon	  table entries. When enabled in TCR_EL1 (HA and HD bits) on
18510e4a0709SWill Deacon	  capable processors, accesses to pages with PTE_AF cleared will
18520e4a0709SWill Deacon	  set this bit instead of raising an access flag fault.
18530e4a0709SWill Deacon	  Similarly, writes to read-only pages with the DBM bit set will
18540e4a0709SWill Deacon	  clear the read-only bit (AP[2]) instead of raising a
18550e4a0709SWill Deacon	  permission fault.
18560e4a0709SWill Deacon
18570e4a0709SWill Deacon	  Kernels built with this configuration option enabled continue
18580e4a0709SWill Deacon	  to work on pre-ARMv8.1 hardware and the performance impact is
18590e4a0709SWill Deacon	  minimal. If unsure, say Y.
18600e4a0709SWill Deacon
18610e4a0709SWill Deaconconfig ARM64_PAN
18620e4a0709SWill Deacon	bool "Enable support for Privileged Access Never (PAN)"
18630e4a0709SWill Deacon	default y
18640e4a0709SWill Deacon	help
18650e4a0709SWill Deacon	  Privileged Access Never (PAN; part of the ARMv8.1 Extensions)
18660e4a0709SWill Deacon	  prevents the kernel or hypervisor from accessing user-space (EL0)
18670e4a0709SWill Deacon	  memory directly.
18680e4a0709SWill Deacon
18690e4a0709SWill Deacon	  Choosing this option will cause any unprotected (not using
18700e4a0709SWill Deacon	  copy_to_user et al) memory access to fail with a permission fault.
18710e4a0709SWill Deacon
18720e4a0709SWill Deacon	  The feature is detected at runtime, and will remain as a 'nop'
18730e4a0709SWill Deacon	  instruction if the cpu does not implement the feature.
18740e4a0709SWill Deacon
18750e4a0709SWill Deaconconfig ARM64_LSE_ATOMICS
1876395af861SCatalin Marinas	bool
1877395af861SCatalin Marinas	default ARM64_USE_LSE_ATOMICS
1878395af861SCatalin Marinas
1879395af861SCatalin Marinasconfig ARM64_USE_LSE_ATOMICS
18800e4a0709SWill Deacon	bool "Atomic instructions"
18817bd99b40SWill Deacon	default y
18820e4a0709SWill Deacon	help
18830e4a0709SWill Deacon	  As part of the Large System Extensions, ARMv8.1 introduces new
18840e4a0709SWill Deacon	  atomic instructions that are designed specifically to scale in
18850e4a0709SWill Deacon	  very large systems.
18860e4a0709SWill Deacon
18870e4a0709SWill Deacon	  Say Y here to make use of these instructions for the in-kernel
18880e4a0709SWill Deacon	  atomic routines. This incurs a small overhead on CPUs that do
18892555d4c6SArnd Bergmann	  not support these instructions.
18900e4a0709SWill Deacon
18913cb7e662SJuerg Haefligerendmenu # "ARMv8.1 architectural features"
18920e4a0709SWill Deacon
1893f993318bSWill Deaconmenu "ARMv8.2 architectural features"
1894f993318bSWill Deacon
1895d50e071fSRobin Murphyconfig ARM64_PMEM
1896d50e071fSRobin Murphy	bool "Enable support for persistent memory"
1897d50e071fSRobin Murphy	select ARCH_HAS_PMEM_API
18985d7bdeb1SRobin Murphy	select ARCH_HAS_UACCESS_FLUSHCACHE
1899d50e071fSRobin Murphy	help
1900d50e071fSRobin Murphy	  Say Y to enable support for the persistent memory API based on the
1901d50e071fSRobin Murphy	  ARMv8.2 DCPoP feature.
1902d50e071fSRobin Murphy
1903d50e071fSRobin Murphy	  The feature is detected at runtime, and the kernel will use DC CVAC
1904d50e071fSRobin Murphy	  operations if DC CVAP is not supported (following the behaviour of
1905d50e071fSRobin Murphy	  DC CVAP itself if the system does not define a point of persistence).
1906d50e071fSRobin Murphy
190764c02720SXie XiuQiconfig ARM64_RAS_EXTN
190864c02720SXie XiuQi	bool "Enable support for RAS CPU Extensions"
190964c02720SXie XiuQi	default y
191064c02720SXie XiuQi	help
191164c02720SXie XiuQi	  CPUs that support the Reliability, Availability and Serviceability
191264c02720SXie XiuQi	  (RAS) Extensions, part of ARMv8.2 are able to track faults and
191364c02720SXie XiuQi	  errors, classify them and report them to software.
191464c02720SXie XiuQi
191564c02720SXie XiuQi	  On CPUs with these extensions system software can use additional
191664c02720SXie XiuQi	  barriers to determine if faults are pending and read the
191764c02720SXie XiuQi	  classification from a new set of registers.
191864c02720SXie XiuQi
191964c02720SXie XiuQi	  Selecting this feature will allow the kernel to use these barriers
192064c02720SXie XiuQi	  and access the new registers if the system supports the extension.
192164c02720SXie XiuQi	  Platform RAS features may additionally depend on firmware support.
192264c02720SXie XiuQi
19235ffdfaedSVladimir Murzinconfig ARM64_CNP
19245ffdfaedSVladimir Murzin	bool "Enable support for Common Not Private (CNP) translations"
19255ffdfaedSVladimir Murzin	default y
19265ffdfaedSVladimir Murzin	help
19275ffdfaedSVladimir Murzin	  Common Not Private (CNP) allows translation table entries to
19285ffdfaedSVladimir Murzin	  be shared between different PEs in the same inner shareable
19295ffdfaedSVladimir Murzin	  domain, so the hardware can use this fact to optimise the
19305ffdfaedSVladimir Murzin	  caching of such entries in the TLB.
19315ffdfaedSVladimir Murzin
19325ffdfaedSVladimir Murzin	  Selecting this option allows the CNP feature to be detected
19335ffdfaedSVladimir Murzin	  at runtime, and does not affect PEs that do not implement
19345ffdfaedSVladimir Murzin	  this feature.
19355ffdfaedSVladimir Murzin
19363cb7e662SJuerg Haefligerendmenu # "ARMv8.2 architectural features"
1937f993318bSWill Deacon
193804ca3204SMark Rutlandmenu "ARMv8.3 architectural features"
193904ca3204SMark Rutland
194004ca3204SMark Rutlandconfig ARM64_PTR_AUTH
194104ca3204SMark Rutland	bool "Enable support for pointer authentication"
194204ca3204SMark Rutland	default y
194304ca3204SMark Rutland	help
194404ca3204SMark Rutland	  Pointer authentication (part of the ARMv8.3 Extensions) provides
194504ca3204SMark Rutland	  instructions for signing and authenticating pointers against secret
194604ca3204SMark Rutland	  keys, which can be used to mitigate Return Oriented Programming (ROP)
194704ca3204SMark Rutland	  and other attacks.
194804ca3204SMark Rutland
194904ca3204SMark Rutland	  This option enables these instructions at EL0 (i.e. for userspace).
195004ca3204SMark Rutland	  Choosing this option will cause the kernel to initialise secret keys
195104ca3204SMark Rutland	  for each process at exec() time, with these keys being
195204ca3204SMark Rutland	  context-switched along with the process.
195304ca3204SMark Rutland
195404ca3204SMark Rutland	  The feature is detected at runtime. If the feature is not present in
1955384b40caSMark Rutland	  hardware it will not be advertised to userspace/KVM guest nor will it
1956dfb0589cSMarc Zyngier	  be enabled.
195704ca3204SMark Rutland
19586982934eSKristina Martsenko	  If the feature is present on the boot CPU but not on a late CPU, then
19596982934eSKristina Martsenko	  the late CPU will be parked. Also, if the boot CPU does not have
19606982934eSKristina Martsenko	  address auth and the late CPU has then the late CPU will still boot
19616982934eSKristina Martsenko	  but with the feature disabled. On such a system, this option should
19626982934eSKristina Martsenko	  not be selected.
19636982934eSKristina Martsenko
1964b27a9f41SDaniel Kissconfig ARM64_PTR_AUTH_KERNEL
1965d053e71aSDaniel Kiss	bool "Use pointer authentication for kernel"
1966b27a9f41SDaniel Kiss	default y
1967b27a9f41SDaniel Kiss	depends on ARM64_PTR_AUTH
1968b27a9f41SDaniel Kiss	# Modern compilers insert a .note.gnu.property section note for PAC
1969b27a9f41SDaniel Kiss	# which is only understood by binutils starting with version 2.33.1.
1970b27a9f41SDaniel Kiss	depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
1971b27a9f41SDaniel Kiss	depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
197226299b3fSMark Rutland	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_ARGS)
1973b27a9f41SDaniel Kiss	help
1974b27a9f41SDaniel Kiss	  If the compiler supports the -mbranch-protection or
1975b27a9f41SDaniel Kiss	  -msign-return-address flag (e.g. GCC 7 or later), then this option
1976b27a9f41SDaniel Kiss	  will cause the kernel itself to be compiled with return address
1977b27a9f41SDaniel Kiss	  protection. In this case, and if the target hardware is known to
1978b27a9f41SDaniel Kiss	  support pointer authentication, then CONFIG_STACKPROTECTOR can be
1979b27a9f41SDaniel Kiss	  disabled with minimal loss of protection.
1980b27a9f41SDaniel Kiss
198174afda40SKristina Martsenko	  This feature works with FUNCTION_GRAPH_TRACER option only if
198226299b3fSMark Rutland	  DYNAMIC_FTRACE_WITH_ARGS is enabled.
198374afda40SKristina Martsenko
198474afda40SKristina Martsenkoconfig CC_HAS_BRANCH_PROT_PAC_RET
198574afda40SKristina Martsenko	# GCC 9 or later, clang 8 or later
198674afda40SKristina Martsenko	def_bool $(cc-option,-mbranch-protection=pac-ret+leaf)
198774afda40SKristina Martsenko
19883b446c7dSNick Desaulniersconfig AS_HAS_CFI_NEGATE_RA_STATE
19892555d4c6SArnd Bergmann	# binutils 2.34+
19903b446c7dSNick Desaulniers	def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
19913b446c7dSNick Desaulniers
19923cb7e662SJuerg Haefligerendmenu # "ARMv8.3 architectural features"
199304ca3204SMark Rutland
19942c9d45b4SIonela Voinescumenu "ARMv8.4 architectural features"
19952c9d45b4SIonela Voinescu
19962c9d45b4SIonela Voinescuconfig ARM64_AMU_EXTN
19972c9d45b4SIonela Voinescu	bool "Enable support for the Activity Monitors Unit CPU extension"
19982c9d45b4SIonela Voinescu	default y
19992c9d45b4SIonela Voinescu	help
20002c9d45b4SIonela Voinescu	  The activity monitors extension is an optional extension introduced
20012c9d45b4SIonela Voinescu	  by the ARMv8.4 CPU architecture. This enables support for version 1
20022c9d45b4SIonela Voinescu	  of the activity monitors architecture, AMUv1.
20032c9d45b4SIonela Voinescu
20042c9d45b4SIonela Voinescu	  To enable the use of this extension on CPUs that implement it, say Y.
20052c9d45b4SIonela Voinescu
20062c9d45b4SIonela Voinescu	  Note that for architectural reasons, firmware _must_ implement AMU
20072c9d45b4SIonela Voinescu	  support when running on CPUs that present the activity monitors
20082c9d45b4SIonela Voinescu	  extension. The required support is present in:
20092c9d45b4SIonela Voinescu	    * Version 1.5 and later of the ARM Trusted Firmware
20102c9d45b4SIonela Voinescu
20112c9d45b4SIonela Voinescu	  For kernels that have this configuration enabled but boot with broken
20122c9d45b4SIonela Voinescu	  firmware, you may need to say N here until the firmware is fixed.
20132c9d45b4SIonela Voinescu	  Otherwise you may experience firmware panics or lockups when
20142c9d45b4SIonela Voinescu	  accessing the counter registers. Even if you are not observing these
20152c9d45b4SIonela Voinescu	  symptoms, the values returned by the register reads might not
20162c9d45b4SIonela Voinescu	  correctly reflect reality. Most commonly, the value read will be 0,
20172c9d45b4SIonela Voinescu	  indicating that the counter is not enabled.
20182c9d45b4SIonela Voinescu
20197c78f67eSZhenyu Yeconfig ARM64_TLB_RANGE
20207c78f67eSZhenyu Ye	bool "Enable support for tlbi range feature"
20217c78f67eSZhenyu Ye	default y
20227c78f67eSZhenyu Ye	help
20237c78f67eSZhenyu Ye	  ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a
20247c78f67eSZhenyu Ye	  range of input addresses.
20257c78f67eSZhenyu Ye
20263cb7e662SJuerg Haefligerendmenu # "ARMv8.4 architectural features"
2027fd045f6cSArd Biesheuvel
20283e6c69a0SMark Brownmenu "ARMv8.5 architectural features"
20293e6c69a0SMark Brown
2030f469c032SVincenzo Frascinoconfig AS_HAS_ARMV8_5
2031f469c032SVincenzo Frascino	def_bool $(cc-option,-Wa$(comma)-march=armv8.5-a)
2032f469c032SVincenzo Frascino
2033383499f8SDave Martinconfig ARM64_BTI
2034383499f8SDave Martin	bool "Branch Target Identification support"
2035383499f8SDave Martin	default y
2036383499f8SDave Martin	help
2037383499f8SDave Martin	  Branch Target Identification (part of the ARMv8.5 Extensions)
2038383499f8SDave Martin	  provides a mechanism to limit the set of locations to which computed
2039383499f8SDave Martin	  branch instructions such as BR or BLR can jump.
2040383499f8SDave Martin
2041383499f8SDave Martin	  To make use of BTI on CPUs that support it, say Y.
2042383499f8SDave Martin
2043383499f8SDave Martin	  BTI is intended to provide complementary protection to other control
2044383499f8SDave Martin	  flow integrity protection mechanisms, such as the Pointer
2045383499f8SDave Martin	  authentication mechanism provided as part of the ARMv8.3 Extensions.
2046383499f8SDave Martin	  For this reason, it does not make sense to enable this option without
2047383499f8SDave Martin	  also enabling support for pointer authentication.  Thus, when
2048383499f8SDave Martin	  enabling this option you should also select ARM64_PTR_AUTH=y.
2049383499f8SDave Martin
2050383499f8SDave Martin	  Userspace binaries must also be specifically compiled to make use of
2051383499f8SDave Martin	  this mechanism.  If you say N here or the hardware does not support
2052383499f8SDave Martin	  BTI, such binaries can still run, but you get no additional
2053383499f8SDave Martin	  enforcement of branch destinations.
2054383499f8SDave Martin
205597fed779SMark Brownconfig ARM64_BTI_KERNEL
205697fed779SMark Brown	bool "Use Branch Target Identification for kernel"
205797fed779SMark Brown	default y
205897fed779SMark Brown	depends on ARM64_BTI
2059b27a9f41SDaniel Kiss	depends on ARM64_PTR_AUTH_KERNEL
206097fed779SMark Brown	depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
20613a88d7c5SWill Deacon	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697
20623a88d7c5SWill Deacon	depends on !CC_IS_GCC || GCC_VERSION >= 100100
2063c0a454b9SMark Brown	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671
2064c0a454b9SMark Brown	depends on !CC_IS_GCC
206526299b3fSMark Rutland	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_ARGS)
206697fed779SMark Brown	help
206797fed779SMark Brown	  Build the kernel with Branch Target Identification annotations
206897fed779SMark Brown	  and enable enforcement of this for kernel code. When this option
206997fed779SMark Brown	  is enabled and the system supports BTI all kernel code including
207097fed779SMark Brown	  modular code must have BTI enabled.
207197fed779SMark Brown
207297fed779SMark Brownconfig CC_HAS_BRANCH_PROT_PAC_RET_BTI
207397fed779SMark Brown	# GCC 9 or later, clang 8 or later
207497fed779SMark Brown	def_bool $(cc-option,-mbranch-protection=pac-ret+leaf+bti)
207597fed779SMark Brown
20763e6c69a0SMark Brownconfig ARM64_E0PD
20773e6c69a0SMark Brown	bool "Enable support for E0PD"
20783e6c69a0SMark Brown	default y
20793e6c69a0SMark Brown	help
20803e6c69a0SMark Brown	  E0PD (part of the ARMv8.5 extensions) allows us to ensure
20813e6c69a0SMark Brown	  that EL0 accesses made via TTBR1 always fault in constant time,
20823e6c69a0SMark Brown	  providing similar benefits to KASLR as those provided by KPTI, but
20833e6c69a0SMark Brown	  with lower overhead and without disrupting legitimate access to
20843e6c69a0SMark Brown	  kernel memory such as SPE.
20853e6c69a0SMark Brown
20863e6c69a0SMark Brown	  This option enables E0PD for TTBR1 where available.
20873e6c69a0SMark Brown
208889b94df9SVincenzo Frascinoconfig ARM64_AS_HAS_MTE
208989b94df9SVincenzo Frascino	# Initial support for MTE went in binutils 2.32.0, checked with
209089b94df9SVincenzo Frascino	# ".arch armv8.5-a+memtag" below. However, this was incomplete
209189b94df9SVincenzo Frascino	# as a late addition to the final architecture spec (LDGM/STGM)
209289b94df9SVincenzo Frascino	# is only supported in the newer 2.32.x and 2.33 binutils
209389b94df9SVincenzo Frascino	# versions, hence the extra "stgm" instruction check below.
209489b94df9SVincenzo Frascino	def_bool $(as-instr,.arch armv8.5-a+memtag\nstgm xzr$(comma)[x0])
209589b94df9SVincenzo Frascino
209689b94df9SVincenzo Frascinoconfig ARM64_MTE
209789b94df9SVincenzo Frascino	bool "Memory Tagging Extension support"
209889b94df9SVincenzo Frascino	default y
209989b94df9SVincenzo Frascino	depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
2100f469c032SVincenzo Frascino	depends on AS_HAS_ARMV8_5
210198c970daSVincenzo Frascino	# Required for tag checking in the uaccess routines
210292b6919dSArd Biesheuvel	select ARM64_PAN
2103f3ba50a7SCatalin Marinas	select ARCH_HAS_SUBPAGE_FAULTS
210489b94df9SVincenzo Frascino	select ARCH_USES_HIGH_VMA_FLAGS
21057a87225aSMatthew Wilcox (Oracle)	select ARCH_USES_PG_ARCH_2
21067a87225aSMatthew Wilcox (Oracle)	select ARCH_USES_PG_ARCH_3
210789b94df9SVincenzo Frascino	help
210889b94df9SVincenzo Frascino	  Memory Tagging (part of the ARMv8.5 Extensions) provides
210989b94df9SVincenzo Frascino	  architectural support for run-time, always-on detection of
211089b94df9SVincenzo Frascino	  various classes of memory error to aid with software debugging
211189b94df9SVincenzo Frascino	  to eliminate vulnerabilities arising from memory-unsafe
211289b94df9SVincenzo Frascino	  languages.
211389b94df9SVincenzo Frascino
211489b94df9SVincenzo Frascino	  This option enables the support for the Memory Tagging
211589b94df9SVincenzo Frascino	  Extension at EL0 (i.e. for userspace).
211689b94df9SVincenzo Frascino
211789b94df9SVincenzo Frascino	  Selecting this option allows the feature to be detected at
211889b94df9SVincenzo Frascino	  runtime. Any secondary CPU not implementing this feature will
211989b94df9SVincenzo Frascino	  not be allowed a late bring-up.
212089b94df9SVincenzo Frascino
212189b94df9SVincenzo Frascino	  Userspace binaries that want to use this feature must
212289b94df9SVincenzo Frascino	  explicitly opt in. The mechanism for the userspace is
212389b94df9SVincenzo Frascino	  described in:
212489b94df9SVincenzo Frascino
21256e4596c4SJonathan Corbet	  Documentation/arch/arm64/memory-tagging-extension.rst.
212689b94df9SVincenzo Frascino
21273cb7e662SJuerg Haefligerendmenu # "ARMv8.5 architectural features"
21283e6c69a0SMark Brown
212918107f8aSVladimir Murzinmenu "ARMv8.7 architectural features"
213018107f8aSVladimir Murzin
213118107f8aSVladimir Murzinconfig ARM64_EPAN
213218107f8aSVladimir Murzin	bool "Enable support for Enhanced Privileged Access Never (EPAN)"
213318107f8aSVladimir Murzin	default y
213418107f8aSVladimir Murzin	depends on ARM64_PAN
213518107f8aSVladimir Murzin	help
213618107f8aSVladimir Murzin	  Enhanced Privileged Access Never (EPAN) allows Privileged
213718107f8aSVladimir Murzin	  Access Never to be used with Execute-only mappings.
213818107f8aSVladimir Murzin
213918107f8aSVladimir Murzin	  The feature is detected at runtime, and will remain disabled
214018107f8aSVladimir Murzin	  if the cpu does not implement the feature.
21413cb7e662SJuerg Haefligerendmenu # "ARMv8.7 architectural features"
214218107f8aSVladimir Murzin
2143836ed3c4SKristina Martsenkoconfig AS_HAS_MOPS
2144836ed3c4SKristina Martsenko	def_bool $(as-instr,.arch_extension mops)
2145836ed3c4SKristina Martsenko
2146b9b9d72dSJoey Goulymenu "ARMv8.9 architectural features"
2147b9b9d72dSJoey Gouly
2148b9b9d72dSJoey Goulyconfig ARM64_POE
2149b9b9d72dSJoey Gouly	prompt "Permission Overlay Extension"
2150b9b9d72dSJoey Gouly	def_bool y
2151b9b9d72dSJoey Gouly	select ARCH_USES_HIGH_VMA_FLAGS
2152b9b9d72dSJoey Gouly	select ARCH_HAS_PKEYS
2153b9b9d72dSJoey Gouly	help
2154b9b9d72dSJoey Gouly	  The Permission Overlay Extension is used to implement Memory
2155b9b9d72dSJoey Gouly	  Protection Keys. Memory Protection Keys provides a mechanism for
2156b9b9d72dSJoey Gouly	  enforcing page-based protections, but without requiring modification
2157b9b9d72dSJoey Gouly	  of the page tables when an application changes protection domains.
2158b9b9d72dSJoey Gouly
2159b9b9d72dSJoey Gouly	  For details, see Documentation/core-api/protection-keys.rst
2160b9b9d72dSJoey Gouly
2161b9b9d72dSJoey Gouly	  If unsure, say y.
2162b9b9d72dSJoey Gouly
2163b9b9d72dSJoey Goulyconfig ARCH_PKEY_BITS
2164b9b9d72dSJoey Gouly	int
2165b9b9d72dSJoey Gouly	default 3
2166b9b9d72dSJoey Gouly
2167efe72541SYicong Yangconfig ARM64_HAFT
2168efe72541SYicong Yang	bool "Support for Hardware managed Access Flag for Table Descriptors"
2169efe72541SYicong Yang	depends on ARM64_HW_AFDBM
2170efe72541SYicong Yang	default y
2171efe72541SYicong Yang	help
2172efe72541SYicong Yang	  The ARMv8.9/ARMv9.5 introduces the feature Hardware managed Access
2173efe72541SYicong Yang	  Flag for Table descriptors. When enabled an architectural executed
2174efe72541SYicong Yang	  memory access will update the Access Flag in each Table descriptor
2175efe72541SYicong Yang	  which is accessed during the translation table walk and for which
2176efe72541SYicong Yang	  the Access Flag is 0. The Access Flag of the Table descriptor use
2177efe72541SYicong Yang	  the same bit of PTE_AF.
2178efe72541SYicong Yang
2179efe72541SYicong Yang	  The feature will only be enabled if all the CPUs in the system
2180efe72541SYicong Yang	  support this feature. If unsure, say Y.
2181efe72541SYicong Yang
2182b9b9d72dSJoey Goulyendmenu # "ARMv8.9 architectural features"
2183b9b9d72dSJoey Gouly
218492d051a1SWill Deaconmenu "ARMv9.4 architectural features"
21855d8b172eSMark Brown
21865d8b172eSMark Brownconfig ARM64_GCS
21875d8b172eSMark Brown	bool "Enable support for Guarded Control Stack (GCS)"
21885d8b172eSMark Brown	default y
21895d8b172eSMark Brown	select ARCH_HAS_USER_SHADOW_STACK
21905d8b172eSMark Brown	select ARCH_USES_HIGH_VMA_FLAGS
21915d8b172eSMark Brown	help
21925d8b172eSMark Brown	  Guarded Control Stack (GCS) provides support for a separate
21935d8b172eSMark Brown	  stack with restricted access which contains only return
21945d8b172eSMark Brown	  addresses.  This can be used to harden against some attacks
21955d8b172eSMark Brown	  by comparing return address used by the program with what is
21965d8b172eSMark Brown	  stored in the GCS, and may also be used to efficiently obtain
21975d8b172eSMark Brown	  the call stack for applications such as profiling.
21985d8b172eSMark Brown
21995d8b172eSMark Brown	  The feature is detected at runtime, and will remain disabled
22005d8b172eSMark Brown	  if the system does not implement the feature.
22015d8b172eSMark Brown
220292d051a1SWill Deaconendmenu # "ARMv9.4 architectural features"
22035d8b172eSMark Brown
2204ddd25ad1SDave Martinconfig ARM64_SVE
2205ddd25ad1SDave Martin	bool "ARM Scalable Vector Extension support"
2206ddd25ad1SDave Martin	default y
2207ddd25ad1SDave Martin	help
2208ddd25ad1SDave Martin	  The Scalable Vector Extension (SVE) is an extension to the AArch64
2209ddd25ad1SDave Martin	  execution state which complements and extends the SIMD functionality
2210ddd25ad1SDave Martin	  of the base architecture to support much larger vectors and to enable
2211ddd25ad1SDave Martin	  additional vectorisation opportunities.
2212ddd25ad1SDave Martin
2213ddd25ad1SDave Martin	  To enable use of this extension on CPUs that implement it, say Y.
2214ddd25ad1SDave Martin
221506a916feSDave Martin	  On CPUs that support the SVE2 extensions, this option will enable
221606a916feSDave Martin	  those too.
221706a916feSDave Martin
22185043694eSDave Martin	  Note that for architectural reasons, firmware _must_ implement SVE
22195043694eSDave Martin	  support when running on SVE capable hardware.  The required support
22205043694eSDave Martin	  is present in:
22215043694eSDave Martin
22225043694eSDave Martin	    * version 1.5 and later of the ARM Trusted Firmware
22235043694eSDave Martin	    * the AArch64 boot wrapper since commit 5e1261e08abf
22245043694eSDave Martin	      ("bootwrapper: SVE: Enable SVE for EL2 and below").
22255043694eSDave Martin
22265043694eSDave Martin	  For other firmware implementations, consult the firmware documentation
22275043694eSDave Martin	  or vendor.
22285043694eSDave Martin
22295043694eSDave Martin	  If you need the kernel to boot on SVE-capable hardware with broken
22305043694eSDave Martin	  firmware, you may need to say N here until you get your firmware
22315043694eSDave Martin	  fixed.  Otherwise, you may experience firmware panics or lockups when
22325043694eSDave Martin	  booting the kernel.  If unsure and you are not observing these
22335043694eSDave Martin	  symptoms, you should assume that it is safe to say Y.
2234fd045f6cSArd Biesheuvel
2235a1f4ccd2SMark Brownconfig ARM64_SME
2236a1f4ccd2SMark Brown	bool "ARM Scalable Matrix Extension support"
2237a1f4ccd2SMark Brown	default y
2238a1f4ccd2SMark Brown	depends on ARM64_SVE
2239a1f4ccd2SMark Brown	help
2240a1f4ccd2SMark Brown	  The Scalable Matrix Extension (SME) is an extension to the AArch64
2241a1f4ccd2SMark Brown	  execution state which utilises a substantial subset of the SVE
2242a1f4ccd2SMark Brown	  instruction set, together with the addition of new architectural
2243a1f4ccd2SMark Brown	  register state capable of holding two dimensional matrix tiles to
2244a1f4ccd2SMark Brown	  enable various matrix operations.
2245a1f4ccd2SMark Brown
2246bc3c03ccSJulien Thierryconfig ARM64_PSEUDO_NMI
2247bc3c03ccSJulien Thierry	bool "Support for NMI-like interrupts"
22483c9c1dcdSJoe Perches	select ARM_GIC_V3
2249bc3c03ccSJulien Thierry	help
2250bc3c03ccSJulien Thierry	  Adds support for mimicking Non-Maskable Interrupts through the use of
2251bc3c03ccSJulien Thierry	  GIC interrupt priority. This support requires version 3 or later of
2252bc15cf70SWill Deacon	  ARM GIC.
2253bc3c03ccSJulien Thierry
2254bc3c03ccSJulien Thierry	  This high priority configuration for interrupts needs to be
2255bc3c03ccSJulien Thierry	  explicitly enabled by setting the kernel parameter
2256bc3c03ccSJulien Thierry	  "irqchip.gicv3_pseudo_nmi" to 1.
2257bc3c03ccSJulien Thierry
2258bc3c03ccSJulien Thierry	  If unsure, say N
2259bc3c03ccSJulien Thierry
226048ce8f80SJulien Thierryif ARM64_PSEUDO_NMI
226148ce8f80SJulien Thierryconfig ARM64_DEBUG_PRIORITY_MASKING
226248ce8f80SJulien Thierry	bool "Debug interrupt priority masking"
226348ce8f80SJulien Thierry	help
226448ce8f80SJulien Thierry	  This adds runtime checks to functions enabling/disabling
226548ce8f80SJulien Thierry	  interrupts when using priority masking. The additional checks verify
226648ce8f80SJulien Thierry	  the validity of ICC_PMR_EL1 when calling concerned functions.
226748ce8f80SJulien Thierry
226848ce8f80SJulien Thierry	  If unsure, say N
22693cb7e662SJuerg Haefligerendif # ARM64_PSEUDO_NMI
227048ce8f80SJulien Thierry
22711e48ef7fSArd Biesheuvelconfig RELOCATABLE
2272dd4bc607SArd Biesheuvel	bool "Build a relocatable kernel image" if EXPERT
22735cf896fbSPeter Collingbourne	select ARCH_HAS_RELR
2274dd4bc607SArd Biesheuvel	default y
22751e48ef7fSArd Biesheuvel	help
22761e48ef7fSArd Biesheuvel	  This builds the kernel as a Position Independent Executable (PIE),
22771e48ef7fSArd Biesheuvel	  which retains all relocation metadata required to relocate the
22781e48ef7fSArd Biesheuvel	  kernel binary at runtime to a different virtual address than the
22791e48ef7fSArd Biesheuvel	  address it was linked at.
22801e48ef7fSArd Biesheuvel	  Since AArch64 uses the RELA relocation format, this requires a
22811e48ef7fSArd Biesheuvel	  relocation pass at runtime even if the kernel is loaded at the
22821e48ef7fSArd Biesheuvel	  same address it was linked at.
22831e48ef7fSArd Biesheuvel
2284f80fb3a3SArd Biesheuvelconfig RANDOMIZE_BASE
2285f80fb3a3SArd Biesheuvel	bool "Randomize the address of the kernel image"
2286f80fb3a3SArd Biesheuvel	select RELOCATABLE
2287f80fb3a3SArd Biesheuvel	help
2288f80fb3a3SArd Biesheuvel	  Randomizes the virtual address at which the kernel image is
2289f80fb3a3SArd Biesheuvel	  loaded, as a security feature that deters exploit attempts
2290f80fb3a3SArd Biesheuvel	  relying on knowledge of the location of kernel internals.
2291f80fb3a3SArd Biesheuvel
2292f80fb3a3SArd Biesheuvel	  It is the bootloader's job to provide entropy, by passing a
2293f80fb3a3SArd Biesheuvel	  random u64 value in /chosen/kaslr-seed at kernel entry.
2294f80fb3a3SArd Biesheuvel
22952b5fe07aSArd Biesheuvel	  When booting via the UEFI stub, it will invoke the firmware's
22962b5fe07aSArd Biesheuvel	  EFI_RNG_PROTOCOL implementation (if available) to supply entropy
22972b5fe07aSArd Biesheuvel	  to the kernel proper. In addition, it will randomise the physical
22982b5fe07aSArd Biesheuvel	  location of the kernel Image as well.
22992b5fe07aSArd Biesheuvel
2300f80fb3a3SArd Biesheuvel	  If unsure, say N.
2301f80fb3a3SArd Biesheuvel
2302f80fb3a3SArd Biesheuvelconfig RANDOMIZE_MODULE_REGION_FULL
2303f9c4ff2aSBarry Song	bool "Randomize the module region over a 2 GB range"
2304e71a4e1bSArd Biesheuvel	depends on RANDOMIZE_BASE
2305f80fb3a3SArd Biesheuvel	default y
2306f80fb3a3SArd Biesheuvel	help
2307f9c4ff2aSBarry Song	  Randomizes the location of the module region inside a 2 GB window
2308f2b9ba87SArd Biesheuvel	  covering the core kernel. This way, it is less likely for modules
2309f80fb3a3SArd Biesheuvel	  to leak information about the location of core kernel data structures
2310f80fb3a3SArd Biesheuvel	  but it does imply that function calls between modules and the core
2311f80fb3a3SArd Biesheuvel	  kernel will need to be resolved via veneers in the module PLT.
2312f80fb3a3SArd Biesheuvel
2313f80fb3a3SArd Biesheuvel	  When this option is not set, the module region will be randomized over
2314f80fb3a3SArd Biesheuvel	  a limited range that contains the [_stext, _etext] interval of the
2315f9c4ff2aSBarry Song	  core kernel, so branch relocations are almost always in range unless
2316ea3752baSMark Rutland	  the region is exhausted. In this particular case of region
2317ea3752baSMark Rutland	  exhaustion, modules might be able to fall back to a larger 2GB area.
2318f80fb3a3SArd Biesheuvel
23190a1213faSArd Biesheuvelconfig CC_HAVE_STACKPROTECTOR_SYSREG
23200a1213faSArd Biesheuvel	def_bool $(cc-option,-mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0)
23210a1213faSArd Biesheuvel
23220a1213faSArd Biesheuvelconfig STACKPROTECTOR_PER_TASK
23230a1213faSArd Biesheuvel	def_bool y
23240a1213faSArd Biesheuvel	depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_SYSREG
23250a1213faSArd Biesheuvel
23263b619e22SArd Biesheuvelconfig UNWIND_PATCH_PAC_INTO_SCS
23273b619e22SArd Biesheuvel	bool "Enable shadow call stack dynamically using code patching"
232823cb0514SNathan Chancellor	depends on CC_IS_CLANG
23293b619e22SArd Biesheuvel	depends on ARM64_PTR_AUTH_KERNEL && CC_HAS_BRANCH_PROT_PAC_RET
23303b619e22SArd Biesheuvel	depends on SHADOW_CALL_STACK
23313b619e22SArd Biesheuvel	select UNWIND_TABLES
23323b619e22SArd Biesheuvel	select DYNAMIC_SCS
23333b619e22SArd Biesheuvel
23344602e575SRyan Robertsconfig ARM64_CONTPTE
23354602e575SRyan Roberts	bool "Contiguous PTE mappings for user memory" if EXPERT
23364602e575SRyan Roberts	depends on TRANSPARENT_HUGEPAGE
23374602e575SRyan Roberts	default y
23384602e575SRyan Roberts	help
23394602e575SRyan Roberts	  When enabled, user mappings are configured using the PTE contiguous
23404602e575SRyan Roberts	  bit, for any mappings that meet the size and alignment requirements.
23414602e575SRyan Roberts	  This reduces TLB pressure and improves performance.
23424602e575SRyan Roberts
23433cb7e662SJuerg Haefligerendmenu # "Kernel Features"
23448c2c3df3SCatalin Marinas
23458c2c3df3SCatalin Marinasmenu "Boot options"
23468c2c3df3SCatalin Marinas
23475e89c55eSLorenzo Pieralisiconfig ARM64_ACPI_PARKING_PROTOCOL
23485e89c55eSLorenzo Pieralisi	bool "Enable support for the ARM64 ACPI parking protocol"
23495e89c55eSLorenzo Pieralisi	depends on ACPI
23505e89c55eSLorenzo Pieralisi	help
23515e89c55eSLorenzo Pieralisi	  Enable support for the ARM64 ACPI parking protocol. If disabled
23525e89c55eSLorenzo Pieralisi	  the kernel will not allow booting through the ARM64 ACPI parking
23535e89c55eSLorenzo Pieralisi	  protocol even if the corresponding data is present in the ACPI
23545e89c55eSLorenzo Pieralisi	  MADT table.
23555e89c55eSLorenzo Pieralisi
23568c2c3df3SCatalin Marinasconfig CMDLINE
23578c2c3df3SCatalin Marinas	string "Default kernel command string"
23588c2c3df3SCatalin Marinas	default ""
23598c2c3df3SCatalin Marinas	help
23608c2c3df3SCatalin Marinas	  Provide a set of default command-line options at build time by
23618c2c3df3SCatalin Marinas	  entering them here. As a minimum, you should specify the the
23628c2c3df3SCatalin Marinas	  root device (e.g. root=/dev/nfs).
23638c2c3df3SCatalin Marinas
23641e40d105STyler Hickschoice
2365b9d73218SMasahiro Yamada	prompt "Kernel command line type"
2366b9d73218SMasahiro Yamada	depends on CMDLINE != ""
23671e40d105STyler Hicks	default CMDLINE_FROM_BOOTLOADER
23681e40d105STyler Hicks	help
23691e40d105STyler Hicks	  Choose how the kernel will handle the provided default kernel
23701e40d105STyler Hicks	  command line string.
23711e40d105STyler Hicks
23721e40d105STyler Hicksconfig CMDLINE_FROM_BOOTLOADER
23731e40d105STyler Hicks	bool "Use bootloader kernel arguments if available"
23741e40d105STyler Hicks	help
23751e40d105STyler Hicks	  Uses the command-line options passed by the boot loader. If
23761e40d105STyler Hicks	  the boot loader doesn't provide any, the default kernel command
23771e40d105STyler Hicks	  string provided in CMDLINE will be used.
23781e40d105STyler Hicks
23798c2c3df3SCatalin Marinasconfig CMDLINE_FORCE
23808c2c3df3SCatalin Marinas	bool "Always use the default kernel command string"
23818c2c3df3SCatalin Marinas	help
23828c2c3df3SCatalin Marinas	  Always use the default kernel command string, even if the boot
23838c2c3df3SCatalin Marinas	  loader passes other arguments to the kernel.
23848c2c3df3SCatalin Marinas	  This is useful if you cannot or don't want to change the
23858c2c3df3SCatalin Marinas	  command-line options your boot loader passes to the kernel.
23868c2c3df3SCatalin Marinas
23871e40d105STyler Hicksendchoice
23881e40d105STyler Hicks
2389f4f75ad5SArd Biesheuvelconfig EFI_STUB
2390f4f75ad5SArd Biesheuvel	bool
2391f4f75ad5SArd Biesheuvel
2392f84d0275SMark Salterconfig EFI
2393f84d0275SMark Salter	bool "UEFI runtime support"
2394f84d0275SMark Salter	depends on OF && !CPU_BIG_ENDIAN
2395b472db6cSDave Martin	depends on KERNEL_MODE_NEON
23962c870e61SArnd Bergmann	select ARCH_SUPPORTS_ACPI
2397f84d0275SMark Salter	select LIBFDT
2398f84d0275SMark Salter	select UCS2_STRING
2399f84d0275SMark Salter	select EFI_PARAMS_FROM_FDT
2400e15dd494SArd Biesheuvel	select EFI_RUNTIME_WRAPPERS
2401f4f75ad5SArd Biesheuvel	select EFI_STUB
24022e0eb483SAtish Patra	select EFI_GENERIC_STUB
24038d39cee0SChester Lin	imply IMA_SECURE_AND_OR_TRUSTED_BOOT
2404f84d0275SMark Salter	default y
2405f84d0275SMark Salter	help
2406f84d0275SMark Salter	  This option provides support for runtime services provided
2407f84d0275SMark Salter	  by UEFI firmware (such as non-volatile variables, realtime
24083c7f2550SMark Salter	  clock, and platform reset). A UEFI stub is also provided to
24093c7f2550SMark Salter	  allow the kernel to be booted as an EFI application. This
24103c7f2550SMark Salter	  is only useful on systems that have UEFI firmware.
2411f84d0275SMark Salter
24124c7be57fSLinus Torvaldsconfig COMPRESSED_INSTALL
24134c7be57fSLinus Torvalds	bool "Install compressed image by default"
24144c7be57fSLinus Torvalds	help
24154c7be57fSLinus Torvalds	  This makes the regular "make install" install the compressed
24164c7be57fSLinus Torvalds	  image we built, not the legacy uncompressed one.
24174c7be57fSLinus Torvalds
24184c7be57fSLinus Torvalds	  You can check that a compressed image works for you by doing
24194c7be57fSLinus Torvalds	  "make zinstall" first, and verifying that everything is fine
24204c7be57fSLinus Torvalds	  in your environment before making "make install" do this for
24214c7be57fSLinus Torvalds	  you.
24224c7be57fSLinus Torvalds
2423d1ae8c00SYi Liconfig DMI
2424d1ae8c00SYi Li	bool "Enable support for SMBIOS (DMI) tables"
2425d1ae8c00SYi Li	depends on EFI
2426d1ae8c00SYi Li	default y
2427d1ae8c00SYi Li	help
2428d1ae8c00SYi Li	  This enables SMBIOS/DMI feature for systems.
2429d1ae8c00SYi Li
2430d1ae8c00SYi Li	  This option is only useful on systems that have UEFI firmware.
2431d1ae8c00SYi Li	  However, even with this option, the resultant kernel should
2432d1ae8c00SYi Li	  continue to boot on existing non-UEFI platforms.
2433d1ae8c00SYi Li
24343cb7e662SJuerg Haefligerendmenu # "Boot options"
24358c2c3df3SCatalin Marinas
2436166936baSLorenzo Pieralisimenu "Power management options"
2437166936baSLorenzo Pieralisi
2438166936baSLorenzo Pieralisisource "kernel/power/Kconfig"
2439166936baSLorenzo Pieralisi
244082869ac5SJames Morseconfig ARCH_HIBERNATION_POSSIBLE
244182869ac5SJames Morse	def_bool y
244282869ac5SJames Morse	depends on CPU_PM
244382869ac5SJames Morse
244482869ac5SJames Morseconfig ARCH_HIBERNATION_HEADER
244582869ac5SJames Morse	def_bool y
244682869ac5SJames Morse	depends on HIBERNATION
244782869ac5SJames Morse
2448166936baSLorenzo Pieralisiconfig ARCH_SUSPEND_POSSIBLE
2449166936baSLorenzo Pieralisi	def_bool y
2450166936baSLorenzo Pieralisi
24513cb7e662SJuerg Haefligerendmenu # "Power management options"
2452166936baSLorenzo Pieralisi
24531307220dSLorenzo Pieralisimenu "CPU Power Management"
24541307220dSLorenzo Pieralisi
24551307220dSLorenzo Pieralisisource "drivers/cpuidle/Kconfig"
24561307220dSLorenzo Pieralisi
245752e7e816SRob Herringsource "drivers/cpufreq/Kconfig"
245852e7e816SRob Herring
24593cb7e662SJuerg Haefligerendmenu # "CPU Power Management"
246052e7e816SRob Herring
2461b6a02173SGraeme Gregorysource "drivers/acpi/Kconfig"
2462b6a02173SGraeme Gregory
2463c3eb5b14SMarc Zyngiersource "arch/arm64/kvm/Kconfig"
2464c3eb5b14SMarc Zyngier
2465fd1e0fd7SSong Liusource "kernel/livepatch/Kconfig"
2466