162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ciconfig ARM64
362306a36Sopenharmony_ci	def_bool y
462306a36Sopenharmony_ci	select ACPI_APMT if ACPI
562306a36Sopenharmony_ci	select ACPI_CCA_REQUIRED if ACPI
662306a36Sopenharmony_ci	select ACPI_GENERIC_GSI if ACPI
762306a36Sopenharmony_ci	select ACPI_GTDT if ACPI
862306a36Sopenharmony_ci	select ACPI_IORT if ACPI
962306a36Sopenharmony_ci	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
1062306a36Sopenharmony_ci	select ACPI_MCFG if (ACPI && PCI)
1162306a36Sopenharmony_ci	select ACPI_SPCR_TABLE if ACPI
1262306a36Sopenharmony_ci	select ACPI_PPTT if ACPI
1362306a36Sopenharmony_ci	select ARCH_HAS_DEBUG_WX
1462306a36Sopenharmony_ci	select ARCH_BINFMT_ELF_EXTRA_PHDRS
1562306a36Sopenharmony_ci	select ARCH_BINFMT_ELF_STATE
1662306a36Sopenharmony_ci	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
1762306a36Sopenharmony_ci	select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
1862306a36Sopenharmony_ci	select ARCH_ENABLE_MEMORY_HOTPLUG
1962306a36Sopenharmony_ci	select ARCH_ENABLE_MEMORY_HOTREMOVE
2062306a36Sopenharmony_ci	select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
2162306a36Sopenharmony_ci	select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
2262306a36Sopenharmony_ci	select ARCH_HAS_CACHE_LINE_SIZE
2362306a36Sopenharmony_ci	select ARCH_HAS_CURRENT_STACK_POINTER
2462306a36Sopenharmony_ci	select ARCH_HAS_DEBUG_VIRTUAL
2562306a36Sopenharmony_ci	select ARCH_HAS_DEBUG_VM_PGTABLE
2662306a36Sopenharmony_ci	select ARCH_HAS_DMA_PREP_COHERENT
2762306a36Sopenharmony_ci	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
2862306a36Sopenharmony_ci	select ARCH_HAS_FAST_MULTIPLIER
2962306a36Sopenharmony_ci	select ARCH_HAS_FORTIFY_SOURCE
3062306a36Sopenharmony_ci	select ARCH_HAS_GCOV_PROFILE_ALL
3162306a36Sopenharmony_ci	select ARCH_HAS_GIGANTIC_PAGE
3262306a36Sopenharmony_ci	select ARCH_HAS_KCOV
3362306a36Sopenharmony_ci	select ARCH_HAS_KEEPINITRD
3462306a36Sopenharmony_ci	select ARCH_HAS_MEMBARRIER_SYNC_CORE
3562306a36Sopenharmony_ci	select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
3662306a36Sopenharmony_ci	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
3762306a36Sopenharmony_ci	select ARCH_HAS_PTE_DEVMAP
3862306a36Sopenharmony_ci	select ARCH_HAS_PTE_SPECIAL
3962306a36Sopenharmony_ci	select ARCH_HAS_SETUP_DMA_OPS
4062306a36Sopenharmony_ci	select ARCH_HAS_SET_DIRECT_MAP
4162306a36Sopenharmony_ci	select ARCH_HAS_SET_MEMORY
4262306a36Sopenharmony_ci	select ARCH_STACKWALK
4362306a36Sopenharmony_ci	select ARCH_HAS_STRICT_KERNEL_RWX
4462306a36Sopenharmony_ci	select ARCH_HAS_STRICT_MODULE_RWX
4562306a36Sopenharmony_ci	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
4662306a36Sopenharmony_ci	select ARCH_HAS_SYNC_DMA_FOR_CPU
4762306a36Sopenharmony_ci	select ARCH_HAS_SYSCALL_WRAPPER
4862306a36Sopenharmony_ci	select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT
4962306a36Sopenharmony_ci	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
5062306a36Sopenharmony_ci	select ARCH_HAS_ZONE_DMA_SET if EXPERT
5162306a36Sopenharmony_ci	select ARCH_HAVE_ELF_PROT
5262306a36Sopenharmony_ci	select ARCH_HAVE_NMI_SAFE_CMPXCHG
5362306a36Sopenharmony_ci	select ARCH_HAVE_TRACE_MMIO_ACCESS
5462306a36Sopenharmony_ci	select ARCH_INLINE_READ_LOCK if !PREEMPTION
5562306a36Sopenharmony_ci	select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION
5662306a36Sopenharmony_ci	select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPTION
5762306a36Sopenharmony_ci	select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPTION
5862306a36Sopenharmony_ci	select ARCH_INLINE_READ_UNLOCK if !PREEMPTION
5962306a36Sopenharmony_ci	select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPTION
6062306a36Sopenharmony_ci	select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPTION
6162306a36Sopenharmony_ci	select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPTION
6262306a36Sopenharmony_ci	select ARCH_INLINE_WRITE_LOCK if !PREEMPTION
6362306a36Sopenharmony_ci	select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPTION
6462306a36Sopenharmony_ci	select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPTION
6562306a36Sopenharmony_ci	select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPTION
6662306a36Sopenharmony_ci	select ARCH_INLINE_WRITE_UNLOCK if !PREEMPTION
6762306a36Sopenharmony_ci	select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPTION
6862306a36Sopenharmony_ci	select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPTION
6962306a36Sopenharmony_ci	select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPTION
7062306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPTION
7162306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPTION
7262306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_LOCK if !PREEMPTION
7362306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPTION
7462306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPTION
7562306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPTION
7662306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_UNLOCK if !PREEMPTION
7762306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
7862306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
7962306a36Sopenharmony_ci	select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
8062306a36Sopenharmony_ci	select ARCH_KEEP_MEMBLOCK
8162306a36Sopenharmony_ci	select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
8262306a36Sopenharmony_ci	select ARCH_USE_CMPXCHG_LOCKREF
8362306a36Sopenharmony_ci	select ARCH_USE_GNU_PROPERTY
8462306a36Sopenharmony_ci	select ARCH_USE_MEMTEST
8562306a36Sopenharmony_ci	select ARCH_USE_QUEUED_RWLOCKS
8662306a36Sopenharmony_ci	select ARCH_USE_QUEUED_SPINLOCKS
8762306a36Sopenharmony_ci	select ARCH_USE_SYM_ANNOTATIONS
8862306a36Sopenharmony_ci	select ARCH_SUPPORTS_DEBUG_PAGEALLOC
8962306a36Sopenharmony_ci	select ARCH_SUPPORTS_HUGETLBFS
9062306a36Sopenharmony_ci	select ARCH_SUPPORTS_MEMORY_FAILURE
9162306a36Sopenharmony_ci	select ARCH_SUPPORTS_SHADOW_CALL_STACK if CC_HAVE_SHADOW_CALL_STACK
9262306a36Sopenharmony_ci	select ARCH_SUPPORTS_LTO_CLANG if CPU_LITTLE_ENDIAN
9362306a36Sopenharmony_ci	select ARCH_SUPPORTS_LTO_CLANG_THIN
9462306a36Sopenharmony_ci	select ARCH_SUPPORTS_CFI_CLANG
9562306a36Sopenharmony_ci	select ARCH_SUPPORTS_ATOMIC_RMW
9662306a36Sopenharmony_ci	select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
9762306a36Sopenharmony_ci	select ARCH_SUPPORTS_NUMA_BALANCING
9862306a36Sopenharmony_ci	select ARCH_SUPPORTS_PAGE_TABLE_CHECK
9962306a36Sopenharmony_ci	select ARCH_SUPPORTS_PER_VMA_LOCK
10062306a36Sopenharmony_ci	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
10162306a36Sopenharmony_ci	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
10262306a36Sopenharmony_ci	select ARCH_WANT_DEFAULT_BPF_JIT
10362306a36Sopenharmony_ci	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
10462306a36Sopenharmony_ci	select ARCH_WANT_FRAME_POINTERS
10562306a36Sopenharmony_ci	select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
10662306a36Sopenharmony_ci	select ARCH_WANT_LD_ORPHAN_WARN
10762306a36Sopenharmony_ci	select ARCH_WANTS_NO_INSTR
10862306a36Sopenharmony_ci	select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES
10962306a36Sopenharmony_ci	select ARCH_HAS_UBSAN_SANITIZE_ALL
11062306a36Sopenharmony_ci	select ARM_AMBA
11162306a36Sopenharmony_ci	select ARM_ARCH_TIMER
11262306a36Sopenharmony_ci	select ARM_GIC
11362306a36Sopenharmony_ci	select AUDIT_ARCH_COMPAT_GENERIC
11462306a36Sopenharmony_ci	select ARM_GIC_V2M if PCI
11562306a36Sopenharmony_ci	select ARM_GIC_V3
11662306a36Sopenharmony_ci	select ARM_GIC_V3_ITS if PCI
11762306a36Sopenharmony_ci	select ARM_PSCI_FW
11862306a36Sopenharmony_ci	select BUILDTIME_TABLE_SORT
11962306a36Sopenharmony_ci	select CLONE_BACKWARDS
12062306a36Sopenharmony_ci	select COMMON_CLK
12162306a36Sopenharmony_ci	select CPU_PM if (SUSPEND || CPU_IDLE)
12262306a36Sopenharmony_ci	select CRC32
12362306a36Sopenharmony_ci	select DCACHE_WORD_ACCESS
12462306a36Sopenharmony_ci	select DYNAMIC_FTRACE if FUNCTION_TRACER
12562306a36Sopenharmony_ci	select DMA_BOUNCE_UNALIGNED_KMALLOC
12662306a36Sopenharmony_ci	select DMA_DIRECT_REMAP
12762306a36Sopenharmony_ci	select EDAC_SUPPORT
12862306a36Sopenharmony_ci	select FRAME_POINTER
12962306a36Sopenharmony_ci	select FUNCTION_ALIGNMENT_4B
13062306a36Sopenharmony_ci	select FUNCTION_ALIGNMENT_8B if DYNAMIC_FTRACE_WITH_CALL_OPS
13162306a36Sopenharmony_ci	select GENERIC_ALLOCATOR
13262306a36Sopenharmony_ci	select GENERIC_ARCH_TOPOLOGY
13362306a36Sopenharmony_ci	select GENERIC_CLOCKEVENTS_BROADCAST
13462306a36Sopenharmony_ci	select GENERIC_CPU_AUTOPROBE
13562306a36Sopenharmony_ci	select GENERIC_CPU_VULNERABILITIES
13662306a36Sopenharmony_ci	select GENERIC_EARLY_IOREMAP
13762306a36Sopenharmony_ci	select GENERIC_IDLE_POLL_SETUP
13862306a36Sopenharmony_ci	select GENERIC_IOREMAP
13962306a36Sopenharmony_ci	select GENERIC_IRQ_IPI
14062306a36Sopenharmony_ci	select GENERIC_IRQ_PROBE
14162306a36Sopenharmony_ci	select GENERIC_IRQ_SHOW
14262306a36Sopenharmony_ci	select GENERIC_IRQ_SHOW_LEVEL
14362306a36Sopenharmony_ci	select GENERIC_LIB_DEVMEM_IS_ALLOWED
14462306a36Sopenharmony_ci	select GENERIC_PCI_IOMAP
14562306a36Sopenharmony_ci	select GENERIC_PTDUMP
14662306a36Sopenharmony_ci	select GENERIC_SCHED_CLOCK
14762306a36Sopenharmony_ci	select GENERIC_SMP_IDLE_THREAD
14862306a36Sopenharmony_ci	select GENERIC_TIME_VSYSCALL
14962306a36Sopenharmony_ci	select GENERIC_GETTIMEOFDAY
15062306a36Sopenharmony_ci	select GENERIC_VDSO_TIME_NS
15162306a36Sopenharmony_ci	select HARDIRQS_SW_RESEND
15262306a36Sopenharmony_ci	select HAS_IOPORT
15362306a36Sopenharmony_ci	select HAVE_MOVE_PMD
15462306a36Sopenharmony_ci	select HAVE_MOVE_PUD
15562306a36Sopenharmony_ci	select HAVE_PCI
15662306a36Sopenharmony_ci	select HAVE_ACPI_APEI if (ACPI && EFI)
15762306a36Sopenharmony_ci	select HAVE_ALIGNED_STRUCT_PAGE if SLUB
15862306a36Sopenharmony_ci	select HAVE_ARCH_AUDITSYSCALL
15962306a36Sopenharmony_ci	select HAVE_ARCH_BITREVERSE
16062306a36Sopenharmony_ci	select HAVE_ARCH_COMPILER_H
16162306a36Sopenharmony_ci	select HAVE_ARCH_HUGE_VMALLOC
16262306a36Sopenharmony_ci	select HAVE_ARCH_HUGE_VMAP
16362306a36Sopenharmony_ci	select HAVE_ARCH_JUMP_LABEL
16462306a36Sopenharmony_ci	select HAVE_ARCH_JUMP_LABEL_RELATIVE
16562306a36Sopenharmony_ci	select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
16662306a36Sopenharmony_ci	select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
16762306a36Sopenharmony_ci	select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
16862306a36Sopenharmony_ci	select HAVE_ARCH_KASAN_HW_TAGS if (HAVE_ARCH_KASAN && ARM64_MTE)
16962306a36Sopenharmony_ci	# Some instrumentation may be unsound, hence EXPERT
17062306a36Sopenharmony_ci	select HAVE_ARCH_KCSAN if EXPERT
17162306a36Sopenharmony_ci	select HAVE_ARCH_KFENCE
17262306a36Sopenharmony_ci	select HAVE_ARCH_KGDB
17362306a36Sopenharmony_ci	select HAVE_ARCH_MMAP_RND_BITS
17462306a36Sopenharmony_ci	select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
17562306a36Sopenharmony_ci	select HAVE_ARCH_PREL32_RELOCATIONS
17662306a36Sopenharmony_ci	select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
17762306a36Sopenharmony_ci	select HAVE_ARCH_SECCOMP_FILTER
17862306a36Sopenharmony_ci	select HAVE_ARCH_STACKLEAK
17962306a36Sopenharmony_ci	select HAVE_ARCH_THREAD_STRUCT_WHITELIST
18062306a36Sopenharmony_ci	select HAVE_ARCH_TRACEHOOK
18162306a36Sopenharmony_ci	select HAVE_ARCH_TRANSPARENT_HUGEPAGE
18262306a36Sopenharmony_ci	select HAVE_ARCH_VMAP_STACK
18362306a36Sopenharmony_ci	select HAVE_ARM_SMCCC
18462306a36Sopenharmony_ci	select HAVE_ASM_MODVERSIONS
18562306a36Sopenharmony_ci	select HAVE_EBPF_JIT
18662306a36Sopenharmony_ci	select HAVE_C_RECORDMCOUNT
18762306a36Sopenharmony_ci	select HAVE_CMPXCHG_DOUBLE
18862306a36Sopenharmony_ci	select HAVE_CMPXCHG_LOCAL
18962306a36Sopenharmony_ci	select HAVE_CONTEXT_TRACKING_USER
19062306a36Sopenharmony_ci	select HAVE_DEBUG_KMEMLEAK
19162306a36Sopenharmony_ci	select HAVE_DMA_CONTIGUOUS
19262306a36Sopenharmony_ci	select HAVE_DYNAMIC_FTRACE
19362306a36Sopenharmony_ci	select HAVE_DYNAMIC_FTRACE_WITH_ARGS \
19462306a36Sopenharmony_ci		if $(cc-option,-fpatchable-function-entry=2)
19562306a36Sopenharmony_ci	select HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS \
19662306a36Sopenharmony_ci		if DYNAMIC_FTRACE_WITH_ARGS && DYNAMIC_FTRACE_WITH_CALL_OPS
19762306a36Sopenharmony_ci	select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS \
19862306a36Sopenharmony_ci		if (DYNAMIC_FTRACE_WITH_ARGS && !CFI_CLANG && \
19962306a36Sopenharmony_ci		    (CC_IS_CLANG || !CC_OPTIMIZE_FOR_SIZE))
20062306a36Sopenharmony_ci	select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \
20162306a36Sopenharmony_ci		if DYNAMIC_FTRACE_WITH_ARGS
20262306a36Sopenharmony_ci	select HAVE_SAMPLE_FTRACE_DIRECT
20362306a36Sopenharmony_ci	select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
20462306a36Sopenharmony_ci	select HAVE_EFFICIENT_UNALIGNED_ACCESS
20562306a36Sopenharmony_ci	select HAVE_FAST_GUP
20662306a36Sopenharmony_ci	select HAVE_FTRACE_MCOUNT_RECORD
20762306a36Sopenharmony_ci	select HAVE_FUNCTION_TRACER
20862306a36Sopenharmony_ci	select HAVE_FUNCTION_ERROR_INJECTION
20962306a36Sopenharmony_ci	select HAVE_FUNCTION_GRAPH_RETVAL if HAVE_FUNCTION_GRAPH_TRACER
21062306a36Sopenharmony_ci	select HAVE_FUNCTION_GRAPH_TRACER
21162306a36Sopenharmony_ci	select HAVE_GCC_PLUGINS
21262306a36Sopenharmony_ci	select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && \
21362306a36Sopenharmony_ci		HW_PERF_EVENTS && HAVE_PERF_EVENTS_NMI
21462306a36Sopenharmony_ci	select HAVE_HW_BREAKPOINT if PERF_EVENTS
21562306a36Sopenharmony_ci	select HAVE_IOREMAP_PROT
21662306a36Sopenharmony_ci	select HAVE_IRQ_TIME_ACCOUNTING
21762306a36Sopenharmony_ci	select HAVE_KVM
21862306a36Sopenharmony_ci	select HAVE_MOD_ARCH_SPECIFIC
21962306a36Sopenharmony_ci	select HAVE_NMI
22062306a36Sopenharmony_ci	select HAVE_PERF_EVENTS
22162306a36Sopenharmony_ci	select HAVE_PERF_EVENTS_NMI if ARM64_PSEUDO_NMI
22262306a36Sopenharmony_ci	select HAVE_PERF_REGS
22362306a36Sopenharmony_ci	select HAVE_PERF_USER_STACK_DUMP
22462306a36Sopenharmony_ci	select HAVE_PREEMPT_DYNAMIC_KEY
22562306a36Sopenharmony_ci	select HAVE_REGS_AND_STACK_ACCESS_API
22662306a36Sopenharmony_ci	select HAVE_POSIX_CPU_TIMERS_TASK_WORK
22762306a36Sopenharmony_ci	select HAVE_FUNCTION_ARG_ACCESS_API
22862306a36Sopenharmony_ci	select MMU_GATHER_RCU_TABLE_FREE
22962306a36Sopenharmony_ci	select HAVE_RSEQ
23062306a36Sopenharmony_ci	select HAVE_STACKPROTECTOR
23162306a36Sopenharmony_ci	select HAVE_SYSCALL_TRACEPOINTS
23262306a36Sopenharmony_ci	select HAVE_KPROBES
23362306a36Sopenharmony_ci	select HAVE_KRETPROBES
23462306a36Sopenharmony_ci	select HAVE_GENERIC_VDSO
23562306a36Sopenharmony_ci	select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
23662306a36Sopenharmony_ci	select IRQ_DOMAIN
23762306a36Sopenharmony_ci	select IRQ_FORCED_THREADING
23862306a36Sopenharmony_ci	select KASAN_VMALLOC if KASAN
23962306a36Sopenharmony_ci	select LOCK_MM_AND_FIND_VMA
24062306a36Sopenharmony_ci	select MODULES_USE_ELF_RELA
24162306a36Sopenharmony_ci	select NEED_DMA_MAP_STATE
24262306a36Sopenharmony_ci	select NEED_SG_DMA_LENGTH
24362306a36Sopenharmony_ci	select OF
24462306a36Sopenharmony_ci	select OF_EARLY_FLATTREE
24562306a36Sopenharmony_ci	select PCI_DOMAINS_GENERIC if PCI
24662306a36Sopenharmony_ci	select PCI_ECAM if (ACPI && PCI)
24762306a36Sopenharmony_ci	select PCI_SYSCALL if PCI
24862306a36Sopenharmony_ci	select POWER_RESET
24962306a36Sopenharmony_ci	select POWER_SUPPLY
25062306a36Sopenharmony_ci	select SPARSE_IRQ
25162306a36Sopenharmony_ci	select SWIOTLB
25262306a36Sopenharmony_ci	select SYSCTL_EXCEPTION_TRACE
25362306a36Sopenharmony_ci	select THREAD_INFO_IN_TASK
25462306a36Sopenharmony_ci	select HAVE_ARCH_USERFAULTFD_MINOR if USERFAULTFD
25562306a36Sopenharmony_ci	select TRACE_IRQFLAGS_SUPPORT
25662306a36Sopenharmony_ci	select TRACE_IRQFLAGS_NMI_SUPPORT
25762306a36Sopenharmony_ci	select HAVE_SOFTIRQ_ON_OWN_STACK
25862306a36Sopenharmony_ci	help
25962306a36Sopenharmony_ci	  ARM 64-bit (AArch64) Linux support.
26062306a36Sopenharmony_ci
26162306a36Sopenharmony_ciconfig CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS
26262306a36Sopenharmony_ci	def_bool CC_IS_CLANG
26362306a36Sopenharmony_ci	# https://github.com/ClangBuiltLinux/linux/issues/1507
26462306a36Sopenharmony_ci	depends on AS_IS_GNU || (AS_IS_LLVM && (LD_IS_LLD || LD_VERSION >= 23600))
26562306a36Sopenharmony_ci	select HAVE_DYNAMIC_FTRACE_WITH_ARGS
26662306a36Sopenharmony_ci
26762306a36Sopenharmony_ciconfig GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS
26862306a36Sopenharmony_ci	def_bool CC_IS_GCC
26962306a36Sopenharmony_ci	depends on $(cc-option,-fpatchable-function-entry=2)
27062306a36Sopenharmony_ci	select HAVE_DYNAMIC_FTRACE_WITH_ARGS
27162306a36Sopenharmony_ci
27262306a36Sopenharmony_ciconfig 64BIT
27362306a36Sopenharmony_ci	def_bool y
27462306a36Sopenharmony_ci
27562306a36Sopenharmony_ciconfig MMU
27662306a36Sopenharmony_ci	def_bool y
27762306a36Sopenharmony_ci
27862306a36Sopenharmony_ciconfig ARM64_PAGE_SHIFT
27962306a36Sopenharmony_ci	int
28062306a36Sopenharmony_ci	default 16 if ARM64_64K_PAGES
28162306a36Sopenharmony_ci	default 14 if ARM64_16K_PAGES
28262306a36Sopenharmony_ci	default 12
28362306a36Sopenharmony_ci
28462306a36Sopenharmony_ciconfig ARM64_CONT_PTE_SHIFT
28562306a36Sopenharmony_ci	int
28662306a36Sopenharmony_ci	default 5 if ARM64_64K_PAGES
28762306a36Sopenharmony_ci	default 7 if ARM64_16K_PAGES
28862306a36Sopenharmony_ci	default 4
28962306a36Sopenharmony_ci
29062306a36Sopenharmony_ciconfig ARM64_CONT_PMD_SHIFT
29162306a36Sopenharmony_ci	int
29262306a36Sopenharmony_ci	default 5 if ARM64_64K_PAGES
29362306a36Sopenharmony_ci	default 5 if ARM64_16K_PAGES
29462306a36Sopenharmony_ci	default 4
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_ciconfig ARCH_MMAP_RND_BITS_MIN
29762306a36Sopenharmony_ci	default 14 if ARM64_64K_PAGES
29862306a36Sopenharmony_ci	default 16 if ARM64_16K_PAGES
29962306a36Sopenharmony_ci	default 18
30062306a36Sopenharmony_ci
30162306a36Sopenharmony_ci# max bits determined by the following formula:
30262306a36Sopenharmony_ci#  VA_BITS - PAGE_SHIFT - 3
30362306a36Sopenharmony_ciconfig ARCH_MMAP_RND_BITS_MAX
30462306a36Sopenharmony_ci	default 19 if ARM64_VA_BITS=36
30562306a36Sopenharmony_ci	default 24 if ARM64_VA_BITS=39
30662306a36Sopenharmony_ci	default 27 if ARM64_VA_BITS=42
30762306a36Sopenharmony_ci	default 30 if ARM64_VA_BITS=47
30862306a36Sopenharmony_ci	default 29 if ARM64_VA_BITS=48 && ARM64_64K_PAGES
30962306a36Sopenharmony_ci	default 31 if ARM64_VA_BITS=48 && ARM64_16K_PAGES
31062306a36Sopenharmony_ci	default 33 if ARM64_VA_BITS=48
31162306a36Sopenharmony_ci	default 14 if ARM64_64K_PAGES
31262306a36Sopenharmony_ci	default 16 if ARM64_16K_PAGES
31362306a36Sopenharmony_ci	default 18
31462306a36Sopenharmony_ci
31562306a36Sopenharmony_ciconfig ARCH_MMAP_RND_COMPAT_BITS_MIN
31662306a36Sopenharmony_ci	default 7 if ARM64_64K_PAGES
31762306a36Sopenharmony_ci	default 9 if ARM64_16K_PAGES
31862306a36Sopenharmony_ci	default 11
31962306a36Sopenharmony_ci
32062306a36Sopenharmony_ciconfig ARCH_MMAP_RND_COMPAT_BITS_MAX
32162306a36Sopenharmony_ci	default 16
32262306a36Sopenharmony_ci
32362306a36Sopenharmony_ciconfig NO_IOPORT_MAP
32462306a36Sopenharmony_ci	def_bool y if !PCI
32562306a36Sopenharmony_ci
32662306a36Sopenharmony_ciconfig STACKTRACE_SUPPORT
32762306a36Sopenharmony_ci	def_bool y
32862306a36Sopenharmony_ci
32962306a36Sopenharmony_ciconfig ILLEGAL_POINTER_VALUE
33062306a36Sopenharmony_ci	hex
33162306a36Sopenharmony_ci	default 0xdead000000000000
33262306a36Sopenharmony_ci
33362306a36Sopenharmony_ciconfig LOCKDEP_SUPPORT
33462306a36Sopenharmony_ci	def_bool y
33562306a36Sopenharmony_ci
33662306a36Sopenharmony_ciconfig GENERIC_BUG
33762306a36Sopenharmony_ci	def_bool y
33862306a36Sopenharmony_ci	depends on BUG
33962306a36Sopenharmony_ci
34062306a36Sopenharmony_ciconfig GENERIC_BUG_RELATIVE_POINTERS
34162306a36Sopenharmony_ci	def_bool y
34262306a36Sopenharmony_ci	depends on GENERIC_BUG
34362306a36Sopenharmony_ci
34462306a36Sopenharmony_ciconfig GENERIC_HWEIGHT
34562306a36Sopenharmony_ci	def_bool y
34662306a36Sopenharmony_ci
34762306a36Sopenharmony_ciconfig GENERIC_CSUM
34862306a36Sopenharmony_ci	def_bool y
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ciconfig GENERIC_CALIBRATE_DELAY
35162306a36Sopenharmony_ci	def_bool y
35262306a36Sopenharmony_ci
35362306a36Sopenharmony_ciconfig SMP
35462306a36Sopenharmony_ci	def_bool y
35562306a36Sopenharmony_ci
35662306a36Sopenharmony_ciconfig KERNEL_MODE_NEON
35762306a36Sopenharmony_ci	def_bool y
35862306a36Sopenharmony_ci
35962306a36Sopenharmony_ciconfig FIX_EARLYCON_MEM
36062306a36Sopenharmony_ci	def_bool y
36162306a36Sopenharmony_ci
36262306a36Sopenharmony_ciconfig PGTABLE_LEVELS
36362306a36Sopenharmony_ci	int
36462306a36Sopenharmony_ci	default 2 if ARM64_16K_PAGES && ARM64_VA_BITS_36
36562306a36Sopenharmony_ci	default 2 if ARM64_64K_PAGES && ARM64_VA_BITS_42
36662306a36Sopenharmony_ci	default 3 if ARM64_64K_PAGES && (ARM64_VA_BITS_48 || ARM64_VA_BITS_52)
36762306a36Sopenharmony_ci	default 3 if ARM64_4K_PAGES && ARM64_VA_BITS_39
36862306a36Sopenharmony_ci	default 3 if ARM64_16K_PAGES && ARM64_VA_BITS_47
36962306a36Sopenharmony_ci	default 4 if !ARM64_64K_PAGES && ARM64_VA_BITS_48
37062306a36Sopenharmony_ci
37162306a36Sopenharmony_ciconfig ARCH_SUPPORTS_UPROBES
37262306a36Sopenharmony_ci	def_bool y
37362306a36Sopenharmony_ci
37462306a36Sopenharmony_ciconfig ARCH_PROC_KCORE_TEXT
37562306a36Sopenharmony_ci	def_bool y
37662306a36Sopenharmony_ci
37762306a36Sopenharmony_ciconfig BROKEN_GAS_INST
37862306a36Sopenharmony_ci	def_bool !$(as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n)
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_ciconfig BUILTIN_RETURN_ADDRESS_STRIPS_PAC
38162306a36Sopenharmony_ci	bool
38262306a36Sopenharmony_ci	# Clang's __builtin_return_adddress() strips the PAC since 12.0.0
38362306a36Sopenharmony_ci	# https://reviews.llvm.org/D75044
38462306a36Sopenharmony_ci	default y if CC_IS_CLANG && (CLANG_VERSION >= 120000)
38562306a36Sopenharmony_ci	# GCC's __builtin_return_address() strips the PAC since 11.1.0,
38662306a36Sopenharmony_ci	# and this was backported to 10.2.0, 9.4.0, 8.5.0, but not earlier
38762306a36Sopenharmony_ci	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94891
38862306a36Sopenharmony_ci	default y if CC_IS_GCC && (GCC_VERSION >= 110100)
38962306a36Sopenharmony_ci	default y if CC_IS_GCC && (GCC_VERSION >= 100200) && (GCC_VERSION < 110000)
39062306a36Sopenharmony_ci	default y if CC_IS_GCC && (GCC_VERSION >=  90400) && (GCC_VERSION < 100000)
39162306a36Sopenharmony_ci	default y if CC_IS_GCC && (GCC_VERSION >=  80500) && (GCC_VERSION <  90000)
39262306a36Sopenharmony_ci	default n
39362306a36Sopenharmony_ci
39462306a36Sopenharmony_ciconfig KASAN_SHADOW_OFFSET
39562306a36Sopenharmony_ci	hex
39662306a36Sopenharmony_ci	depends on KASAN_GENERIC || KASAN_SW_TAGS
39762306a36Sopenharmony_ci	default 0xdfff800000000000 if (ARM64_VA_BITS_48 || ARM64_VA_BITS_52) && !KASAN_SW_TAGS
39862306a36Sopenharmony_ci	default 0xdfffc00000000000 if ARM64_VA_BITS_47 && !KASAN_SW_TAGS
39962306a36Sopenharmony_ci	default 0xdffffe0000000000 if ARM64_VA_BITS_42 && !KASAN_SW_TAGS
40062306a36Sopenharmony_ci	default 0xdfffffc000000000 if ARM64_VA_BITS_39 && !KASAN_SW_TAGS
40162306a36Sopenharmony_ci	default 0xdffffff800000000 if ARM64_VA_BITS_36 && !KASAN_SW_TAGS
40262306a36Sopenharmony_ci	default 0xefff800000000000 if (ARM64_VA_BITS_48 || ARM64_VA_BITS_52) && KASAN_SW_TAGS
40362306a36Sopenharmony_ci	default 0xefffc00000000000 if ARM64_VA_BITS_47 && KASAN_SW_TAGS
40462306a36Sopenharmony_ci	default 0xeffffe0000000000 if ARM64_VA_BITS_42 && KASAN_SW_TAGS
40562306a36Sopenharmony_ci	default 0xefffffc000000000 if ARM64_VA_BITS_39 && KASAN_SW_TAGS
40662306a36Sopenharmony_ci	default 0xeffffff800000000 if ARM64_VA_BITS_36 && KASAN_SW_TAGS
40762306a36Sopenharmony_ci	default 0xffffffffffffffff
40862306a36Sopenharmony_ci
40962306a36Sopenharmony_ciconfig UNWIND_TABLES
41062306a36Sopenharmony_ci	bool
41162306a36Sopenharmony_ci
41262306a36Sopenharmony_cisource "arch/arm64/Kconfig.platforms"
41362306a36Sopenharmony_ci
41462306a36Sopenharmony_cimenu "Kernel Features"
41562306a36Sopenharmony_ci
41662306a36Sopenharmony_cimenu "ARM errata workarounds via the alternatives framework"
41762306a36Sopenharmony_ci
41862306a36Sopenharmony_ciconfig AMPERE_ERRATUM_AC03_CPU_38
41962306a36Sopenharmony_ci        bool "AmpereOne: AC03_CPU_38: Certain bits in the Virtualization Translation Control Register and Translation Control Registers do not follow RES0 semantics"
42062306a36Sopenharmony_ci	default y
42162306a36Sopenharmony_ci	help
42262306a36Sopenharmony_ci	  This option adds an alternative code sequence to work around Ampere
42362306a36Sopenharmony_ci	  erratum AC03_CPU_38 on AmpereOne.
42462306a36Sopenharmony_ci
42562306a36Sopenharmony_ci	  The affected design reports FEAT_HAFDBS as not implemented in
42662306a36Sopenharmony_ci	  ID_AA64MMFR1_EL1.HAFDBS, but (V)TCR_ELx.{HA,HD} are not RES0
42762306a36Sopenharmony_ci	  as required by the architecture. The unadvertised HAFDBS
42862306a36Sopenharmony_ci	  implementation suffers from an additional erratum where hardware
42962306a36Sopenharmony_ci	  A/D updates can occur after a PTE has been marked invalid.
43062306a36Sopenharmony_ci
43162306a36Sopenharmony_ci	  The workaround forces KVM to explicitly set VTCR_EL2.HA to 0,
43262306a36Sopenharmony_ci	  which avoids enabling unadvertised hardware Access Flag management
43362306a36Sopenharmony_ci	  at stage-2.
43462306a36Sopenharmony_ci
43562306a36Sopenharmony_ci	  If unsure, say Y.
43662306a36Sopenharmony_ci
43762306a36Sopenharmony_ciconfig ARM64_WORKAROUND_CLEAN_CACHE
43862306a36Sopenharmony_ci	bool
43962306a36Sopenharmony_ci
44062306a36Sopenharmony_ciconfig ARM64_ERRATUM_826319
44162306a36Sopenharmony_ci	bool "Cortex-A53: 826319: System might deadlock if a write cannot complete until read data is accepted"
44262306a36Sopenharmony_ci	default y
44362306a36Sopenharmony_ci	select ARM64_WORKAROUND_CLEAN_CACHE
44462306a36Sopenharmony_ci	help
44562306a36Sopenharmony_ci	  This option adds an alternative code sequence to work around ARM
44662306a36Sopenharmony_ci	  erratum 826319 on Cortex-A53 parts up to r0p2 with an AMBA 4 ACE or
44762306a36Sopenharmony_ci	  AXI master interface and an L2 cache.
44862306a36Sopenharmony_ci
44962306a36Sopenharmony_ci	  If a Cortex-A53 uses an AMBA AXI4 ACE interface to other processors
45062306a36Sopenharmony_ci	  and is unable to accept a certain write via this interface, it will
45162306a36Sopenharmony_ci	  not progress on read data presented on the read data channel and the
45262306a36Sopenharmony_ci	  system can deadlock.
45362306a36Sopenharmony_ci
45462306a36Sopenharmony_ci	  The workaround promotes data cache clean instructions to
45562306a36Sopenharmony_ci	  data cache clean-and-invalidate.
45662306a36Sopenharmony_ci	  Please note that this does not necessarily enable the workaround,
45762306a36Sopenharmony_ci	  as it depends on the alternative framework, which will only patch
45862306a36Sopenharmony_ci	  the kernel if an affected CPU is detected.
45962306a36Sopenharmony_ci
46062306a36Sopenharmony_ci	  If unsure, say Y.
46162306a36Sopenharmony_ci
46262306a36Sopenharmony_ciconfig ARM64_ERRATUM_827319
46362306a36Sopenharmony_ci	bool "Cortex-A53: 827319: Data cache clean instructions might cause overlapping transactions to the interconnect"
46462306a36Sopenharmony_ci	default y
46562306a36Sopenharmony_ci	select ARM64_WORKAROUND_CLEAN_CACHE
46662306a36Sopenharmony_ci	help
46762306a36Sopenharmony_ci	  This option adds an alternative code sequence to work around ARM
46862306a36Sopenharmony_ci	  erratum 827319 on Cortex-A53 parts up to r0p2 with an AMBA 5 CHI
46962306a36Sopenharmony_ci	  master interface and an L2 cache.
47062306a36Sopenharmony_ci
47162306a36Sopenharmony_ci	  Under certain conditions this erratum can cause a clean line eviction
47262306a36Sopenharmony_ci	  to occur at the same time as another transaction to the same address
47362306a36Sopenharmony_ci	  on the AMBA 5 CHI interface, which can cause data corruption if the
47462306a36Sopenharmony_ci	  interconnect reorders the two transactions.
47562306a36Sopenharmony_ci
47662306a36Sopenharmony_ci	  The workaround promotes data cache clean instructions to
47762306a36Sopenharmony_ci	  data cache clean-and-invalidate.
47862306a36Sopenharmony_ci	  Please note that this does not necessarily enable the workaround,
47962306a36Sopenharmony_ci	  as it depends on the alternative framework, which will only patch
48062306a36Sopenharmony_ci	  the kernel if an affected CPU is detected.
48162306a36Sopenharmony_ci
48262306a36Sopenharmony_ci	  If unsure, say Y.
48362306a36Sopenharmony_ci
48462306a36Sopenharmony_ciconfig ARM64_ERRATUM_824069
48562306a36Sopenharmony_ci	bool "Cortex-A53: 824069: Cache line might not be marked as clean after a CleanShared snoop"
48662306a36Sopenharmony_ci	default y
48762306a36Sopenharmony_ci	select ARM64_WORKAROUND_CLEAN_CACHE
48862306a36Sopenharmony_ci	help
48962306a36Sopenharmony_ci	  This option adds an alternative code sequence to work around ARM
49062306a36Sopenharmony_ci	  erratum 824069 on Cortex-A53 parts up to r0p2 when it is connected
49162306a36Sopenharmony_ci	  to a coherent interconnect.
49262306a36Sopenharmony_ci
49362306a36Sopenharmony_ci	  If a Cortex-A53 processor is executing a store or prefetch for
49462306a36Sopenharmony_ci	  write instruction at the same time as a processor in another
49562306a36Sopenharmony_ci	  cluster is executing a cache maintenance operation to the same
49662306a36Sopenharmony_ci	  address, then this erratum might cause a clean cache line to be
49762306a36Sopenharmony_ci	  incorrectly marked as dirty.
49862306a36Sopenharmony_ci
49962306a36Sopenharmony_ci	  The workaround promotes data cache clean instructions to
50062306a36Sopenharmony_ci	  data cache clean-and-invalidate.
50162306a36Sopenharmony_ci	  Please note that this option does not necessarily enable the
50262306a36Sopenharmony_ci	  workaround, as it depends on the alternative framework, which will
50362306a36Sopenharmony_ci	  only patch the kernel if an affected CPU is detected.
50462306a36Sopenharmony_ci
50562306a36Sopenharmony_ci	  If unsure, say Y.
50662306a36Sopenharmony_ci
50762306a36Sopenharmony_ciconfig ARM64_ERRATUM_819472
50862306a36Sopenharmony_ci	bool "Cortex-A53: 819472: Store exclusive instructions might cause data corruption"
50962306a36Sopenharmony_ci	default y
51062306a36Sopenharmony_ci	select ARM64_WORKAROUND_CLEAN_CACHE
51162306a36Sopenharmony_ci	help
51262306a36Sopenharmony_ci	  This option adds an alternative code sequence to work around ARM
51362306a36Sopenharmony_ci	  erratum 819472 on Cortex-A53 parts up to r0p1 with an L2 cache
51462306a36Sopenharmony_ci	  present when it is connected to a coherent interconnect.
51562306a36Sopenharmony_ci
51662306a36Sopenharmony_ci	  If the processor is executing a load and store exclusive sequence at
51762306a36Sopenharmony_ci	  the same time as a processor in another cluster is executing a cache
51862306a36Sopenharmony_ci	  maintenance operation to the same address, then this erratum might
51962306a36Sopenharmony_ci	  cause data corruption.
52062306a36Sopenharmony_ci
52162306a36Sopenharmony_ci	  The workaround promotes data cache clean instructions to
52262306a36Sopenharmony_ci	  data cache clean-and-invalidate.
52362306a36Sopenharmony_ci	  Please note that this does not necessarily enable the workaround,
52462306a36Sopenharmony_ci	  as it depends on the alternative framework, which will only patch
52562306a36Sopenharmony_ci	  the kernel if an affected CPU is detected.
52662306a36Sopenharmony_ci
52762306a36Sopenharmony_ci	  If unsure, say Y.
52862306a36Sopenharmony_ci
52962306a36Sopenharmony_ciconfig ARM64_ERRATUM_832075
53062306a36Sopenharmony_ci	bool "Cortex-A57: 832075: possible deadlock on mixing exclusive memory accesses with device loads"
53162306a36Sopenharmony_ci	default y
53262306a36Sopenharmony_ci	help
53362306a36Sopenharmony_ci	  This option adds an alternative code sequence to work around ARM
53462306a36Sopenharmony_ci	  erratum 832075 on Cortex-A57 parts up to r1p2.
53562306a36Sopenharmony_ci
53662306a36Sopenharmony_ci	  Affected Cortex-A57 parts might deadlock when exclusive load/store
53762306a36Sopenharmony_ci	  instructions to Write-Back memory are mixed with Device loads.
53862306a36Sopenharmony_ci
53962306a36Sopenharmony_ci	  The workaround is to promote device loads to use Load-Acquire
54062306a36Sopenharmony_ci	  semantics.
54162306a36Sopenharmony_ci	  Please note that this does not necessarily enable the workaround,
54262306a36Sopenharmony_ci	  as it depends on the alternative framework, which will only patch
54362306a36Sopenharmony_ci	  the kernel if an affected CPU is detected.
54462306a36Sopenharmony_ci
54562306a36Sopenharmony_ci	  If unsure, say Y.
54662306a36Sopenharmony_ci
54762306a36Sopenharmony_ciconfig ARM64_ERRATUM_834220
54862306a36Sopenharmony_ci	bool "Cortex-A57: 834220: Stage 2 translation fault might be incorrectly reported in presence of a Stage 1 fault"
54962306a36Sopenharmony_ci	depends on KVM
55062306a36Sopenharmony_ci	default y
55162306a36Sopenharmony_ci	help
55262306a36Sopenharmony_ci	  This option adds an alternative code sequence to work around ARM
55362306a36Sopenharmony_ci	  erratum 834220 on Cortex-A57 parts up to r1p2.
55462306a36Sopenharmony_ci
55562306a36Sopenharmony_ci	  Affected Cortex-A57 parts might report a Stage 2 translation
55662306a36Sopenharmony_ci	  fault as the result of a Stage 1 fault for load crossing a
55762306a36Sopenharmony_ci	  page boundary when there is a permission or device memory
55862306a36Sopenharmony_ci	  alignment fault at Stage 1 and a translation fault at Stage 2.
55962306a36Sopenharmony_ci
56062306a36Sopenharmony_ci	  The workaround is to verify that the Stage 1 translation
56162306a36Sopenharmony_ci	  doesn't generate a fault before handling the Stage 2 fault.
56262306a36Sopenharmony_ci	  Please note that this does not necessarily enable the workaround,
56362306a36Sopenharmony_ci	  as it depends on the alternative framework, which will only patch
56462306a36Sopenharmony_ci	  the kernel if an affected CPU is detected.
56562306a36Sopenharmony_ci
56662306a36Sopenharmony_ci	  If unsure, say Y.
56762306a36Sopenharmony_ci
56862306a36Sopenharmony_ciconfig ARM64_ERRATUM_1742098
56962306a36Sopenharmony_ci	bool "Cortex-A57/A72: 1742098: ELR recorded incorrectly on interrupt taken between cryptographic instructions in a sequence"
57062306a36Sopenharmony_ci	depends on COMPAT
57162306a36Sopenharmony_ci	default y
57262306a36Sopenharmony_ci	help
57362306a36Sopenharmony_ci	  This option removes the AES hwcap for aarch32 user-space to
57462306a36Sopenharmony_ci	  workaround erratum 1742098 on Cortex-A57 and Cortex-A72.
57562306a36Sopenharmony_ci
57662306a36Sopenharmony_ci	  Affected parts may corrupt the AES state if an interrupt is
57762306a36Sopenharmony_ci	  taken between a pair of AES instructions. These instructions
57862306a36Sopenharmony_ci	  are only present if the cryptography extensions are present.
57962306a36Sopenharmony_ci	  All software should have a fallback implementation for CPUs
58062306a36Sopenharmony_ci	  that don't implement the cryptography extensions.
58162306a36Sopenharmony_ci
58262306a36Sopenharmony_ci	  If unsure, say Y.
58362306a36Sopenharmony_ci
58462306a36Sopenharmony_ciconfig ARM64_ERRATUM_845719
58562306a36Sopenharmony_ci	bool "Cortex-A53: 845719: a load might read incorrect data"
58662306a36Sopenharmony_ci	depends on COMPAT
58762306a36Sopenharmony_ci	default y
58862306a36Sopenharmony_ci	help
58962306a36Sopenharmony_ci	  This option adds an alternative code sequence to work around ARM
59062306a36Sopenharmony_ci	  erratum 845719 on Cortex-A53 parts up to r0p4.
59162306a36Sopenharmony_ci
59262306a36Sopenharmony_ci	  When running a compat (AArch32) userspace on an affected Cortex-A53
59362306a36Sopenharmony_ci	  part, a load at EL0 from a virtual address that matches the bottom 32
59462306a36Sopenharmony_ci	  bits of the virtual address used by a recent load at (AArch64) EL1
59562306a36Sopenharmony_ci	  might return incorrect data.
59662306a36Sopenharmony_ci
59762306a36Sopenharmony_ci	  The workaround is to write the contextidr_el1 register on exception
59862306a36Sopenharmony_ci	  return to a 32-bit task.
59962306a36Sopenharmony_ci	  Please note that this does not necessarily enable the workaround,
60062306a36Sopenharmony_ci	  as it depends on the alternative framework, which will only patch
60162306a36Sopenharmony_ci	  the kernel if an affected CPU is detected.
60262306a36Sopenharmony_ci
60362306a36Sopenharmony_ci	  If unsure, say Y.
60462306a36Sopenharmony_ci
60562306a36Sopenharmony_ciconfig ARM64_ERRATUM_843419
60662306a36Sopenharmony_ci	bool "Cortex-A53: 843419: A load or store might access an incorrect address"
60762306a36Sopenharmony_ci	default y
60862306a36Sopenharmony_ci	help
60962306a36Sopenharmony_ci	  This option links the kernel with '--fix-cortex-a53-843419' and
61062306a36Sopenharmony_ci	  enables PLT support to replace certain ADRP instructions, which can
61162306a36Sopenharmony_ci	  cause subsequent memory accesses to use an incorrect address on
61262306a36Sopenharmony_ci	  Cortex-A53 parts up to r0p4.
61362306a36Sopenharmony_ci
61462306a36Sopenharmony_ci	  If unsure, say Y.
61562306a36Sopenharmony_ci
61662306a36Sopenharmony_ciconfig ARM64_LD_HAS_FIX_ERRATUM_843419
61762306a36Sopenharmony_ci	def_bool $(ld-option,--fix-cortex-a53-843419)
61862306a36Sopenharmony_ci
61962306a36Sopenharmony_ciconfig ARM64_ERRATUM_1024718
62062306a36Sopenharmony_ci	bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
62162306a36Sopenharmony_ci	default y
62262306a36Sopenharmony_ci	help
62362306a36Sopenharmony_ci	  This option adds a workaround for ARM Cortex-A55 Erratum 1024718.
62462306a36Sopenharmony_ci
62562306a36Sopenharmony_ci	  Affected Cortex-A55 cores (all revisions) could cause incorrect
62662306a36Sopenharmony_ci	  update of the hardware dirty bit when the DBM/AP bits are updated
62762306a36Sopenharmony_ci	  without a break-before-make. The workaround is to disable the usage
62862306a36Sopenharmony_ci	  of hardware DBM locally on the affected cores. CPUs not affected by
62962306a36Sopenharmony_ci	  this erratum will continue to use the feature.
63062306a36Sopenharmony_ci
63162306a36Sopenharmony_ci	  If unsure, say Y.
63262306a36Sopenharmony_ci
63362306a36Sopenharmony_ciconfig ARM64_ERRATUM_1418040
63462306a36Sopenharmony_ci	bool "Cortex-A76/Neoverse-N1: MRC read following MRRC read of specific Generic Timer in AArch32 might give incorrect result"
63562306a36Sopenharmony_ci	default y
63662306a36Sopenharmony_ci	depends on COMPAT
63762306a36Sopenharmony_ci	help
63862306a36Sopenharmony_ci	  This option adds a workaround for ARM Cortex-A76/Neoverse-N1
63962306a36Sopenharmony_ci	  errata 1188873 and 1418040.
64062306a36Sopenharmony_ci
64162306a36Sopenharmony_ci	  Affected Cortex-A76/Neoverse-N1 cores (r0p0 to r3p1) could
64262306a36Sopenharmony_ci	  cause register corruption when accessing the timer registers
64362306a36Sopenharmony_ci	  from AArch32 userspace.
64462306a36Sopenharmony_ci
64562306a36Sopenharmony_ci	  If unsure, say Y.
64662306a36Sopenharmony_ci
64762306a36Sopenharmony_ciconfig ARM64_WORKAROUND_SPECULATIVE_AT
64862306a36Sopenharmony_ci	bool
64962306a36Sopenharmony_ci
65062306a36Sopenharmony_ciconfig ARM64_ERRATUM_1165522
65162306a36Sopenharmony_ci	bool "Cortex-A76: 1165522: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
65262306a36Sopenharmony_ci	default y
65362306a36Sopenharmony_ci	select ARM64_WORKAROUND_SPECULATIVE_AT
65462306a36Sopenharmony_ci	help
65562306a36Sopenharmony_ci	  This option adds a workaround for ARM Cortex-A76 erratum 1165522.
65662306a36Sopenharmony_ci
65762306a36Sopenharmony_ci	  Affected Cortex-A76 cores (r0p0, r1p0, r2p0) could end-up with
65862306a36Sopenharmony_ci	  corrupted TLBs by speculating an AT instruction during a guest
65962306a36Sopenharmony_ci	  context switch.
66062306a36Sopenharmony_ci
66162306a36Sopenharmony_ci	  If unsure, say Y.
66262306a36Sopenharmony_ci
66362306a36Sopenharmony_ciconfig ARM64_ERRATUM_1319367
66462306a36Sopenharmony_ci	bool "Cortex-A57/A72: 1319537: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
66562306a36Sopenharmony_ci	default y
66662306a36Sopenharmony_ci	select ARM64_WORKAROUND_SPECULATIVE_AT
66762306a36Sopenharmony_ci	help
66862306a36Sopenharmony_ci	  This option adds work arounds for ARM Cortex-A57 erratum 1319537
66962306a36Sopenharmony_ci	  and A72 erratum 1319367
67062306a36Sopenharmony_ci
67162306a36Sopenharmony_ci	  Cortex-A57 and A72 cores could end-up with corrupted TLBs by
67262306a36Sopenharmony_ci	  speculating an AT instruction during a guest context switch.
67362306a36Sopenharmony_ci
67462306a36Sopenharmony_ci	  If unsure, say Y.
67562306a36Sopenharmony_ci
67662306a36Sopenharmony_ciconfig ARM64_ERRATUM_1530923
67762306a36Sopenharmony_ci	bool "Cortex-A55: 1530923: Speculative AT instruction using out-of-context translation regime could cause subsequent request to generate an incorrect translation"
67862306a36Sopenharmony_ci	default y
67962306a36Sopenharmony_ci	select ARM64_WORKAROUND_SPECULATIVE_AT
68062306a36Sopenharmony_ci	help
68162306a36Sopenharmony_ci	  This option adds a workaround for ARM Cortex-A55 erratum 1530923.
68262306a36Sopenharmony_ci
68362306a36Sopenharmony_ci	  Affected Cortex-A55 cores (r0p0, r0p1, r1p0, r2p0) could end-up with
68462306a36Sopenharmony_ci	  corrupted TLBs by speculating an AT instruction during a guest
68562306a36Sopenharmony_ci	  context switch.
68662306a36Sopenharmony_ci
68762306a36Sopenharmony_ci	  If unsure, say Y.
68862306a36Sopenharmony_ci
68962306a36Sopenharmony_ciconfig ARM64_WORKAROUND_REPEAT_TLBI
69062306a36Sopenharmony_ci	bool
69162306a36Sopenharmony_ci
69262306a36Sopenharmony_ciconfig ARM64_ERRATUM_2441007
69362306a36Sopenharmony_ci	bool "Cortex-A55: Completion of affected memory accesses might not be guaranteed by completion of a TLBI"
69462306a36Sopenharmony_ci	default y
69562306a36Sopenharmony_ci	select ARM64_WORKAROUND_REPEAT_TLBI
69662306a36Sopenharmony_ci	help
69762306a36Sopenharmony_ci	  This option adds a workaround for ARM Cortex-A55 erratum #2441007.
69862306a36Sopenharmony_ci
69962306a36Sopenharmony_ci	  Under very rare circumstances, affected Cortex-A55 CPUs
70062306a36Sopenharmony_ci	  may not handle a race between a break-before-make sequence on one
70162306a36Sopenharmony_ci	  CPU, and another CPU accessing the same page. This could allow a
70262306a36Sopenharmony_ci	  store to a page that has been unmapped.
70362306a36Sopenharmony_ci
70462306a36Sopenharmony_ci	  Work around this by adding the affected CPUs to the list that needs
70562306a36Sopenharmony_ci	  TLB sequences to be done twice.
70662306a36Sopenharmony_ci
70762306a36Sopenharmony_ci	  If unsure, say Y.
70862306a36Sopenharmony_ci
70962306a36Sopenharmony_ciconfig ARM64_ERRATUM_1286807
71062306a36Sopenharmony_ci	bool "Cortex-A76: Modification of the translation table for a virtual address might lead to read-after-read ordering violation"
71162306a36Sopenharmony_ci	default y
71262306a36Sopenharmony_ci	select ARM64_WORKAROUND_REPEAT_TLBI
71362306a36Sopenharmony_ci	help
71462306a36Sopenharmony_ci	  This option adds a workaround for ARM Cortex-A76 erratum 1286807.
71562306a36Sopenharmony_ci
71662306a36Sopenharmony_ci	  On the affected Cortex-A76 cores (r0p0 to r3p0), if a virtual
71762306a36Sopenharmony_ci	  address for a cacheable mapping of a location is being
71862306a36Sopenharmony_ci	  accessed by a core while another core is remapping the virtual
71962306a36Sopenharmony_ci	  address to a new physical page using the recommended
72062306a36Sopenharmony_ci	  break-before-make sequence, then under very rare circumstances
72162306a36Sopenharmony_ci	  TLBI+DSB completes before a read using the translation being
72262306a36Sopenharmony_ci	  invalidated has been observed by other observers. The
72362306a36Sopenharmony_ci	  workaround repeats the TLBI+DSB operation.
72462306a36Sopenharmony_ci
72562306a36Sopenharmony_ciconfig ARM64_ERRATUM_1463225
72662306a36Sopenharmony_ci	bool "Cortex-A76: Software Step might prevent interrupt recognition"
72762306a36Sopenharmony_ci	default y
72862306a36Sopenharmony_ci	help
72962306a36Sopenharmony_ci	  This option adds a workaround for Arm Cortex-A76 erratum 1463225.
73062306a36Sopenharmony_ci
73162306a36Sopenharmony_ci	  On the affected Cortex-A76 cores (r0p0 to r3p1), software stepping
73262306a36Sopenharmony_ci	  of a system call instruction (SVC) can prevent recognition of
73362306a36Sopenharmony_ci	  subsequent interrupts when software stepping is disabled in the
73462306a36Sopenharmony_ci	  exception handler of the system call and either kernel debugging
73562306a36Sopenharmony_ci	  is enabled or VHE is in use.
73662306a36Sopenharmony_ci
73762306a36Sopenharmony_ci	  Work around the erratum by triggering a dummy step exception
73862306a36Sopenharmony_ci	  when handling a system call from a task that is being stepped
73962306a36Sopenharmony_ci	  in a VHE configuration of the kernel.
74062306a36Sopenharmony_ci
74162306a36Sopenharmony_ci	  If unsure, say Y.
74262306a36Sopenharmony_ci
74362306a36Sopenharmony_ciconfig ARM64_ERRATUM_1542419
74462306a36Sopenharmony_ci	bool "Neoverse-N1: workaround mis-ordering of instruction fetches"
74562306a36Sopenharmony_ci	default y
74662306a36Sopenharmony_ci	help
74762306a36Sopenharmony_ci	  This option adds a workaround for ARM Neoverse-N1 erratum
74862306a36Sopenharmony_ci	  1542419.
74962306a36Sopenharmony_ci
75062306a36Sopenharmony_ci	  Affected Neoverse-N1 cores could execute a stale instruction when
75162306a36Sopenharmony_ci	  modified by another CPU. The workaround depends on a firmware
75262306a36Sopenharmony_ci	  counterpart.
75362306a36Sopenharmony_ci
75462306a36Sopenharmony_ci	  Workaround the issue by hiding the DIC feature from EL0. This
75562306a36Sopenharmony_ci	  forces user-space to perform cache maintenance.
75662306a36Sopenharmony_ci
75762306a36Sopenharmony_ci	  If unsure, say Y.
75862306a36Sopenharmony_ci
75962306a36Sopenharmony_ciconfig ARM64_ERRATUM_1508412
76062306a36Sopenharmony_ci	bool "Cortex-A77: 1508412: workaround deadlock on sequence of NC/Device load and store exclusive or PAR read"
76162306a36Sopenharmony_ci	default y
76262306a36Sopenharmony_ci	help
76362306a36Sopenharmony_ci	  This option adds a workaround for Arm Cortex-A77 erratum 1508412.
76462306a36Sopenharmony_ci
76562306a36Sopenharmony_ci	  Affected Cortex-A77 cores (r0p0, r1p0) could deadlock on a sequence
76662306a36Sopenharmony_ci	  of a store-exclusive or read of PAR_EL1 and a load with device or
76762306a36Sopenharmony_ci	  non-cacheable memory attributes. The workaround depends on a firmware
76862306a36Sopenharmony_ci	  counterpart.
76962306a36Sopenharmony_ci
77062306a36Sopenharmony_ci	  KVM guests must also have the workaround implemented or they can
77162306a36Sopenharmony_ci	  deadlock the system.
77262306a36Sopenharmony_ci
77362306a36Sopenharmony_ci	  Work around the issue by inserting DMB SY barriers around PAR_EL1
77462306a36Sopenharmony_ci	  register reads and warning KVM users. The DMB barrier is sufficient
77562306a36Sopenharmony_ci	  to prevent a speculative PAR_EL1 read.
77662306a36Sopenharmony_ci
77762306a36Sopenharmony_ci	  If unsure, say Y.
77862306a36Sopenharmony_ci
77962306a36Sopenharmony_ciconfig ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
78062306a36Sopenharmony_ci	bool
78162306a36Sopenharmony_ci
78262306a36Sopenharmony_ciconfig ARM64_ERRATUM_2051678
78362306a36Sopenharmony_ci	bool "Cortex-A510: 2051678: disable Hardware Update of the page table dirty bit"
78462306a36Sopenharmony_ci	default y
78562306a36Sopenharmony_ci	help
78662306a36Sopenharmony_ci	  This options adds the workaround for ARM Cortex-A510 erratum ARM64_ERRATUM_2051678.
78762306a36Sopenharmony_ci	  Affected Cortex-A510 might not respect the ordering rules for
78862306a36Sopenharmony_ci	  hardware update of the page table's dirty bit. The workaround
78962306a36Sopenharmony_ci	  is to not enable the feature on affected CPUs.
79062306a36Sopenharmony_ci
79162306a36Sopenharmony_ci	  If unsure, say Y.
79262306a36Sopenharmony_ci
79362306a36Sopenharmony_ciconfig ARM64_ERRATUM_2077057
79462306a36Sopenharmony_ci	bool "Cortex-A510: 2077057: workaround software-step corrupting SPSR_EL2"
79562306a36Sopenharmony_ci	default y
79662306a36Sopenharmony_ci	help
79762306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A510 erratum 2077057.
79862306a36Sopenharmony_ci	  Affected Cortex-A510 may corrupt SPSR_EL2 when the a step exception is
79962306a36Sopenharmony_ci	  expected, but a Pointer Authentication trap is taken instead. The
80062306a36Sopenharmony_ci	  erratum causes SPSR_EL1 to be copied to SPSR_EL2, which could allow
80162306a36Sopenharmony_ci	  EL1 to cause a return to EL2 with a guest controlled ELR_EL2.
80262306a36Sopenharmony_ci
80362306a36Sopenharmony_ci	  This can only happen when EL2 is stepping EL1.
80462306a36Sopenharmony_ci
80562306a36Sopenharmony_ci	  When these conditions occur, the SPSR_EL2 value is unchanged from the
80662306a36Sopenharmony_ci	  previous guest entry, and can be restored from the in-memory copy.
80762306a36Sopenharmony_ci
80862306a36Sopenharmony_ci	  If unsure, say Y.
80962306a36Sopenharmony_ci
81062306a36Sopenharmony_ciconfig ARM64_ERRATUM_2658417
81162306a36Sopenharmony_ci	bool "Cortex-A510: 2658417: remove BF16 support due to incorrect result"
81262306a36Sopenharmony_ci	default y
81362306a36Sopenharmony_ci	help
81462306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A510 erratum 2658417.
81562306a36Sopenharmony_ci	  Affected Cortex-A510 (r0p0 to r1p1) may produce the wrong result for
81662306a36Sopenharmony_ci	  BFMMLA or VMMLA instructions in rare circumstances when a pair of
81762306a36Sopenharmony_ci	  A510 CPUs are using shared neon hardware. As the sharing is not
81862306a36Sopenharmony_ci	  discoverable by the kernel, hide the BF16 HWCAP to indicate that
81962306a36Sopenharmony_ci	  user-space should not be using these instructions.
82062306a36Sopenharmony_ci
82162306a36Sopenharmony_ci	  If unsure, say Y.
82262306a36Sopenharmony_ci
82362306a36Sopenharmony_ciconfig ARM64_ERRATUM_2119858
82462306a36Sopenharmony_ci	bool "Cortex-A710/X2: 2119858: workaround TRBE overwriting trace data in FILL mode"
82562306a36Sopenharmony_ci	default y
82662306a36Sopenharmony_ci	depends on CORESIGHT_TRBE
82762306a36Sopenharmony_ci	select ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
82862306a36Sopenharmony_ci	help
82962306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A710/X2 erratum 2119858.
83062306a36Sopenharmony_ci
83162306a36Sopenharmony_ci	  Affected Cortex-A710/X2 cores could overwrite up to 3 cache lines of trace
83262306a36Sopenharmony_ci	  data at the base of the buffer (pointed to by TRBASER_EL1) in FILL mode in
83362306a36Sopenharmony_ci	  the event of a WRAP event.
83462306a36Sopenharmony_ci
83562306a36Sopenharmony_ci	  Work around the issue by always making sure we move the TRBPTR_EL1 by
83662306a36Sopenharmony_ci	  256 bytes before enabling the buffer and filling the first 256 bytes of
83762306a36Sopenharmony_ci	  the buffer with ETM ignore packets upon disabling.
83862306a36Sopenharmony_ci
83962306a36Sopenharmony_ci	  If unsure, say Y.
84062306a36Sopenharmony_ci
84162306a36Sopenharmony_ciconfig ARM64_ERRATUM_2139208
84262306a36Sopenharmony_ci	bool "Neoverse-N2: 2139208: workaround TRBE overwriting trace data in FILL mode"
84362306a36Sopenharmony_ci	default y
84462306a36Sopenharmony_ci	depends on CORESIGHT_TRBE
84562306a36Sopenharmony_ci	select ARM64_WORKAROUND_TRBE_OVERWRITE_FILL_MODE
84662306a36Sopenharmony_ci	help
84762306a36Sopenharmony_ci	  This option adds the workaround for ARM Neoverse-N2 erratum 2139208.
84862306a36Sopenharmony_ci
84962306a36Sopenharmony_ci	  Affected Neoverse-N2 cores could overwrite up to 3 cache lines of trace
85062306a36Sopenharmony_ci	  data at the base of the buffer (pointed to by TRBASER_EL1) in FILL mode in
85162306a36Sopenharmony_ci	  the event of a WRAP event.
85262306a36Sopenharmony_ci
85362306a36Sopenharmony_ci	  Work around the issue by always making sure we move the TRBPTR_EL1 by
85462306a36Sopenharmony_ci	  256 bytes before enabling the buffer and filling the first 256 bytes of
85562306a36Sopenharmony_ci	  the buffer with ETM ignore packets upon disabling.
85662306a36Sopenharmony_ci
85762306a36Sopenharmony_ci	  If unsure, say Y.
85862306a36Sopenharmony_ci
85962306a36Sopenharmony_ciconfig ARM64_WORKAROUND_TSB_FLUSH_FAILURE
86062306a36Sopenharmony_ci	bool
86162306a36Sopenharmony_ci
86262306a36Sopenharmony_ciconfig ARM64_ERRATUM_2054223
86362306a36Sopenharmony_ci	bool "Cortex-A710: 2054223: workaround TSB instruction failing to flush trace"
86462306a36Sopenharmony_ci	default y
86562306a36Sopenharmony_ci	select ARM64_WORKAROUND_TSB_FLUSH_FAILURE
86662306a36Sopenharmony_ci	help
86762306a36Sopenharmony_ci	  Enable workaround for ARM Cortex-A710 erratum 2054223
86862306a36Sopenharmony_ci
86962306a36Sopenharmony_ci	  Affected cores may fail to flush the trace data on a TSB instruction, when
87062306a36Sopenharmony_ci	  the PE is in trace prohibited state. This will cause losing a few bytes
87162306a36Sopenharmony_ci	  of the trace cached.
87262306a36Sopenharmony_ci
87362306a36Sopenharmony_ci	  Workaround is to issue two TSB consecutively on affected cores.
87462306a36Sopenharmony_ci
87562306a36Sopenharmony_ci	  If unsure, say Y.
87662306a36Sopenharmony_ci
87762306a36Sopenharmony_ciconfig ARM64_ERRATUM_2067961
87862306a36Sopenharmony_ci	bool "Neoverse-N2: 2067961: workaround TSB instruction failing to flush trace"
87962306a36Sopenharmony_ci	default y
88062306a36Sopenharmony_ci	select ARM64_WORKAROUND_TSB_FLUSH_FAILURE
88162306a36Sopenharmony_ci	help
88262306a36Sopenharmony_ci	  Enable workaround for ARM Neoverse-N2 erratum 2067961
88362306a36Sopenharmony_ci
88462306a36Sopenharmony_ci	  Affected cores may fail to flush the trace data on a TSB instruction, when
88562306a36Sopenharmony_ci	  the PE is in trace prohibited state. This will cause losing a few bytes
88662306a36Sopenharmony_ci	  of the trace cached.
88762306a36Sopenharmony_ci
88862306a36Sopenharmony_ci	  Workaround is to issue two TSB consecutively on affected cores.
88962306a36Sopenharmony_ci
89062306a36Sopenharmony_ci	  If unsure, say Y.
89162306a36Sopenharmony_ci
89262306a36Sopenharmony_ciconfig ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
89362306a36Sopenharmony_ci	bool
89462306a36Sopenharmony_ci
89562306a36Sopenharmony_ciconfig ARM64_ERRATUM_2253138
89662306a36Sopenharmony_ci	bool "Neoverse-N2: 2253138: workaround TRBE writing to address out-of-range"
89762306a36Sopenharmony_ci	depends on CORESIGHT_TRBE
89862306a36Sopenharmony_ci	default y
89962306a36Sopenharmony_ci	select ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
90062306a36Sopenharmony_ci	help
90162306a36Sopenharmony_ci	  This option adds the workaround for ARM Neoverse-N2 erratum 2253138.
90262306a36Sopenharmony_ci
90362306a36Sopenharmony_ci	  Affected Neoverse-N2 cores might write to an out-of-range address, not reserved
90462306a36Sopenharmony_ci	  for TRBE. Under some conditions, the TRBE might generate a write to the next
90562306a36Sopenharmony_ci	  virtually addressed page following the last page of the TRBE address space
90662306a36Sopenharmony_ci	  (i.e., the TRBLIMITR_EL1.LIMIT), instead of wrapping around to the base.
90762306a36Sopenharmony_ci
90862306a36Sopenharmony_ci	  Work around this in the driver by always making sure that there is a
90962306a36Sopenharmony_ci	  page beyond the TRBLIMITR_EL1.LIMIT, within the space allowed for the TRBE.
91062306a36Sopenharmony_ci
91162306a36Sopenharmony_ci	  If unsure, say Y.
91262306a36Sopenharmony_ci
91362306a36Sopenharmony_ciconfig ARM64_ERRATUM_2224489
91462306a36Sopenharmony_ci	bool "Cortex-A710/X2: 2224489: workaround TRBE writing to address out-of-range"
91562306a36Sopenharmony_ci	depends on CORESIGHT_TRBE
91662306a36Sopenharmony_ci	default y
91762306a36Sopenharmony_ci	select ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE
91862306a36Sopenharmony_ci	help
91962306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A710/X2 erratum 2224489.
92062306a36Sopenharmony_ci
92162306a36Sopenharmony_ci	  Affected Cortex-A710/X2 cores might write to an out-of-range address, not reserved
92262306a36Sopenharmony_ci	  for TRBE. Under some conditions, the TRBE might generate a write to the next
92362306a36Sopenharmony_ci	  virtually addressed page following the last page of the TRBE address space
92462306a36Sopenharmony_ci	  (i.e., the TRBLIMITR_EL1.LIMIT), instead of wrapping around to the base.
92562306a36Sopenharmony_ci
92662306a36Sopenharmony_ci	  Work around this in the driver by always making sure that there is a
92762306a36Sopenharmony_ci	  page beyond the TRBLIMITR_EL1.LIMIT, within the space allowed for the TRBE.
92862306a36Sopenharmony_ci
92962306a36Sopenharmony_ci	  If unsure, say Y.
93062306a36Sopenharmony_ci
93162306a36Sopenharmony_ciconfig ARM64_ERRATUM_2441009
93262306a36Sopenharmony_ci	bool "Cortex-A510: Completion of affected memory accesses might not be guaranteed by completion of a TLBI"
93362306a36Sopenharmony_ci	default y
93462306a36Sopenharmony_ci	select ARM64_WORKAROUND_REPEAT_TLBI
93562306a36Sopenharmony_ci	help
93662306a36Sopenharmony_ci	  This option adds a workaround for ARM Cortex-A510 erratum #2441009.
93762306a36Sopenharmony_ci
93862306a36Sopenharmony_ci	  Under very rare circumstances, affected Cortex-A510 CPUs
93962306a36Sopenharmony_ci	  may not handle a race between a break-before-make sequence on one
94062306a36Sopenharmony_ci	  CPU, and another CPU accessing the same page. This could allow a
94162306a36Sopenharmony_ci	  store to a page that has been unmapped.
94262306a36Sopenharmony_ci
94362306a36Sopenharmony_ci	  Work around this by adding the affected CPUs to the list that needs
94462306a36Sopenharmony_ci	  TLB sequences to be done twice.
94562306a36Sopenharmony_ci
94662306a36Sopenharmony_ci	  If unsure, say Y.
94762306a36Sopenharmony_ci
94862306a36Sopenharmony_ciconfig ARM64_ERRATUM_2064142
94962306a36Sopenharmony_ci	bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled"
95062306a36Sopenharmony_ci	depends on CORESIGHT_TRBE
95162306a36Sopenharmony_ci	default y
95262306a36Sopenharmony_ci	help
95362306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A510 erratum 2064142.
95462306a36Sopenharmony_ci
95562306a36Sopenharmony_ci	  Affected Cortex-A510 core might fail to write into system registers after the
95662306a36Sopenharmony_ci	  TRBE has been disabled. Under some conditions after the TRBE has been disabled
95762306a36Sopenharmony_ci	  writes into TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1,
95862306a36Sopenharmony_ci	  and TRBTRG_EL1 will be ignored and will not be effected.
95962306a36Sopenharmony_ci
96062306a36Sopenharmony_ci	  Work around this in the driver by executing TSB CSYNC and DSB after collection
96162306a36Sopenharmony_ci	  is stopped and before performing a system register write to one of the affected
96262306a36Sopenharmony_ci	  registers.
96362306a36Sopenharmony_ci
96462306a36Sopenharmony_ci	  If unsure, say Y.
96562306a36Sopenharmony_ci
96662306a36Sopenharmony_ciconfig ARM64_ERRATUM_2038923
96762306a36Sopenharmony_ci	bool "Cortex-A510: 2038923: workaround TRBE corruption with enable"
96862306a36Sopenharmony_ci	depends on CORESIGHT_TRBE
96962306a36Sopenharmony_ci	default y
97062306a36Sopenharmony_ci	help
97162306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A510 erratum 2038923.
97262306a36Sopenharmony_ci
97362306a36Sopenharmony_ci	  Affected Cortex-A510 core might cause an inconsistent view on whether trace is
97462306a36Sopenharmony_ci	  prohibited within the CPU. As a result, the trace buffer or trace buffer state
97562306a36Sopenharmony_ci	  might be corrupted. This happens after TRBE buffer has been enabled by setting
97662306a36Sopenharmony_ci	  TRBLIMITR_EL1.E, followed by just a single context synchronization event before
97762306a36Sopenharmony_ci	  execution changes from a context, in which trace is prohibited to one where it
97862306a36Sopenharmony_ci	  isn't, or vice versa. In these mentioned conditions, the view of whether trace
97962306a36Sopenharmony_ci	  is prohibited is inconsistent between parts of the CPU, and the trace buffer or
98062306a36Sopenharmony_ci	  the trace buffer state might be corrupted.
98162306a36Sopenharmony_ci
98262306a36Sopenharmony_ci	  Work around this in the driver by preventing an inconsistent view of whether the
98362306a36Sopenharmony_ci	  trace is prohibited or not based on TRBLIMITR_EL1.E by immediately following a
98462306a36Sopenharmony_ci	  change to TRBLIMITR_EL1.E with at least one ISB instruction before an ERET, or
98562306a36Sopenharmony_ci	  two ISB instructions if no ERET is to take place.
98662306a36Sopenharmony_ci
98762306a36Sopenharmony_ci	  If unsure, say Y.
98862306a36Sopenharmony_ci
98962306a36Sopenharmony_ciconfig ARM64_ERRATUM_1902691
99062306a36Sopenharmony_ci	bool "Cortex-A510: 1902691: workaround TRBE trace corruption"
99162306a36Sopenharmony_ci	depends on CORESIGHT_TRBE
99262306a36Sopenharmony_ci	default y
99362306a36Sopenharmony_ci	help
99462306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A510 erratum 1902691.
99562306a36Sopenharmony_ci
99662306a36Sopenharmony_ci	  Affected Cortex-A510 core might cause trace data corruption, when being written
99762306a36Sopenharmony_ci	  into the memory. Effectively TRBE is broken and hence cannot be used to capture
99862306a36Sopenharmony_ci	  trace data.
99962306a36Sopenharmony_ci
100062306a36Sopenharmony_ci	  Work around this problem in the driver by just preventing TRBE initialization on
100162306a36Sopenharmony_ci	  affected cpus. The firmware must have disabled the access to TRBE for the kernel
100262306a36Sopenharmony_ci	  on such implementations. This will cover the kernel for any firmware that doesn't
100362306a36Sopenharmony_ci	  do this already.
100462306a36Sopenharmony_ci
100562306a36Sopenharmony_ci	  If unsure, say Y.
100662306a36Sopenharmony_ci
100762306a36Sopenharmony_ciconfig ARM64_ERRATUM_2457168
100862306a36Sopenharmony_ci	bool "Cortex-A510: 2457168: workaround for AMEVCNTR01 incrementing incorrectly"
100962306a36Sopenharmony_ci	depends on ARM64_AMU_EXTN
101062306a36Sopenharmony_ci	default y
101162306a36Sopenharmony_ci	help
101262306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A510 erratum 2457168.
101362306a36Sopenharmony_ci
101462306a36Sopenharmony_ci	  The AMU counter AMEVCNTR01 (constant counter) should increment at the same rate
101562306a36Sopenharmony_ci	  as the system counter. On affected Cortex-A510 cores AMEVCNTR01 increments
101662306a36Sopenharmony_ci	  incorrectly giving a significantly higher output value.
101762306a36Sopenharmony_ci
101862306a36Sopenharmony_ci	  Work around this problem by returning 0 when reading the affected counter in
101962306a36Sopenharmony_ci	  key locations that results in disabling all users of this counter. This effect
102062306a36Sopenharmony_ci	  is the same to firmware disabling affected counters.
102162306a36Sopenharmony_ci
102262306a36Sopenharmony_ci	  If unsure, say Y.
102362306a36Sopenharmony_ci
102462306a36Sopenharmony_ciconfig ARM64_ERRATUM_2645198
102562306a36Sopenharmony_ci	bool "Cortex-A715: 2645198: Workaround possible [ESR|FAR]_ELx corruption"
102662306a36Sopenharmony_ci	default y
102762306a36Sopenharmony_ci	help
102862306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A715 erratum 2645198.
102962306a36Sopenharmony_ci
103062306a36Sopenharmony_ci	  If a Cortex-A715 cpu sees a page mapping permissions change from executable
103162306a36Sopenharmony_ci	  to non-executable, it may corrupt the ESR_ELx and FAR_ELx registers on the
103262306a36Sopenharmony_ci	  next instruction abort caused by permission fault.
103362306a36Sopenharmony_ci
103462306a36Sopenharmony_ci	  Only user-space does executable to non-executable permission transition via
103562306a36Sopenharmony_ci	  mprotect() system call. Workaround the problem by doing a break-before-make
103662306a36Sopenharmony_ci	  TLB invalidation, for all changes to executable user space mappings.
103762306a36Sopenharmony_ci
103862306a36Sopenharmony_ci	  If unsure, say Y.
103962306a36Sopenharmony_ci
104062306a36Sopenharmony_ciconfig ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
104162306a36Sopenharmony_ci	bool
104262306a36Sopenharmony_ci
104362306a36Sopenharmony_ciconfig ARM64_ERRATUM_2966298
104462306a36Sopenharmony_ci	bool "Cortex-A520: 2966298: workaround for speculatively executed unprivileged load"
104562306a36Sopenharmony_ci	select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
104662306a36Sopenharmony_ci	default y
104762306a36Sopenharmony_ci	help
104862306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A520 erratum 2966298.
104962306a36Sopenharmony_ci
105062306a36Sopenharmony_ci	  On an affected Cortex-A520 core, a speculatively executed unprivileged
105162306a36Sopenharmony_ci	  load might leak data from a privileged level via a cache side channel.
105262306a36Sopenharmony_ci
105362306a36Sopenharmony_ci	  Work around this problem by executing a TLBI before returning to EL0.
105462306a36Sopenharmony_ci
105562306a36Sopenharmony_ci	  If unsure, say Y.
105662306a36Sopenharmony_ci
105762306a36Sopenharmony_ciconfig ARM64_ERRATUM_3117295
105862306a36Sopenharmony_ci	bool "Cortex-A510: 3117295: workaround for speculatively executed unprivileged load"
105962306a36Sopenharmony_ci	select ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD
106062306a36Sopenharmony_ci	default y
106162306a36Sopenharmony_ci	help
106262306a36Sopenharmony_ci	  This option adds the workaround for ARM Cortex-A510 erratum 3117295.
106362306a36Sopenharmony_ci
106462306a36Sopenharmony_ci	  On an affected Cortex-A510 core, a speculatively executed unprivileged
106562306a36Sopenharmony_ci	  load might leak data from a privileged level via a cache side channel.
106662306a36Sopenharmony_ci
106762306a36Sopenharmony_ci	  Work around this problem by executing a TLBI before returning to EL0.
106862306a36Sopenharmony_ci
106962306a36Sopenharmony_ci	  If unsure, say Y.
107062306a36Sopenharmony_ci
107162306a36Sopenharmony_ciconfig CAVIUM_ERRATUM_22375
107262306a36Sopenharmony_ci	bool "Cavium erratum 22375, 24313"
107362306a36Sopenharmony_ci	default y
107462306a36Sopenharmony_ci	help
107562306a36Sopenharmony_ci	  Enable workaround for errata 22375 and 24313.
107662306a36Sopenharmony_ci
107762306a36Sopenharmony_ci	  This implements two gicv3-its errata workarounds for ThunderX. Both
107862306a36Sopenharmony_ci	  with a small impact affecting only ITS table allocation.
107962306a36Sopenharmony_ci
108062306a36Sopenharmony_ci	    erratum 22375: only alloc 8MB table size
108162306a36Sopenharmony_ci	    erratum 24313: ignore memory access type
108262306a36Sopenharmony_ci
108362306a36Sopenharmony_ci	  The fixes are in ITS initialization and basically ignore memory access
108462306a36Sopenharmony_ci	  type and table size provided by the TYPER and BASER registers.
108562306a36Sopenharmony_ci
108662306a36Sopenharmony_ci	  If unsure, say Y.
108762306a36Sopenharmony_ci
108862306a36Sopenharmony_ciconfig CAVIUM_ERRATUM_23144
108962306a36Sopenharmony_ci	bool "Cavium erratum 23144: ITS SYNC hang on dual socket system"
109062306a36Sopenharmony_ci	depends on NUMA
109162306a36Sopenharmony_ci	default y
109262306a36Sopenharmony_ci	help
109362306a36Sopenharmony_ci	  ITS SYNC command hang for cross node io and collections/cpu mapping.
109462306a36Sopenharmony_ci
109562306a36Sopenharmony_ci	  If unsure, say Y.
109662306a36Sopenharmony_ci
109762306a36Sopenharmony_ciconfig CAVIUM_ERRATUM_23154
109862306a36Sopenharmony_ci	bool "Cavium errata 23154 and 38545: GICv3 lacks HW synchronisation"
109962306a36Sopenharmony_ci	default y
110062306a36Sopenharmony_ci	help
110162306a36Sopenharmony_ci	  The ThunderX GICv3 implementation requires a modified version for
110262306a36Sopenharmony_ci	  reading the IAR status to ensure data synchronization
110362306a36Sopenharmony_ci	  (access to icc_iar1_el1 is not sync'ed before and after).
110462306a36Sopenharmony_ci
110562306a36Sopenharmony_ci	  It also suffers from erratum 38545 (also present on Marvell's
110662306a36Sopenharmony_ci	  OcteonTX and OcteonTX2), resulting in deactivated interrupts being
110762306a36Sopenharmony_ci	  spuriously presented to the CPU interface.
110862306a36Sopenharmony_ci
110962306a36Sopenharmony_ci	  If unsure, say Y.
111062306a36Sopenharmony_ci
111162306a36Sopenharmony_ciconfig CAVIUM_ERRATUM_27456
111262306a36Sopenharmony_ci	bool "Cavium erratum 27456: Broadcast TLBI instructions may cause icache corruption"
111362306a36Sopenharmony_ci	default y
111462306a36Sopenharmony_ci	help
111562306a36Sopenharmony_ci	  On ThunderX T88 pass 1.x through 2.1 parts, broadcast TLBI
111662306a36Sopenharmony_ci	  instructions may cause the icache to become corrupted if it
111762306a36Sopenharmony_ci	  contains data for a non-current ASID.  The fix is to
111862306a36Sopenharmony_ci	  invalidate the icache when changing the mm context.
111962306a36Sopenharmony_ci
112062306a36Sopenharmony_ci	  If unsure, say Y.
112162306a36Sopenharmony_ci
112262306a36Sopenharmony_ciconfig CAVIUM_ERRATUM_30115
112362306a36Sopenharmony_ci	bool "Cavium erratum 30115: Guest may disable interrupts in host"
112462306a36Sopenharmony_ci	default y
112562306a36Sopenharmony_ci	help
112662306a36Sopenharmony_ci	  On ThunderX T88 pass 1.x through 2.2, T81 pass 1.0 through
112762306a36Sopenharmony_ci	  1.2, and T83 Pass 1.0, KVM guest execution may disable
112862306a36Sopenharmony_ci	  interrupts in host. Trapping both GICv3 group-0 and group-1
112962306a36Sopenharmony_ci	  accesses sidesteps the issue.
113062306a36Sopenharmony_ci
113162306a36Sopenharmony_ci	  If unsure, say Y.
113262306a36Sopenharmony_ci
113362306a36Sopenharmony_ciconfig CAVIUM_TX2_ERRATUM_219
113462306a36Sopenharmony_ci	bool "Cavium ThunderX2 erratum 219: PRFM between TTBR change and ISB fails"
113562306a36Sopenharmony_ci	default y
113662306a36Sopenharmony_ci	help
113762306a36Sopenharmony_ci	  On Cavium ThunderX2, a load, store or prefetch instruction between a
113862306a36Sopenharmony_ci	  TTBR update and the corresponding context synchronizing operation can
113962306a36Sopenharmony_ci	  cause a spurious Data Abort to be delivered to any hardware thread in
114062306a36Sopenharmony_ci	  the CPU core.
114162306a36Sopenharmony_ci
114262306a36Sopenharmony_ci	  Work around the issue by avoiding the problematic code sequence and
114362306a36Sopenharmony_ci	  trapping KVM guest TTBRx_EL1 writes to EL2 when SMT is enabled. The
114462306a36Sopenharmony_ci	  trap handler performs the corresponding register access, skips the
114562306a36Sopenharmony_ci	  instruction and ensures context synchronization by virtue of the
114662306a36Sopenharmony_ci	  exception return.
114762306a36Sopenharmony_ci
114862306a36Sopenharmony_ci	  If unsure, say Y.
114962306a36Sopenharmony_ci
115062306a36Sopenharmony_ciconfig FUJITSU_ERRATUM_010001
115162306a36Sopenharmony_ci	bool "Fujitsu-A64FX erratum E#010001: Undefined fault may occur wrongly"
115262306a36Sopenharmony_ci	default y
115362306a36Sopenharmony_ci	help
115462306a36Sopenharmony_ci	  This option adds a workaround for Fujitsu-A64FX erratum E#010001.
115562306a36Sopenharmony_ci	  On some variants of the Fujitsu-A64FX cores ver(1.0, 1.1), memory
115662306a36Sopenharmony_ci	  accesses may cause undefined fault (Data abort, DFSC=0b111111).
115762306a36Sopenharmony_ci	  This fault occurs under a specific hardware condition when a
115862306a36Sopenharmony_ci	  load/store instruction performs an address translation using:
115962306a36Sopenharmony_ci	  case-1  TTBR0_EL1 with TCR_EL1.NFD0 == 1.
116062306a36Sopenharmony_ci	  case-2  TTBR0_EL2 with TCR_EL2.NFD0 == 1.
116162306a36Sopenharmony_ci	  case-3  TTBR1_EL1 with TCR_EL1.NFD1 == 1.
116262306a36Sopenharmony_ci	  case-4  TTBR1_EL2 with TCR_EL2.NFD1 == 1.
116362306a36Sopenharmony_ci
116462306a36Sopenharmony_ci	  The workaround is to ensure these bits are clear in TCR_ELx.
116562306a36Sopenharmony_ci	  The workaround only affects the Fujitsu-A64FX.
116662306a36Sopenharmony_ci
116762306a36Sopenharmony_ci	  If unsure, say Y.
116862306a36Sopenharmony_ci
116962306a36Sopenharmony_ciconfig HISILICON_ERRATUM_161600802
117062306a36Sopenharmony_ci	bool "Hip07 161600802: Erroneous redistributor VLPI base"
117162306a36Sopenharmony_ci	default y
117262306a36Sopenharmony_ci	help
117362306a36Sopenharmony_ci	  The HiSilicon Hip07 SoC uses the wrong redistributor base
117462306a36Sopenharmony_ci	  when issued ITS commands such as VMOVP and VMAPP, and requires
117562306a36Sopenharmony_ci	  a 128kB offset to be applied to the target address in this commands.
117662306a36Sopenharmony_ci
117762306a36Sopenharmony_ci	  If unsure, say Y.
117862306a36Sopenharmony_ci
117962306a36Sopenharmony_ciconfig QCOM_FALKOR_ERRATUM_1003
118062306a36Sopenharmony_ci	bool "Falkor E1003: Incorrect translation due to ASID change"
118162306a36Sopenharmony_ci	default y
118262306a36Sopenharmony_ci	help
118362306a36Sopenharmony_ci	  On Falkor v1, an incorrect ASID may be cached in the TLB when ASID
118462306a36Sopenharmony_ci	  and BADDR are changed together in TTBRx_EL1. Since we keep the ASID
118562306a36Sopenharmony_ci	  in TTBR1_EL1, this situation only occurs in the entry trampoline and
118662306a36Sopenharmony_ci	  then only for entries in the walk cache, since the leaf translation
118762306a36Sopenharmony_ci	  is unchanged. Work around the erratum by invalidating the walk cache
118862306a36Sopenharmony_ci	  entries for the trampoline before entering the kernel proper.
118962306a36Sopenharmony_ci
119062306a36Sopenharmony_ciconfig QCOM_FALKOR_ERRATUM_1009
119162306a36Sopenharmony_ci	bool "Falkor E1009: Prematurely complete a DSB after a TLBI"
119262306a36Sopenharmony_ci	default y
119362306a36Sopenharmony_ci	select ARM64_WORKAROUND_REPEAT_TLBI
119462306a36Sopenharmony_ci	help
119562306a36Sopenharmony_ci	  On Falkor v1, the CPU may prematurely complete a DSB following a
119662306a36Sopenharmony_ci	  TLBI xxIS invalidate maintenance operation. Repeat the TLBI operation
119762306a36Sopenharmony_ci	  one more time to fix the issue.
119862306a36Sopenharmony_ci
119962306a36Sopenharmony_ci	  If unsure, say Y.
120062306a36Sopenharmony_ci
120162306a36Sopenharmony_ciconfig QCOM_QDF2400_ERRATUM_0065
120262306a36Sopenharmony_ci	bool "QDF2400 E0065: Incorrect GITS_TYPER.ITT_Entry_size"
120362306a36Sopenharmony_ci	default y
120462306a36Sopenharmony_ci	help
120562306a36Sopenharmony_ci	  On Qualcomm Datacenter Technologies QDF2400 SoC, ITS hardware reports
120662306a36Sopenharmony_ci	  ITE size incorrectly. The GITS_TYPER.ITT_Entry_size field should have
120762306a36Sopenharmony_ci	  been indicated as 16Bytes (0xf), not 8Bytes (0x7).
120862306a36Sopenharmony_ci
120962306a36Sopenharmony_ci	  If unsure, say Y.
121062306a36Sopenharmony_ci
121162306a36Sopenharmony_ciconfig QCOM_FALKOR_ERRATUM_E1041
121262306a36Sopenharmony_ci	bool "Falkor E1041: Speculative instruction fetches might cause errant memory access"
121362306a36Sopenharmony_ci	default y
121462306a36Sopenharmony_ci	help
121562306a36Sopenharmony_ci	  Falkor CPU may speculatively fetch instructions from an improper
121662306a36Sopenharmony_ci	  memory location when MMU translation is changed from SCTLR_ELn[M]=1
121762306a36Sopenharmony_ci	  to SCTLR_ELn[M]=0. Prefix an ISB instruction to fix the problem.
121862306a36Sopenharmony_ci
121962306a36Sopenharmony_ci	  If unsure, say Y.
122062306a36Sopenharmony_ci
122162306a36Sopenharmony_ciconfig NVIDIA_CARMEL_CNP_ERRATUM
122262306a36Sopenharmony_ci	bool "NVIDIA Carmel CNP: CNP on Carmel semantically different than ARM cores"
122362306a36Sopenharmony_ci	default y
122462306a36Sopenharmony_ci	help
122562306a36Sopenharmony_ci	  If CNP is enabled on Carmel cores, non-sharable TLBIs on a core will not
122662306a36Sopenharmony_ci	  invalidate shared TLB entries installed by a different core, as it would
122762306a36Sopenharmony_ci	  on standard ARM cores.
122862306a36Sopenharmony_ci
122962306a36Sopenharmony_ci	  If unsure, say Y.
123062306a36Sopenharmony_ci
123162306a36Sopenharmony_ciconfig ROCKCHIP_ERRATUM_3588001
123262306a36Sopenharmony_ci	bool "Rockchip 3588001: GIC600 can not support shareability attributes"
123362306a36Sopenharmony_ci	default y
123462306a36Sopenharmony_ci	help
123562306a36Sopenharmony_ci	  The Rockchip RK3588 GIC600 SoC integration does not support ACE/ACE-lite.
123662306a36Sopenharmony_ci	  This means, that its sharability feature may not be used, even though it
123762306a36Sopenharmony_ci	  is supported by the IP itself.
123862306a36Sopenharmony_ci
123962306a36Sopenharmony_ci	  If unsure, say Y.
124062306a36Sopenharmony_ci
124162306a36Sopenharmony_ciconfig SOCIONEXT_SYNQUACER_PREITS
124262306a36Sopenharmony_ci	bool "Socionext Synquacer: Workaround for GICv3 pre-ITS"
124362306a36Sopenharmony_ci	default y
124462306a36Sopenharmony_ci	help
124562306a36Sopenharmony_ci	  Socionext Synquacer SoCs implement a separate h/w block to generate
124662306a36Sopenharmony_ci	  MSI doorbell writes with non-zero values for the device ID.
124762306a36Sopenharmony_ci
124862306a36Sopenharmony_ci	  If unsure, say Y.
124962306a36Sopenharmony_ci
125062306a36Sopenharmony_ciendmenu # "ARM errata workarounds via the alternatives framework"
125162306a36Sopenharmony_ci
125262306a36Sopenharmony_cichoice
125362306a36Sopenharmony_ci	prompt "Page size"
125462306a36Sopenharmony_ci	default ARM64_4K_PAGES
125562306a36Sopenharmony_ci	help
125662306a36Sopenharmony_ci	  Page size (translation granule) configuration.
125762306a36Sopenharmony_ci
125862306a36Sopenharmony_ciconfig ARM64_4K_PAGES
125962306a36Sopenharmony_ci	bool "4KB"
126062306a36Sopenharmony_ci	help
126162306a36Sopenharmony_ci	  This feature enables 4KB pages support.
126262306a36Sopenharmony_ci
126362306a36Sopenharmony_ciconfig ARM64_16K_PAGES
126462306a36Sopenharmony_ci	bool "16KB"
126562306a36Sopenharmony_ci	help
126662306a36Sopenharmony_ci	  The system will use 16KB pages support. AArch32 emulation
126762306a36Sopenharmony_ci	  requires applications compiled with 16K (or a multiple of 16K)
126862306a36Sopenharmony_ci	  aligned segments.
126962306a36Sopenharmony_ci
127062306a36Sopenharmony_ciconfig ARM64_64K_PAGES
127162306a36Sopenharmony_ci	bool "64KB"
127262306a36Sopenharmony_ci	help
127362306a36Sopenharmony_ci	  This feature enables 64KB pages support (4KB by default)
127462306a36Sopenharmony_ci	  allowing only two levels of page tables and faster TLB
127562306a36Sopenharmony_ci	  look-up. AArch32 emulation requires applications compiled
127662306a36Sopenharmony_ci	  with 64K aligned segments.
127762306a36Sopenharmony_ci
127862306a36Sopenharmony_ciendchoice
127962306a36Sopenharmony_ci
128062306a36Sopenharmony_cichoice
128162306a36Sopenharmony_ci	prompt "Virtual address space size"
128262306a36Sopenharmony_ci	default ARM64_VA_BITS_39 if ARM64_4K_PAGES
128362306a36Sopenharmony_ci	default ARM64_VA_BITS_47 if ARM64_16K_PAGES
128462306a36Sopenharmony_ci	default ARM64_VA_BITS_42 if ARM64_64K_PAGES
128562306a36Sopenharmony_ci	help
128662306a36Sopenharmony_ci	  Allows choosing one of multiple possible virtual address
128762306a36Sopenharmony_ci	  space sizes. The level of translation table is determined by
128862306a36Sopenharmony_ci	  a combination of page size and virtual address space size.
128962306a36Sopenharmony_ci
129062306a36Sopenharmony_ciconfig ARM64_VA_BITS_36
129162306a36Sopenharmony_ci	bool "36-bit" if EXPERT
129262306a36Sopenharmony_ci	depends on ARM64_16K_PAGES
129362306a36Sopenharmony_ci
129462306a36Sopenharmony_ciconfig ARM64_VA_BITS_39
129562306a36Sopenharmony_ci	bool "39-bit"
129662306a36Sopenharmony_ci	depends on ARM64_4K_PAGES
129762306a36Sopenharmony_ci
129862306a36Sopenharmony_ciconfig ARM64_VA_BITS_42
129962306a36Sopenharmony_ci	bool "42-bit"
130062306a36Sopenharmony_ci	depends on ARM64_64K_PAGES
130162306a36Sopenharmony_ci
130262306a36Sopenharmony_ciconfig ARM64_VA_BITS_47
130362306a36Sopenharmony_ci	bool "47-bit"
130462306a36Sopenharmony_ci	depends on ARM64_16K_PAGES
130562306a36Sopenharmony_ci
130662306a36Sopenharmony_ciconfig ARM64_VA_BITS_48
130762306a36Sopenharmony_ci	bool "48-bit"
130862306a36Sopenharmony_ci
130962306a36Sopenharmony_ciconfig ARM64_VA_BITS_52
131062306a36Sopenharmony_ci	bool "52-bit"
131162306a36Sopenharmony_ci	depends on ARM64_64K_PAGES && (ARM64_PAN || !ARM64_SW_TTBR0_PAN)
131262306a36Sopenharmony_ci	help
131362306a36Sopenharmony_ci	  Enable 52-bit virtual addressing for userspace when explicitly
131462306a36Sopenharmony_ci	  requested via a hint to mmap(). The kernel will also use 52-bit
131562306a36Sopenharmony_ci	  virtual addresses for its own mappings (provided HW support for
131662306a36Sopenharmony_ci	  this feature is available, otherwise it reverts to 48-bit).
131762306a36Sopenharmony_ci
131862306a36Sopenharmony_ci	  NOTE: Enabling 52-bit virtual addressing in conjunction with
131962306a36Sopenharmony_ci	  ARMv8.3 Pointer Authentication will result in the PAC being
132062306a36Sopenharmony_ci	  reduced from 7 bits to 3 bits, which may have a significant
132162306a36Sopenharmony_ci	  impact on its susceptibility to brute-force attacks.
132262306a36Sopenharmony_ci
132362306a36Sopenharmony_ci	  If unsure, select 48-bit virtual addressing instead.
132462306a36Sopenharmony_ci
132562306a36Sopenharmony_ciendchoice
132662306a36Sopenharmony_ci
132762306a36Sopenharmony_ciconfig ARM64_FORCE_52BIT
132862306a36Sopenharmony_ci	bool "Force 52-bit virtual addresses for userspace"
132962306a36Sopenharmony_ci	depends on ARM64_VA_BITS_52 && EXPERT
133062306a36Sopenharmony_ci	help
133162306a36Sopenharmony_ci	  For systems with 52-bit userspace VAs enabled, the kernel will attempt
133262306a36Sopenharmony_ci	  to maintain compatibility with older software by providing 48-bit VAs
133362306a36Sopenharmony_ci	  unless a hint is supplied to mmap.
133462306a36Sopenharmony_ci
133562306a36Sopenharmony_ci	  This configuration option disables the 48-bit compatibility logic, and
133662306a36Sopenharmony_ci	  forces all userspace addresses to be 52-bit on HW that supports it. One
133762306a36Sopenharmony_ci	  should only enable this configuration option for stress testing userspace
133862306a36Sopenharmony_ci	  memory management code. If unsure say N here.
133962306a36Sopenharmony_ci
134062306a36Sopenharmony_ciconfig ARM64_VA_BITS
134162306a36Sopenharmony_ci	int
134262306a36Sopenharmony_ci	default 36 if ARM64_VA_BITS_36
134362306a36Sopenharmony_ci	default 39 if ARM64_VA_BITS_39
134462306a36Sopenharmony_ci	default 42 if ARM64_VA_BITS_42
134562306a36Sopenharmony_ci	default 47 if ARM64_VA_BITS_47
134662306a36Sopenharmony_ci	default 48 if ARM64_VA_BITS_48
134762306a36Sopenharmony_ci	default 52 if ARM64_VA_BITS_52
134862306a36Sopenharmony_ci
134962306a36Sopenharmony_cichoice
135062306a36Sopenharmony_ci	prompt "Physical address space size"
135162306a36Sopenharmony_ci	default ARM64_PA_BITS_48
135262306a36Sopenharmony_ci	help
135362306a36Sopenharmony_ci	  Choose the maximum physical address range that the kernel will
135462306a36Sopenharmony_ci	  support.
135562306a36Sopenharmony_ci
135662306a36Sopenharmony_ciconfig ARM64_PA_BITS_48
135762306a36Sopenharmony_ci	bool "48-bit"
135862306a36Sopenharmony_ci
135962306a36Sopenharmony_ciconfig ARM64_PA_BITS_52
136062306a36Sopenharmony_ci	bool "52-bit (ARMv8.2)"
136162306a36Sopenharmony_ci	depends on ARM64_64K_PAGES
136262306a36Sopenharmony_ci	depends on ARM64_PAN || !ARM64_SW_TTBR0_PAN
136362306a36Sopenharmony_ci	help
136462306a36Sopenharmony_ci	  Enable support for a 52-bit physical address space, introduced as
136562306a36Sopenharmony_ci	  part of the ARMv8.2-LPA extension.
136662306a36Sopenharmony_ci
136762306a36Sopenharmony_ci	  With this enabled, the kernel will also continue to work on CPUs that
136862306a36Sopenharmony_ci	  do not support ARMv8.2-LPA, but with some added memory overhead (and
136962306a36Sopenharmony_ci	  minor performance overhead).
137062306a36Sopenharmony_ci
137162306a36Sopenharmony_ciendchoice
137262306a36Sopenharmony_ci
137362306a36Sopenharmony_ciconfig ARM64_PA_BITS
137462306a36Sopenharmony_ci	int
137562306a36Sopenharmony_ci	default 48 if ARM64_PA_BITS_48
137662306a36Sopenharmony_ci	default 52 if ARM64_PA_BITS_52
137762306a36Sopenharmony_ci
137862306a36Sopenharmony_cichoice
137962306a36Sopenharmony_ci	prompt "Endianness"
138062306a36Sopenharmony_ci	default CPU_LITTLE_ENDIAN
138162306a36Sopenharmony_ci	help
138262306a36Sopenharmony_ci	  Select the endianness of data accesses performed by the CPU. Userspace
138362306a36Sopenharmony_ci	  applications will need to be compiled and linked for the endianness
138462306a36Sopenharmony_ci	  that is selected here.
138562306a36Sopenharmony_ci
138662306a36Sopenharmony_ciconfig CPU_BIG_ENDIAN
138762306a36Sopenharmony_ci	bool "Build big-endian kernel"
138862306a36Sopenharmony_ci	depends on !LD_IS_LLD || LLD_VERSION >= 130000
138962306a36Sopenharmony_ci	# https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c
139062306a36Sopenharmony_ci	depends on AS_IS_GNU || AS_VERSION >= 150000
139162306a36Sopenharmony_ci	help
139262306a36Sopenharmony_ci	  Say Y if you plan on running a kernel with a big-endian userspace.
139362306a36Sopenharmony_ci
139462306a36Sopenharmony_ciconfig CPU_LITTLE_ENDIAN
139562306a36Sopenharmony_ci	bool "Build little-endian kernel"
139662306a36Sopenharmony_ci	help
139762306a36Sopenharmony_ci	  Say Y if you plan on running a kernel with a little-endian userspace.
139862306a36Sopenharmony_ci	  This is usually the case for distributions targeting arm64.
139962306a36Sopenharmony_ci
140062306a36Sopenharmony_ciendchoice
140162306a36Sopenharmony_ci
140262306a36Sopenharmony_ciconfig SCHED_MC
140362306a36Sopenharmony_ci	bool "Multi-core scheduler support"
140462306a36Sopenharmony_ci	help
140562306a36Sopenharmony_ci	  Multi-core scheduler support improves the CPU scheduler's decision
140662306a36Sopenharmony_ci	  making when dealing with multi-core CPU chips at a cost of slightly
140762306a36Sopenharmony_ci	  increased overhead in some places. If unsure say N here.
140862306a36Sopenharmony_ci
140962306a36Sopenharmony_ciconfig SCHED_CLUSTER
141062306a36Sopenharmony_ci	bool "Cluster scheduler support"
141162306a36Sopenharmony_ci	help
141262306a36Sopenharmony_ci	  Cluster scheduler support improves the CPU scheduler's decision
141362306a36Sopenharmony_ci	  making when dealing with machines that have clusters of CPUs.
141462306a36Sopenharmony_ci	  Cluster usually means a couple of CPUs which are placed closely
141562306a36Sopenharmony_ci	  by sharing mid-level caches, last-level cache tags or internal
141662306a36Sopenharmony_ci	  busses.
141762306a36Sopenharmony_ci
141862306a36Sopenharmony_ciconfig SCHED_SMT
141962306a36Sopenharmony_ci	bool "SMT scheduler support"
142062306a36Sopenharmony_ci	help
142162306a36Sopenharmony_ci	  Improves the CPU scheduler's decision making when dealing with
142262306a36Sopenharmony_ci	  MultiThreading at a cost of slightly increased overhead in some
142362306a36Sopenharmony_ci	  places. If unsure say N here.
142462306a36Sopenharmony_ci
142562306a36Sopenharmony_ciconfig NR_CPUS
142662306a36Sopenharmony_ci	int "Maximum number of CPUs (2-4096)"
142762306a36Sopenharmony_ci	range 2 4096
142862306a36Sopenharmony_ci	default "256"
142962306a36Sopenharmony_ci
143062306a36Sopenharmony_ciconfig HOTPLUG_CPU
143162306a36Sopenharmony_ci	bool "Support for hot-pluggable CPUs"
143262306a36Sopenharmony_ci	select GENERIC_IRQ_MIGRATION
143362306a36Sopenharmony_ci	help
143462306a36Sopenharmony_ci	  Say Y here to experiment with turning CPUs off and on.  CPUs
143562306a36Sopenharmony_ci	  can be controlled through /sys/devices/system/cpu.
143662306a36Sopenharmony_ci
143762306a36Sopenharmony_ci# Common NUMA Features
143862306a36Sopenharmony_ciconfig NUMA
143962306a36Sopenharmony_ci	bool "NUMA Memory Allocation and Scheduler Support"
144062306a36Sopenharmony_ci	select GENERIC_ARCH_NUMA
144162306a36Sopenharmony_ci	select ACPI_NUMA if ACPI
144262306a36Sopenharmony_ci	select OF_NUMA
144362306a36Sopenharmony_ci	select HAVE_SETUP_PER_CPU_AREA
144462306a36Sopenharmony_ci	select NEED_PER_CPU_EMBED_FIRST_CHUNK
144562306a36Sopenharmony_ci	select NEED_PER_CPU_PAGE_FIRST_CHUNK
144662306a36Sopenharmony_ci	select USE_PERCPU_NUMA_NODE_ID
144762306a36Sopenharmony_ci	help
144862306a36Sopenharmony_ci	  Enable NUMA (Non-Uniform Memory Access) support.
144962306a36Sopenharmony_ci
145062306a36Sopenharmony_ci	  The kernel will try to allocate memory used by a CPU on the
145162306a36Sopenharmony_ci	  local memory of the CPU and add some more
145262306a36Sopenharmony_ci	  NUMA awareness to the kernel.
145362306a36Sopenharmony_ci
145462306a36Sopenharmony_ciconfig NODES_SHIFT
145562306a36Sopenharmony_ci	int "Maximum NUMA Nodes (as a power of 2)"
145662306a36Sopenharmony_ci	range 1 10
145762306a36Sopenharmony_ci	default "4"
145862306a36Sopenharmony_ci	depends on NUMA
145962306a36Sopenharmony_ci	help
146062306a36Sopenharmony_ci	  Specify the maximum number of NUMA Nodes available on the target
146162306a36Sopenharmony_ci	  system.  Increases memory reserved to accommodate various tables.
146262306a36Sopenharmony_ci
146362306a36Sopenharmony_cisource "kernel/Kconfig.hz"
146462306a36Sopenharmony_ci
146562306a36Sopenharmony_ciconfig ARCH_SPARSEMEM_ENABLE
146662306a36Sopenharmony_ci	def_bool y
146762306a36Sopenharmony_ci	select SPARSEMEM_VMEMMAP_ENABLE
146862306a36Sopenharmony_ci	select SPARSEMEM_VMEMMAP
146962306a36Sopenharmony_ci
147062306a36Sopenharmony_ciconfig HW_PERF_EVENTS
147162306a36Sopenharmony_ci	def_bool y
147262306a36Sopenharmony_ci	depends on ARM_PMU
147362306a36Sopenharmony_ci
147462306a36Sopenharmony_ci# Supported by clang >= 7.0 or GCC >= 12.0.0
147562306a36Sopenharmony_ciconfig CC_HAVE_SHADOW_CALL_STACK
147662306a36Sopenharmony_ci	def_bool $(cc-option, -fsanitize=shadow-call-stack -ffixed-x18)
147762306a36Sopenharmony_ci
147862306a36Sopenharmony_ciconfig PARAVIRT
147962306a36Sopenharmony_ci	bool "Enable paravirtualization code"
148062306a36Sopenharmony_ci	help
148162306a36Sopenharmony_ci	  This changes the kernel so it can modify itself when it is run
148262306a36Sopenharmony_ci	  under a hypervisor, potentially improving performance significantly
148362306a36Sopenharmony_ci	  over full virtualization.
148462306a36Sopenharmony_ci
148562306a36Sopenharmony_ciconfig PARAVIRT_TIME_ACCOUNTING
148662306a36Sopenharmony_ci	bool "Paravirtual steal time accounting"
148762306a36Sopenharmony_ci	select PARAVIRT
148862306a36Sopenharmony_ci	help
148962306a36Sopenharmony_ci	  Select this option to enable fine granularity task steal time
149062306a36Sopenharmony_ci	  accounting. Time spent executing other tasks in parallel with
149162306a36Sopenharmony_ci	  the current vCPU is discounted from the vCPU power. To account for
149262306a36Sopenharmony_ci	  that, there can be a small performance impact.
149362306a36Sopenharmony_ci
149462306a36Sopenharmony_ci	  If in doubt, say N here.
149562306a36Sopenharmony_ci
149662306a36Sopenharmony_ciconfig ARCH_SUPPORTS_KEXEC
149762306a36Sopenharmony_ci	def_bool PM_SLEEP_SMP
149862306a36Sopenharmony_ci
149962306a36Sopenharmony_ciconfig ARCH_SUPPORTS_KEXEC_FILE
150062306a36Sopenharmony_ci	def_bool y
150162306a36Sopenharmony_ci
150262306a36Sopenharmony_ciconfig ARCH_SELECTS_KEXEC_FILE
150362306a36Sopenharmony_ci	def_bool y
150462306a36Sopenharmony_ci	depends on KEXEC_FILE
150562306a36Sopenharmony_ci	select HAVE_IMA_KEXEC if IMA
150662306a36Sopenharmony_ci
150762306a36Sopenharmony_ciconfig ARCH_SUPPORTS_KEXEC_SIG
150862306a36Sopenharmony_ci	def_bool y
150962306a36Sopenharmony_ci
151062306a36Sopenharmony_ciconfig ARCH_SUPPORTS_KEXEC_IMAGE_VERIFY_SIG
151162306a36Sopenharmony_ci	def_bool y
151262306a36Sopenharmony_ci
151362306a36Sopenharmony_ciconfig ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG
151462306a36Sopenharmony_ci	def_bool y
151562306a36Sopenharmony_ci
151662306a36Sopenharmony_ciconfig ARCH_SUPPORTS_CRASH_DUMP
151762306a36Sopenharmony_ci	def_bool y
151862306a36Sopenharmony_ci
151962306a36Sopenharmony_ciconfig TRANS_TABLE
152062306a36Sopenharmony_ci	def_bool y
152162306a36Sopenharmony_ci	depends on HIBERNATION || KEXEC_CORE
152262306a36Sopenharmony_ci
152362306a36Sopenharmony_ciconfig XEN_DOM0
152462306a36Sopenharmony_ci	def_bool y
152562306a36Sopenharmony_ci	depends on XEN
152662306a36Sopenharmony_ci
152762306a36Sopenharmony_ciconfig XEN
152862306a36Sopenharmony_ci	bool "Xen guest support on ARM64"
152962306a36Sopenharmony_ci	depends on ARM64 && OF
153062306a36Sopenharmony_ci	select SWIOTLB_XEN
153162306a36Sopenharmony_ci	select PARAVIRT
153262306a36Sopenharmony_ci	help
153362306a36Sopenharmony_ci	  Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
153462306a36Sopenharmony_ci
153562306a36Sopenharmony_ci# include/linux/mmzone.h requires the following to be true:
153662306a36Sopenharmony_ci#
153762306a36Sopenharmony_ci#   MAX_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
153862306a36Sopenharmony_ci#
153962306a36Sopenharmony_ci# so the maximum value of MAX_ORDER is SECTION_SIZE_BITS - PAGE_SHIFT:
154062306a36Sopenharmony_ci#
154162306a36Sopenharmony_ci#     | SECTION_SIZE_BITS |  PAGE_SHIFT  |  max MAX_ORDER  |  default MAX_ORDER |
154262306a36Sopenharmony_ci# ----+-------------------+--------------+-----------------+--------------------+
154362306a36Sopenharmony_ci# 4K  |       27          |      12      |       15        |         10         |
154462306a36Sopenharmony_ci# 16K |       27          |      14      |       13        |         11         |
154562306a36Sopenharmony_ci# 64K |       29          |      16      |       13        |         13         |
154662306a36Sopenharmony_ciconfig ARCH_FORCE_MAX_ORDER
154762306a36Sopenharmony_ci	int
154862306a36Sopenharmony_ci	default "13" if ARM64_64K_PAGES
154962306a36Sopenharmony_ci	default "11" if ARM64_16K_PAGES
155062306a36Sopenharmony_ci	default "10"
155162306a36Sopenharmony_ci	help
155262306a36Sopenharmony_ci	  The kernel page allocator limits the size of maximal physically
155362306a36Sopenharmony_ci	  contiguous allocations. The limit is called MAX_ORDER and it
155462306a36Sopenharmony_ci	  defines the maximal power of two of number of pages that can be
155562306a36Sopenharmony_ci	  allocated as a single contiguous block. This option allows
155662306a36Sopenharmony_ci	  overriding the default setting when ability to allocate very
155762306a36Sopenharmony_ci	  large blocks of physically contiguous memory is required.
155862306a36Sopenharmony_ci
155962306a36Sopenharmony_ci	  The maximal size of allocation cannot exceed the size of the
156062306a36Sopenharmony_ci	  section, so the value of MAX_ORDER should satisfy
156162306a36Sopenharmony_ci
156262306a36Sopenharmony_ci	    MAX_ORDER + PAGE_SHIFT <= SECTION_SIZE_BITS
156362306a36Sopenharmony_ci
156462306a36Sopenharmony_ci	  Don't change if unsure.
156562306a36Sopenharmony_ci
156662306a36Sopenharmony_ciconfig UNMAP_KERNEL_AT_EL0
156762306a36Sopenharmony_ci	bool "Unmap kernel when running in userspace (aka \"KAISER\")" if EXPERT
156862306a36Sopenharmony_ci	default y
156962306a36Sopenharmony_ci	help
157062306a36Sopenharmony_ci	  Speculation attacks against some high-performance processors can
157162306a36Sopenharmony_ci	  be used to bypass MMU permission checks and leak kernel data to
157262306a36Sopenharmony_ci	  userspace. This can be defended against by unmapping the kernel
157362306a36Sopenharmony_ci	  when running in userspace, mapping it back in on exception entry
157462306a36Sopenharmony_ci	  via a trampoline page in the vector table.
157562306a36Sopenharmony_ci
157662306a36Sopenharmony_ci	  If unsure, say Y.
157762306a36Sopenharmony_ci
157862306a36Sopenharmony_ciconfig MITIGATE_SPECTRE_BRANCH_HISTORY
157962306a36Sopenharmony_ci	bool "Mitigate Spectre style attacks against branch history" if EXPERT
158062306a36Sopenharmony_ci	default y
158162306a36Sopenharmony_ci	help
158262306a36Sopenharmony_ci	  Speculation attacks against some high-performance processors can
158362306a36Sopenharmony_ci	  make use of branch history to influence future speculation.
158462306a36Sopenharmony_ci	  When taking an exception from user-space, a sequence of branches
158562306a36Sopenharmony_ci	  or a firmware call overwrites the branch history.
158662306a36Sopenharmony_ci
158762306a36Sopenharmony_ciconfig RODATA_FULL_DEFAULT_ENABLED
158862306a36Sopenharmony_ci	bool "Apply r/o permissions of VM areas also to their linear aliases"
158962306a36Sopenharmony_ci	default y
159062306a36Sopenharmony_ci	help
159162306a36Sopenharmony_ci	  Apply read-only attributes of VM areas to the linear alias of
159262306a36Sopenharmony_ci	  the backing pages as well. This prevents code or read-only data
159362306a36Sopenharmony_ci	  from being modified (inadvertently or intentionally) via another
159462306a36Sopenharmony_ci	  mapping of the same memory page. This additional enhancement can
159562306a36Sopenharmony_ci	  be turned off at runtime by passing rodata=[off|on] (and turned on
159662306a36Sopenharmony_ci	  with rodata=full if this option is set to 'n')
159762306a36Sopenharmony_ci
159862306a36Sopenharmony_ci	  This requires the linear region to be mapped down to pages,
159962306a36Sopenharmony_ci	  which may adversely affect performance in some cases.
160062306a36Sopenharmony_ci
160162306a36Sopenharmony_ciconfig ARM64_SW_TTBR0_PAN
160262306a36Sopenharmony_ci	bool "Emulate Privileged Access Never using TTBR0_EL1 switching"
160362306a36Sopenharmony_ci	help
160462306a36Sopenharmony_ci	  Enabling this option prevents the kernel from accessing
160562306a36Sopenharmony_ci	  user-space memory directly by pointing TTBR0_EL1 to a reserved
160662306a36Sopenharmony_ci	  zeroed area and reserved ASID. The user access routines
160762306a36Sopenharmony_ci	  restore the valid TTBR0_EL1 temporarily.
160862306a36Sopenharmony_ci
160962306a36Sopenharmony_ciconfig ARM64_TAGGED_ADDR_ABI
161062306a36Sopenharmony_ci	bool "Enable the tagged user addresses syscall ABI"
161162306a36Sopenharmony_ci	default y
161262306a36Sopenharmony_ci	help
161362306a36Sopenharmony_ci	  When this option is enabled, user applications can opt in to a
161462306a36Sopenharmony_ci	  relaxed ABI via prctl() allowing tagged addresses to be passed
161562306a36Sopenharmony_ci	  to system calls as pointer arguments. For details, see
161662306a36Sopenharmony_ci	  Documentation/arch/arm64/tagged-address-abi.rst.
161762306a36Sopenharmony_ci
161862306a36Sopenharmony_cimenuconfig COMPAT
161962306a36Sopenharmony_ci	bool "Kernel support for 32-bit EL0"
162062306a36Sopenharmony_ci	depends on ARM64_4K_PAGES || EXPERT
162162306a36Sopenharmony_ci	select HAVE_UID16
162262306a36Sopenharmony_ci	select OLD_SIGSUSPEND3
162362306a36Sopenharmony_ci	select COMPAT_OLD_SIGACTION
162462306a36Sopenharmony_ci	help
162562306a36Sopenharmony_ci	  This option enables support for a 32-bit EL0 running under a 64-bit
162662306a36Sopenharmony_ci	  kernel at EL1. AArch32-specific components such as system calls,
162762306a36Sopenharmony_ci	  the user helper functions, VFP support and the ptrace interface are
162862306a36Sopenharmony_ci	  handled appropriately by the kernel.
162962306a36Sopenharmony_ci
163062306a36Sopenharmony_ci	  If you use a page size other than 4KB (i.e, 16KB or 64KB), please be aware
163162306a36Sopenharmony_ci	  that you will only be able to execute AArch32 binaries that were compiled
163262306a36Sopenharmony_ci	  with page size aligned segments.
163362306a36Sopenharmony_ci
163462306a36Sopenharmony_ci	  If you want to execute 32-bit userspace applications, say Y.
163562306a36Sopenharmony_ci
163662306a36Sopenharmony_ciif COMPAT
163762306a36Sopenharmony_ci
163862306a36Sopenharmony_ciconfig KUSER_HELPERS
163962306a36Sopenharmony_ci	bool "Enable kuser helpers page for 32-bit applications"
164062306a36Sopenharmony_ci	default y
164162306a36Sopenharmony_ci	help
164262306a36Sopenharmony_ci	  Warning: disabling this option may break 32-bit user programs.
164362306a36Sopenharmony_ci
164462306a36Sopenharmony_ci	  Provide kuser helpers to compat tasks. The kernel provides
164562306a36Sopenharmony_ci	  helper code to userspace in read only form at a fixed location
164662306a36Sopenharmony_ci	  to allow userspace to be independent of the CPU type fitted to
164762306a36Sopenharmony_ci	  the system. This permits binaries to be run on ARMv4 through
164862306a36Sopenharmony_ci	  to ARMv8 without modification.
164962306a36Sopenharmony_ci
165062306a36Sopenharmony_ci	  See Documentation/arch/arm/kernel_user_helpers.rst for details.
165162306a36Sopenharmony_ci
165262306a36Sopenharmony_ci	  However, the fixed address nature of these helpers can be used
165362306a36Sopenharmony_ci	  by ROP (return orientated programming) authors when creating
165462306a36Sopenharmony_ci	  exploits.
165562306a36Sopenharmony_ci
165662306a36Sopenharmony_ci	  If all of the binaries and libraries which run on your platform
165762306a36Sopenharmony_ci	  are built specifically for your platform, and make no use of
165862306a36Sopenharmony_ci	  these helpers, then you can turn this option off to hinder
165962306a36Sopenharmony_ci	  such exploits. However, in that case, if a binary or library
166062306a36Sopenharmony_ci	  relying on those helpers is run, it will not function correctly.
166162306a36Sopenharmony_ci
166262306a36Sopenharmony_ci	  Say N here only if you are absolutely certain that you do not
166362306a36Sopenharmony_ci	  need these helpers; otherwise, the safe option is to say Y.
166462306a36Sopenharmony_ci
166562306a36Sopenharmony_ciconfig COMPAT_VDSO
166662306a36Sopenharmony_ci	bool "Enable vDSO for 32-bit applications"
166762306a36Sopenharmony_ci	depends on !CPU_BIG_ENDIAN
166862306a36Sopenharmony_ci	depends on (CC_IS_CLANG && LD_IS_LLD) || "$(CROSS_COMPILE_COMPAT)" != ""
166962306a36Sopenharmony_ci	select GENERIC_COMPAT_VDSO
167062306a36Sopenharmony_ci	default y
167162306a36Sopenharmony_ci	help
167262306a36Sopenharmony_ci	  Place in the process address space of 32-bit applications an
167362306a36Sopenharmony_ci	  ELF shared object providing fast implementations of gettimeofday
167462306a36Sopenharmony_ci	  and clock_gettime.
167562306a36Sopenharmony_ci
167662306a36Sopenharmony_ci	  You must have a 32-bit build of glibc 2.22 or later for programs
167762306a36Sopenharmony_ci	  to seamlessly take advantage of this.
167862306a36Sopenharmony_ci
167962306a36Sopenharmony_ciconfig THUMB2_COMPAT_VDSO
168062306a36Sopenharmony_ci	bool "Compile the 32-bit vDSO for Thumb-2 mode" if EXPERT
168162306a36Sopenharmony_ci	depends on COMPAT_VDSO
168262306a36Sopenharmony_ci	default y
168362306a36Sopenharmony_ci	help
168462306a36Sopenharmony_ci	  Compile the compat vDSO with '-mthumb -fomit-frame-pointer' if y,
168562306a36Sopenharmony_ci	  otherwise with '-marm'.
168662306a36Sopenharmony_ci
168762306a36Sopenharmony_ciconfig COMPAT_ALIGNMENT_FIXUPS
168862306a36Sopenharmony_ci	bool "Fix up misaligned multi-word loads and stores in user space"
168962306a36Sopenharmony_ci
169062306a36Sopenharmony_cimenuconfig ARMV8_DEPRECATED
169162306a36Sopenharmony_ci	bool "Emulate deprecated/obsolete ARMv8 instructions"
169262306a36Sopenharmony_ci	depends on SYSCTL
169362306a36Sopenharmony_ci	help
169462306a36Sopenharmony_ci	  Legacy software support may require certain instructions
169562306a36Sopenharmony_ci	  that have been deprecated or obsoleted in the architecture.
169662306a36Sopenharmony_ci
169762306a36Sopenharmony_ci	  Enable this config to enable selective emulation of these
169862306a36Sopenharmony_ci	  features.
169962306a36Sopenharmony_ci
170062306a36Sopenharmony_ci	  If unsure, say Y
170162306a36Sopenharmony_ci
170262306a36Sopenharmony_ciif ARMV8_DEPRECATED
170362306a36Sopenharmony_ci
170462306a36Sopenharmony_ciconfig SWP_EMULATION
170562306a36Sopenharmony_ci	bool "Emulate SWP/SWPB instructions"
170662306a36Sopenharmony_ci	help
170762306a36Sopenharmony_ci	  ARMv8 obsoletes the use of A32 SWP/SWPB instructions such that
170862306a36Sopenharmony_ci	  they are always undefined. Say Y here to enable software
170962306a36Sopenharmony_ci	  emulation of these instructions for userspace using LDXR/STXR.
171062306a36Sopenharmony_ci	  This feature can be controlled at runtime with the abi.swp
171162306a36Sopenharmony_ci	  sysctl which is disabled by default.
171262306a36Sopenharmony_ci
171362306a36Sopenharmony_ci	  In some older versions of glibc [<=2.8] SWP is used during futex
171462306a36Sopenharmony_ci	  trylock() operations with the assumption that the code will not
171562306a36Sopenharmony_ci	  be preempted. This invalid assumption may be more likely to fail
171662306a36Sopenharmony_ci	  with SWP emulation enabled, leading to deadlock of the user
171762306a36Sopenharmony_ci	  application.
171862306a36Sopenharmony_ci
171962306a36Sopenharmony_ci	  NOTE: when accessing uncached shared regions, LDXR/STXR rely
172062306a36Sopenharmony_ci	  on an external transaction monitoring block called a global
172162306a36Sopenharmony_ci	  monitor to maintain update atomicity. If your system does not
172262306a36Sopenharmony_ci	  implement a global monitor, this option can cause programs that
172362306a36Sopenharmony_ci	  perform SWP operations to uncached memory to deadlock.
172462306a36Sopenharmony_ci
172562306a36Sopenharmony_ci	  If unsure, say Y
172662306a36Sopenharmony_ci
172762306a36Sopenharmony_ciconfig CP15_BARRIER_EMULATION
172862306a36Sopenharmony_ci	bool "Emulate CP15 Barrier instructions"
172962306a36Sopenharmony_ci	help
173062306a36Sopenharmony_ci	  The CP15 barrier instructions - CP15ISB, CP15DSB, and
173162306a36Sopenharmony_ci	  CP15DMB - are deprecated in ARMv8 (and ARMv7). It is
173262306a36Sopenharmony_ci	  strongly recommended to use the ISB, DSB, and DMB
173362306a36Sopenharmony_ci	  instructions instead.
173462306a36Sopenharmony_ci
173562306a36Sopenharmony_ci	  Say Y here to enable software emulation of these
173662306a36Sopenharmony_ci	  instructions for AArch32 userspace code. When this option is
173762306a36Sopenharmony_ci	  enabled, CP15 barrier usage is traced which can help
173862306a36Sopenharmony_ci	  identify software that needs updating. This feature can be
173962306a36Sopenharmony_ci	  controlled at runtime with the abi.cp15_barrier sysctl.
174062306a36Sopenharmony_ci
174162306a36Sopenharmony_ci	  If unsure, say Y
174262306a36Sopenharmony_ci
174362306a36Sopenharmony_ciconfig SETEND_EMULATION
174462306a36Sopenharmony_ci	bool "Emulate SETEND instruction"
174562306a36Sopenharmony_ci	help
174662306a36Sopenharmony_ci	  The SETEND instruction alters the data-endianness of the
174762306a36Sopenharmony_ci	  AArch32 EL0, and is deprecated in ARMv8.
174862306a36Sopenharmony_ci
174962306a36Sopenharmony_ci	  Say Y here to enable software emulation of the instruction
175062306a36Sopenharmony_ci	  for AArch32 userspace code. This feature can be controlled
175162306a36Sopenharmony_ci	  at runtime with the abi.setend sysctl.
175262306a36Sopenharmony_ci
175362306a36Sopenharmony_ci	  Note: All the cpus on the system must have mixed endian support at EL0
175462306a36Sopenharmony_ci	  for this feature to be enabled. If a new CPU - which doesn't support mixed
175562306a36Sopenharmony_ci	  endian - is hotplugged in after this feature has been enabled, there could
175662306a36Sopenharmony_ci	  be unexpected results in the applications.
175762306a36Sopenharmony_ci
175862306a36Sopenharmony_ci	  If unsure, say Y
175962306a36Sopenharmony_ciendif # ARMV8_DEPRECATED
176062306a36Sopenharmony_ci
176162306a36Sopenharmony_ciendif # COMPAT
176262306a36Sopenharmony_ci
176362306a36Sopenharmony_cimenu "ARMv8.1 architectural features"
176462306a36Sopenharmony_ci
176562306a36Sopenharmony_ciconfig ARM64_HW_AFDBM
176662306a36Sopenharmony_ci	bool "Support for hardware updates of the Access and Dirty page flags"
176762306a36Sopenharmony_ci	default y
176862306a36Sopenharmony_ci	help
176962306a36Sopenharmony_ci	  The ARMv8.1 architecture extensions introduce support for
177062306a36Sopenharmony_ci	  hardware updates of the access and dirty information in page
177162306a36Sopenharmony_ci	  table entries. When enabled in TCR_EL1 (HA and HD bits) on
177262306a36Sopenharmony_ci	  capable processors, accesses to pages with PTE_AF cleared will
177362306a36Sopenharmony_ci	  set this bit instead of raising an access flag fault.
177462306a36Sopenharmony_ci	  Similarly, writes to read-only pages with the DBM bit set will
177562306a36Sopenharmony_ci	  clear the read-only bit (AP[2]) instead of raising a
177662306a36Sopenharmony_ci	  permission fault.
177762306a36Sopenharmony_ci
177862306a36Sopenharmony_ci	  Kernels built with this configuration option enabled continue
177962306a36Sopenharmony_ci	  to work on pre-ARMv8.1 hardware and the performance impact is
178062306a36Sopenharmony_ci	  minimal. If unsure, say Y.
178162306a36Sopenharmony_ci
178262306a36Sopenharmony_ciconfig ARM64_PAN
178362306a36Sopenharmony_ci	bool "Enable support for Privileged Access Never (PAN)"
178462306a36Sopenharmony_ci	default y
178562306a36Sopenharmony_ci	help
178662306a36Sopenharmony_ci	  Privileged Access Never (PAN; part of the ARMv8.1 Extensions)
178762306a36Sopenharmony_ci	  prevents the kernel or hypervisor from accessing user-space (EL0)
178862306a36Sopenharmony_ci	  memory directly.
178962306a36Sopenharmony_ci
179062306a36Sopenharmony_ci	  Choosing this option will cause any unprotected (not using
179162306a36Sopenharmony_ci	  copy_to_user et al) memory access to fail with a permission fault.
179262306a36Sopenharmony_ci
179362306a36Sopenharmony_ci	  The feature is detected at runtime, and will remain as a 'nop'
179462306a36Sopenharmony_ci	  instruction if the cpu does not implement the feature.
179562306a36Sopenharmony_ci
179662306a36Sopenharmony_ciconfig AS_HAS_LSE_ATOMICS
179762306a36Sopenharmony_ci	def_bool $(as-instr,.arch_extension lse)
179862306a36Sopenharmony_ci
179962306a36Sopenharmony_ciconfig ARM64_LSE_ATOMICS
180062306a36Sopenharmony_ci	bool
180162306a36Sopenharmony_ci	default ARM64_USE_LSE_ATOMICS
180262306a36Sopenharmony_ci	depends on AS_HAS_LSE_ATOMICS
180362306a36Sopenharmony_ci
180462306a36Sopenharmony_ciconfig ARM64_USE_LSE_ATOMICS
180562306a36Sopenharmony_ci	bool "Atomic instructions"
180662306a36Sopenharmony_ci	default y
180762306a36Sopenharmony_ci	help
180862306a36Sopenharmony_ci	  As part of the Large System Extensions, ARMv8.1 introduces new
180962306a36Sopenharmony_ci	  atomic instructions that are designed specifically to scale in
181062306a36Sopenharmony_ci	  very large systems.
181162306a36Sopenharmony_ci
181262306a36Sopenharmony_ci	  Say Y here to make use of these instructions for the in-kernel
181362306a36Sopenharmony_ci	  atomic routines. This incurs a small overhead on CPUs that do
181462306a36Sopenharmony_ci	  not support these instructions and requires the kernel to be
181562306a36Sopenharmony_ci	  built with binutils >= 2.25 in order for the new instructions
181662306a36Sopenharmony_ci	  to be used.
181762306a36Sopenharmony_ci
181862306a36Sopenharmony_ciendmenu # "ARMv8.1 architectural features"
181962306a36Sopenharmony_ci
182062306a36Sopenharmony_cimenu "ARMv8.2 architectural features"
182162306a36Sopenharmony_ci
182262306a36Sopenharmony_ciconfig AS_HAS_ARMV8_2
182362306a36Sopenharmony_ci	def_bool $(cc-option,-Wa$(comma)-march=armv8.2-a)
182462306a36Sopenharmony_ci
182562306a36Sopenharmony_ciconfig AS_HAS_SHA3
182662306a36Sopenharmony_ci	def_bool $(as-instr,.arch armv8.2-a+sha3)
182762306a36Sopenharmony_ci
182862306a36Sopenharmony_ciconfig ARM64_PMEM
182962306a36Sopenharmony_ci	bool "Enable support for persistent memory"
183062306a36Sopenharmony_ci	select ARCH_HAS_PMEM_API
183162306a36Sopenharmony_ci	select ARCH_HAS_UACCESS_FLUSHCACHE
183262306a36Sopenharmony_ci	help
183362306a36Sopenharmony_ci	  Say Y to enable support for the persistent memory API based on the
183462306a36Sopenharmony_ci	  ARMv8.2 DCPoP feature.
183562306a36Sopenharmony_ci
183662306a36Sopenharmony_ci	  The feature is detected at runtime, and the kernel will use DC CVAC
183762306a36Sopenharmony_ci	  operations if DC CVAP is not supported (following the behaviour of
183862306a36Sopenharmony_ci	  DC CVAP itself if the system does not define a point of persistence).
183962306a36Sopenharmony_ci
184062306a36Sopenharmony_ciconfig ARM64_RAS_EXTN
184162306a36Sopenharmony_ci	bool "Enable support for RAS CPU Extensions"
184262306a36Sopenharmony_ci	default y
184362306a36Sopenharmony_ci	help
184462306a36Sopenharmony_ci	  CPUs that support the Reliability, Availability and Serviceability
184562306a36Sopenharmony_ci	  (RAS) Extensions, part of ARMv8.2 are able to track faults and
184662306a36Sopenharmony_ci	  errors, classify them and report them to software.
184762306a36Sopenharmony_ci
184862306a36Sopenharmony_ci	  On CPUs with these extensions system software can use additional
184962306a36Sopenharmony_ci	  barriers to determine if faults are pending and read the
185062306a36Sopenharmony_ci	  classification from a new set of registers.
185162306a36Sopenharmony_ci
185262306a36Sopenharmony_ci	  Selecting this feature will allow the kernel to use these barriers
185362306a36Sopenharmony_ci	  and access the new registers if the system supports the extension.
185462306a36Sopenharmony_ci	  Platform RAS features may additionally depend on firmware support.
185562306a36Sopenharmony_ci
185662306a36Sopenharmony_ciconfig ARM64_CNP
185762306a36Sopenharmony_ci	bool "Enable support for Common Not Private (CNP) translations"
185862306a36Sopenharmony_ci	default y
185962306a36Sopenharmony_ci	depends on ARM64_PAN || !ARM64_SW_TTBR0_PAN
186062306a36Sopenharmony_ci	help
186162306a36Sopenharmony_ci	  Common Not Private (CNP) allows translation table entries to
186262306a36Sopenharmony_ci	  be shared between different PEs in the same inner shareable
186362306a36Sopenharmony_ci	  domain, so the hardware can use this fact to optimise the
186462306a36Sopenharmony_ci	  caching of such entries in the TLB.
186562306a36Sopenharmony_ci
186662306a36Sopenharmony_ci	  Selecting this option allows the CNP feature to be detected
186762306a36Sopenharmony_ci	  at runtime, and does not affect PEs that do not implement
186862306a36Sopenharmony_ci	  this feature.
186962306a36Sopenharmony_ci
187062306a36Sopenharmony_ciendmenu # "ARMv8.2 architectural features"
187162306a36Sopenharmony_ci
187262306a36Sopenharmony_cimenu "ARMv8.3 architectural features"
187362306a36Sopenharmony_ci
187462306a36Sopenharmony_ciconfig ARM64_PTR_AUTH
187562306a36Sopenharmony_ci	bool "Enable support for pointer authentication"
187662306a36Sopenharmony_ci	default y
187762306a36Sopenharmony_ci	help
187862306a36Sopenharmony_ci	  Pointer authentication (part of the ARMv8.3 Extensions) provides
187962306a36Sopenharmony_ci	  instructions for signing and authenticating pointers against secret
188062306a36Sopenharmony_ci	  keys, which can be used to mitigate Return Oriented Programming (ROP)
188162306a36Sopenharmony_ci	  and other attacks.
188262306a36Sopenharmony_ci
188362306a36Sopenharmony_ci	  This option enables these instructions at EL0 (i.e. for userspace).
188462306a36Sopenharmony_ci	  Choosing this option will cause the kernel to initialise secret keys
188562306a36Sopenharmony_ci	  for each process at exec() time, with these keys being
188662306a36Sopenharmony_ci	  context-switched along with the process.
188762306a36Sopenharmony_ci
188862306a36Sopenharmony_ci	  The feature is detected at runtime. If the feature is not present in
188962306a36Sopenharmony_ci	  hardware it will not be advertised to userspace/KVM guest nor will it
189062306a36Sopenharmony_ci	  be enabled.
189162306a36Sopenharmony_ci
189262306a36Sopenharmony_ci	  If the feature is present on the boot CPU but not on a late CPU, then
189362306a36Sopenharmony_ci	  the late CPU will be parked. Also, if the boot CPU does not have
189462306a36Sopenharmony_ci	  address auth and the late CPU has then the late CPU will still boot
189562306a36Sopenharmony_ci	  but with the feature disabled. On such a system, this option should
189662306a36Sopenharmony_ci	  not be selected.
189762306a36Sopenharmony_ci
189862306a36Sopenharmony_ciconfig ARM64_PTR_AUTH_KERNEL
189962306a36Sopenharmony_ci	bool "Use pointer authentication for kernel"
190062306a36Sopenharmony_ci	default y
190162306a36Sopenharmony_ci	depends on ARM64_PTR_AUTH
190262306a36Sopenharmony_ci	depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_ARMV8_3
190362306a36Sopenharmony_ci	# Modern compilers insert a .note.gnu.property section note for PAC
190462306a36Sopenharmony_ci	# which is only understood by binutils starting with version 2.33.1.
190562306a36Sopenharmony_ci	depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
190662306a36Sopenharmony_ci	depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
190762306a36Sopenharmony_ci	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_ARGS)
190862306a36Sopenharmony_ci	help
190962306a36Sopenharmony_ci	  If the compiler supports the -mbranch-protection or
191062306a36Sopenharmony_ci	  -msign-return-address flag (e.g. GCC 7 or later), then this option
191162306a36Sopenharmony_ci	  will cause the kernel itself to be compiled with return address
191262306a36Sopenharmony_ci	  protection. In this case, and if the target hardware is known to
191362306a36Sopenharmony_ci	  support pointer authentication, then CONFIG_STACKPROTECTOR can be
191462306a36Sopenharmony_ci	  disabled with minimal loss of protection.
191562306a36Sopenharmony_ci
191662306a36Sopenharmony_ci	  This feature works with FUNCTION_GRAPH_TRACER option only if
191762306a36Sopenharmony_ci	  DYNAMIC_FTRACE_WITH_ARGS is enabled.
191862306a36Sopenharmony_ci
191962306a36Sopenharmony_ciconfig CC_HAS_BRANCH_PROT_PAC_RET
192062306a36Sopenharmony_ci	# GCC 9 or later, clang 8 or later
192162306a36Sopenharmony_ci	def_bool $(cc-option,-mbranch-protection=pac-ret+leaf)
192262306a36Sopenharmony_ci
192362306a36Sopenharmony_ciconfig CC_HAS_SIGN_RETURN_ADDRESS
192462306a36Sopenharmony_ci	# GCC 7, 8
192562306a36Sopenharmony_ci	def_bool $(cc-option,-msign-return-address=all)
192662306a36Sopenharmony_ci
192762306a36Sopenharmony_ciconfig AS_HAS_ARMV8_3
192862306a36Sopenharmony_ci	def_bool $(cc-option,-Wa$(comma)-march=armv8.3-a)
192962306a36Sopenharmony_ci
193062306a36Sopenharmony_ciconfig AS_HAS_CFI_NEGATE_RA_STATE
193162306a36Sopenharmony_ci	def_bool $(as-instr,.cfi_startproc\n.cfi_negate_ra_state\n.cfi_endproc\n)
193262306a36Sopenharmony_ci
193362306a36Sopenharmony_ciconfig AS_HAS_LDAPR
193462306a36Sopenharmony_ci	def_bool $(as-instr,.arch_extension rcpc)
193562306a36Sopenharmony_ci
193662306a36Sopenharmony_ciendmenu # "ARMv8.3 architectural features"
193762306a36Sopenharmony_ci
193862306a36Sopenharmony_cimenu "ARMv8.4 architectural features"
193962306a36Sopenharmony_ci
194062306a36Sopenharmony_ciconfig ARM64_AMU_EXTN
194162306a36Sopenharmony_ci	bool "Enable support for the Activity Monitors Unit CPU extension"
194262306a36Sopenharmony_ci	default y
194362306a36Sopenharmony_ci	help
194462306a36Sopenharmony_ci	  The activity monitors extension is an optional extension introduced
194562306a36Sopenharmony_ci	  by the ARMv8.4 CPU architecture. This enables support for version 1
194662306a36Sopenharmony_ci	  of the activity monitors architecture, AMUv1.
194762306a36Sopenharmony_ci
194862306a36Sopenharmony_ci	  To enable the use of this extension on CPUs that implement it, say Y.
194962306a36Sopenharmony_ci
195062306a36Sopenharmony_ci	  Note that for architectural reasons, firmware _must_ implement AMU
195162306a36Sopenharmony_ci	  support when running on CPUs that present the activity monitors
195262306a36Sopenharmony_ci	  extension. The required support is present in:
195362306a36Sopenharmony_ci	    * Version 1.5 and later of the ARM Trusted Firmware
195462306a36Sopenharmony_ci
195562306a36Sopenharmony_ci	  For kernels that have this configuration enabled but boot with broken
195662306a36Sopenharmony_ci	  firmware, you may need to say N here until the firmware is fixed.
195762306a36Sopenharmony_ci	  Otherwise you may experience firmware panics or lockups when
195862306a36Sopenharmony_ci	  accessing the counter registers. Even if you are not observing these
195962306a36Sopenharmony_ci	  symptoms, the values returned by the register reads might not
196062306a36Sopenharmony_ci	  correctly reflect reality. Most commonly, the value read will be 0,
196162306a36Sopenharmony_ci	  indicating that the counter is not enabled.
196262306a36Sopenharmony_ci
196362306a36Sopenharmony_ciconfig AS_HAS_ARMV8_4
196462306a36Sopenharmony_ci	def_bool $(cc-option,-Wa$(comma)-march=armv8.4-a)
196562306a36Sopenharmony_ci
196662306a36Sopenharmony_ciconfig ARM64_TLB_RANGE
196762306a36Sopenharmony_ci	bool "Enable support for tlbi range feature"
196862306a36Sopenharmony_ci	default y
196962306a36Sopenharmony_ci	depends on AS_HAS_ARMV8_4
197062306a36Sopenharmony_ci	help
197162306a36Sopenharmony_ci	  ARMv8.4-TLBI provides TLBI invalidation instruction that apply to a
197262306a36Sopenharmony_ci	  range of input addresses.
197362306a36Sopenharmony_ci
197462306a36Sopenharmony_ci	  The feature introduces new assembly instructions, and they were
197562306a36Sopenharmony_ci	  support when binutils >= 2.30.
197662306a36Sopenharmony_ci
197762306a36Sopenharmony_ciendmenu # "ARMv8.4 architectural features"
197862306a36Sopenharmony_ci
197962306a36Sopenharmony_cimenu "ARMv8.5 architectural features"
198062306a36Sopenharmony_ci
198162306a36Sopenharmony_ciconfig AS_HAS_ARMV8_5
198262306a36Sopenharmony_ci	def_bool $(cc-option,-Wa$(comma)-march=armv8.5-a)
198362306a36Sopenharmony_ci
198462306a36Sopenharmony_ciconfig ARM64_BTI
198562306a36Sopenharmony_ci	bool "Branch Target Identification support"
198662306a36Sopenharmony_ci	default y
198762306a36Sopenharmony_ci	help
198862306a36Sopenharmony_ci	  Branch Target Identification (part of the ARMv8.5 Extensions)
198962306a36Sopenharmony_ci	  provides a mechanism to limit the set of locations to which computed
199062306a36Sopenharmony_ci	  branch instructions such as BR or BLR can jump.
199162306a36Sopenharmony_ci
199262306a36Sopenharmony_ci	  To make use of BTI on CPUs that support it, say Y.
199362306a36Sopenharmony_ci
199462306a36Sopenharmony_ci	  BTI is intended to provide complementary protection to other control
199562306a36Sopenharmony_ci	  flow integrity protection mechanisms, such as the Pointer
199662306a36Sopenharmony_ci	  authentication mechanism provided as part of the ARMv8.3 Extensions.
199762306a36Sopenharmony_ci	  For this reason, it does not make sense to enable this option without
199862306a36Sopenharmony_ci	  also enabling support for pointer authentication.  Thus, when
199962306a36Sopenharmony_ci	  enabling this option you should also select ARM64_PTR_AUTH=y.
200062306a36Sopenharmony_ci
200162306a36Sopenharmony_ci	  Userspace binaries must also be specifically compiled to make use of
200262306a36Sopenharmony_ci	  this mechanism.  If you say N here or the hardware does not support
200362306a36Sopenharmony_ci	  BTI, such binaries can still run, but you get no additional
200462306a36Sopenharmony_ci	  enforcement of branch destinations.
200562306a36Sopenharmony_ci
200662306a36Sopenharmony_ciconfig ARM64_BTI_KERNEL
200762306a36Sopenharmony_ci	bool "Use Branch Target Identification for kernel"
200862306a36Sopenharmony_ci	default y
200962306a36Sopenharmony_ci	depends on ARM64_BTI
201062306a36Sopenharmony_ci	depends on ARM64_PTR_AUTH_KERNEL
201162306a36Sopenharmony_ci	depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
201262306a36Sopenharmony_ci	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697
201362306a36Sopenharmony_ci	depends on !CC_IS_GCC || GCC_VERSION >= 100100
201462306a36Sopenharmony_ci	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671
201562306a36Sopenharmony_ci	depends on !CC_IS_GCC
201662306a36Sopenharmony_ci	# https://github.com/llvm/llvm-project/commit/a88c722e687e6780dcd6a58718350dc76fcc4cc9
201762306a36Sopenharmony_ci	depends on !CC_IS_CLANG || CLANG_VERSION >= 120000
201862306a36Sopenharmony_ci	depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_ARGS)
201962306a36Sopenharmony_ci	help
202062306a36Sopenharmony_ci	  Build the kernel with Branch Target Identification annotations
202162306a36Sopenharmony_ci	  and enable enforcement of this for kernel code. When this option
202262306a36Sopenharmony_ci	  is enabled and the system supports BTI all kernel code including
202362306a36Sopenharmony_ci	  modular code must have BTI enabled.
202462306a36Sopenharmony_ci
202562306a36Sopenharmony_ciconfig CC_HAS_BRANCH_PROT_PAC_RET_BTI
202662306a36Sopenharmony_ci	# GCC 9 or later, clang 8 or later
202762306a36Sopenharmony_ci	def_bool $(cc-option,-mbranch-protection=pac-ret+leaf+bti)
202862306a36Sopenharmony_ci
202962306a36Sopenharmony_ciconfig ARM64_E0PD
203062306a36Sopenharmony_ci	bool "Enable support for E0PD"
203162306a36Sopenharmony_ci	default y
203262306a36Sopenharmony_ci	help
203362306a36Sopenharmony_ci	  E0PD (part of the ARMv8.5 extensions) allows us to ensure
203462306a36Sopenharmony_ci	  that EL0 accesses made via TTBR1 always fault in constant time,
203562306a36Sopenharmony_ci	  providing similar benefits to KASLR as those provided by KPTI, but
203662306a36Sopenharmony_ci	  with lower overhead and without disrupting legitimate access to
203762306a36Sopenharmony_ci	  kernel memory such as SPE.
203862306a36Sopenharmony_ci
203962306a36Sopenharmony_ci	  This option enables E0PD for TTBR1 where available.
204062306a36Sopenharmony_ci
204162306a36Sopenharmony_ciconfig ARM64_AS_HAS_MTE
204262306a36Sopenharmony_ci	# Initial support for MTE went in binutils 2.32.0, checked with
204362306a36Sopenharmony_ci	# ".arch armv8.5-a+memtag" below. However, this was incomplete
204462306a36Sopenharmony_ci	# as a late addition to the final architecture spec (LDGM/STGM)
204562306a36Sopenharmony_ci	# is only supported in the newer 2.32.x and 2.33 binutils
204662306a36Sopenharmony_ci	# versions, hence the extra "stgm" instruction check below.
204762306a36Sopenharmony_ci	def_bool $(as-instr,.arch armv8.5-a+memtag\nstgm xzr$(comma)[x0])
204862306a36Sopenharmony_ci
204962306a36Sopenharmony_ciconfig ARM64_MTE
205062306a36Sopenharmony_ci	bool "Memory Tagging Extension support"
205162306a36Sopenharmony_ci	default y
205262306a36Sopenharmony_ci	depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI
205362306a36Sopenharmony_ci	depends on AS_HAS_ARMV8_5
205462306a36Sopenharmony_ci	depends on AS_HAS_LSE_ATOMICS
205562306a36Sopenharmony_ci	# Required for tag checking in the uaccess routines
205662306a36Sopenharmony_ci	depends on ARM64_PAN
205762306a36Sopenharmony_ci	select ARCH_HAS_SUBPAGE_FAULTS
205862306a36Sopenharmony_ci	select ARCH_USES_HIGH_VMA_FLAGS
205962306a36Sopenharmony_ci	select ARCH_USES_PG_ARCH_X
206062306a36Sopenharmony_ci	help
206162306a36Sopenharmony_ci	  Memory Tagging (part of the ARMv8.5 Extensions) provides
206262306a36Sopenharmony_ci	  architectural support for run-time, always-on detection of
206362306a36Sopenharmony_ci	  various classes of memory error to aid with software debugging
206462306a36Sopenharmony_ci	  to eliminate vulnerabilities arising from memory-unsafe
206562306a36Sopenharmony_ci	  languages.
206662306a36Sopenharmony_ci
206762306a36Sopenharmony_ci	  This option enables the support for the Memory Tagging
206862306a36Sopenharmony_ci	  Extension at EL0 (i.e. for userspace).
206962306a36Sopenharmony_ci
207062306a36Sopenharmony_ci	  Selecting this option allows the feature to be detected at
207162306a36Sopenharmony_ci	  runtime. Any secondary CPU not implementing this feature will
207262306a36Sopenharmony_ci	  not be allowed a late bring-up.
207362306a36Sopenharmony_ci
207462306a36Sopenharmony_ci	  Userspace binaries that want to use this feature must
207562306a36Sopenharmony_ci	  explicitly opt in. The mechanism for the userspace is
207662306a36Sopenharmony_ci	  described in:
207762306a36Sopenharmony_ci
207862306a36Sopenharmony_ci	  Documentation/arch/arm64/memory-tagging-extension.rst.
207962306a36Sopenharmony_ci
208062306a36Sopenharmony_ciendmenu # "ARMv8.5 architectural features"
208162306a36Sopenharmony_ci
208262306a36Sopenharmony_cimenu "ARMv8.7 architectural features"
208362306a36Sopenharmony_ci
208462306a36Sopenharmony_ciconfig ARM64_EPAN
208562306a36Sopenharmony_ci	bool "Enable support for Enhanced Privileged Access Never (EPAN)"
208662306a36Sopenharmony_ci	default y
208762306a36Sopenharmony_ci	depends on ARM64_PAN
208862306a36Sopenharmony_ci	help
208962306a36Sopenharmony_ci	  Enhanced Privileged Access Never (EPAN) allows Privileged
209062306a36Sopenharmony_ci	  Access Never to be used with Execute-only mappings.
209162306a36Sopenharmony_ci
209262306a36Sopenharmony_ci	  The feature is detected at runtime, and will remain disabled
209362306a36Sopenharmony_ci	  if the cpu does not implement the feature.
209462306a36Sopenharmony_ciendmenu # "ARMv8.7 architectural features"
209562306a36Sopenharmony_ci
209662306a36Sopenharmony_ciconfig ARM64_SVE
209762306a36Sopenharmony_ci	bool "ARM Scalable Vector Extension support"
209862306a36Sopenharmony_ci	default y
209962306a36Sopenharmony_ci	help
210062306a36Sopenharmony_ci	  The Scalable Vector Extension (SVE) is an extension to the AArch64
210162306a36Sopenharmony_ci	  execution state which complements and extends the SIMD functionality
210262306a36Sopenharmony_ci	  of the base architecture to support much larger vectors and to enable
210362306a36Sopenharmony_ci	  additional vectorisation opportunities.
210462306a36Sopenharmony_ci
210562306a36Sopenharmony_ci	  To enable use of this extension on CPUs that implement it, say Y.
210662306a36Sopenharmony_ci
210762306a36Sopenharmony_ci	  On CPUs that support the SVE2 extensions, this option will enable
210862306a36Sopenharmony_ci	  those too.
210962306a36Sopenharmony_ci
211062306a36Sopenharmony_ci	  Note that for architectural reasons, firmware _must_ implement SVE
211162306a36Sopenharmony_ci	  support when running on SVE capable hardware.  The required support
211262306a36Sopenharmony_ci	  is present in:
211362306a36Sopenharmony_ci
211462306a36Sopenharmony_ci	    * version 1.5 and later of the ARM Trusted Firmware
211562306a36Sopenharmony_ci	    * the AArch64 boot wrapper since commit 5e1261e08abf
211662306a36Sopenharmony_ci	      ("bootwrapper: SVE: Enable SVE for EL2 and below").
211762306a36Sopenharmony_ci
211862306a36Sopenharmony_ci	  For other firmware implementations, consult the firmware documentation
211962306a36Sopenharmony_ci	  or vendor.
212062306a36Sopenharmony_ci
212162306a36Sopenharmony_ci	  If you need the kernel to boot on SVE-capable hardware with broken
212262306a36Sopenharmony_ci	  firmware, you may need to say N here until you get your firmware
212362306a36Sopenharmony_ci	  fixed.  Otherwise, you may experience firmware panics or lockups when
212462306a36Sopenharmony_ci	  booting the kernel.  If unsure and you are not observing these
212562306a36Sopenharmony_ci	  symptoms, you should assume that it is safe to say Y.
212662306a36Sopenharmony_ci
212762306a36Sopenharmony_ciconfig ARM64_SME
212862306a36Sopenharmony_ci	bool "ARM Scalable Matrix Extension support"
212962306a36Sopenharmony_ci	default y
213062306a36Sopenharmony_ci	depends on ARM64_SVE
213162306a36Sopenharmony_ci	help
213262306a36Sopenharmony_ci	  The Scalable Matrix Extension (SME) is an extension to the AArch64
213362306a36Sopenharmony_ci	  execution state which utilises a substantial subset of the SVE
213462306a36Sopenharmony_ci	  instruction set, together with the addition of new architectural
213562306a36Sopenharmony_ci	  register state capable of holding two dimensional matrix tiles to
213662306a36Sopenharmony_ci	  enable various matrix operations.
213762306a36Sopenharmony_ci
213862306a36Sopenharmony_ciconfig ARM64_PSEUDO_NMI
213962306a36Sopenharmony_ci	bool "Support for NMI-like interrupts"
214062306a36Sopenharmony_ci	select ARM_GIC_V3
214162306a36Sopenharmony_ci	help
214262306a36Sopenharmony_ci	  Adds support for mimicking Non-Maskable Interrupts through the use of
214362306a36Sopenharmony_ci	  GIC interrupt priority. This support requires version 3 or later of
214462306a36Sopenharmony_ci	  ARM GIC.
214562306a36Sopenharmony_ci
214662306a36Sopenharmony_ci	  This high priority configuration for interrupts needs to be
214762306a36Sopenharmony_ci	  explicitly enabled by setting the kernel parameter
214862306a36Sopenharmony_ci	  "irqchip.gicv3_pseudo_nmi" to 1.
214962306a36Sopenharmony_ci
215062306a36Sopenharmony_ci	  If unsure, say N
215162306a36Sopenharmony_ci
215262306a36Sopenharmony_ciif ARM64_PSEUDO_NMI
215362306a36Sopenharmony_ciconfig ARM64_DEBUG_PRIORITY_MASKING
215462306a36Sopenharmony_ci	bool "Debug interrupt priority masking"
215562306a36Sopenharmony_ci	help
215662306a36Sopenharmony_ci	  This adds runtime checks to functions enabling/disabling
215762306a36Sopenharmony_ci	  interrupts when using priority masking. The additional checks verify
215862306a36Sopenharmony_ci	  the validity of ICC_PMR_EL1 when calling concerned functions.
215962306a36Sopenharmony_ci
216062306a36Sopenharmony_ci	  If unsure, say N
216162306a36Sopenharmony_ciendif # ARM64_PSEUDO_NMI
216262306a36Sopenharmony_ci
216362306a36Sopenharmony_ciconfig RELOCATABLE
216462306a36Sopenharmony_ci	bool "Build a relocatable kernel image" if EXPERT
216562306a36Sopenharmony_ci	select ARCH_HAS_RELR
216662306a36Sopenharmony_ci	default y
216762306a36Sopenharmony_ci	help
216862306a36Sopenharmony_ci	  This builds the kernel as a Position Independent Executable (PIE),
216962306a36Sopenharmony_ci	  which retains all relocation metadata required to relocate the
217062306a36Sopenharmony_ci	  kernel binary at runtime to a different virtual address than the
217162306a36Sopenharmony_ci	  address it was linked at.
217262306a36Sopenharmony_ci	  Since AArch64 uses the RELA relocation format, this requires a
217362306a36Sopenharmony_ci	  relocation pass at runtime even if the kernel is loaded at the
217462306a36Sopenharmony_ci	  same address it was linked at.
217562306a36Sopenharmony_ci
217662306a36Sopenharmony_ciconfig RANDOMIZE_BASE
217762306a36Sopenharmony_ci	bool "Randomize the address of the kernel image"
217862306a36Sopenharmony_ci	select RELOCATABLE
217962306a36Sopenharmony_ci	help
218062306a36Sopenharmony_ci	  Randomizes the virtual address at which the kernel image is
218162306a36Sopenharmony_ci	  loaded, as a security feature that deters exploit attempts
218262306a36Sopenharmony_ci	  relying on knowledge of the location of kernel internals.
218362306a36Sopenharmony_ci
218462306a36Sopenharmony_ci	  It is the bootloader's job to provide entropy, by passing a
218562306a36Sopenharmony_ci	  random u64 value in /chosen/kaslr-seed at kernel entry.
218662306a36Sopenharmony_ci
218762306a36Sopenharmony_ci	  When booting via the UEFI stub, it will invoke the firmware's
218862306a36Sopenharmony_ci	  EFI_RNG_PROTOCOL implementation (if available) to supply entropy
218962306a36Sopenharmony_ci	  to the kernel proper. In addition, it will randomise the physical
219062306a36Sopenharmony_ci	  location of the kernel Image as well.
219162306a36Sopenharmony_ci
219262306a36Sopenharmony_ci	  If unsure, say N.
219362306a36Sopenharmony_ci
219462306a36Sopenharmony_ciconfig RANDOMIZE_MODULE_REGION_FULL
219562306a36Sopenharmony_ci	bool "Randomize the module region over a 2 GB range"
219662306a36Sopenharmony_ci	depends on RANDOMIZE_BASE
219762306a36Sopenharmony_ci	default y
219862306a36Sopenharmony_ci	help
219962306a36Sopenharmony_ci	  Randomizes the location of the module region inside a 2 GB window
220062306a36Sopenharmony_ci	  covering the core kernel. This way, it is less likely for modules
220162306a36Sopenharmony_ci	  to leak information about the location of core kernel data structures
220262306a36Sopenharmony_ci	  but it does imply that function calls between modules and the core
220362306a36Sopenharmony_ci	  kernel will need to be resolved via veneers in the module PLT.
220462306a36Sopenharmony_ci
220562306a36Sopenharmony_ci	  When this option is not set, the module region will be randomized over
220662306a36Sopenharmony_ci	  a limited range that contains the [_stext, _etext] interval of the
220762306a36Sopenharmony_ci	  core kernel, so branch relocations are almost always in range unless
220862306a36Sopenharmony_ci	  the region is exhausted. In this particular case of region
220962306a36Sopenharmony_ci	  exhaustion, modules might be able to fall back to a larger 2GB area.
221062306a36Sopenharmony_ci
221162306a36Sopenharmony_ciconfig CC_HAVE_STACKPROTECTOR_SYSREG
221262306a36Sopenharmony_ci	def_bool $(cc-option,-mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0)
221362306a36Sopenharmony_ci
221462306a36Sopenharmony_ciconfig STACKPROTECTOR_PER_TASK
221562306a36Sopenharmony_ci	def_bool y
221662306a36Sopenharmony_ci	depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_SYSREG
221762306a36Sopenharmony_ci
221862306a36Sopenharmony_ciconfig UNWIND_PATCH_PAC_INTO_SCS
221962306a36Sopenharmony_ci	bool "Enable shadow call stack dynamically using code patching"
222062306a36Sopenharmony_ci	# needs Clang with https://reviews.llvm.org/D111780 incorporated
222162306a36Sopenharmony_ci	depends on CC_IS_CLANG && CLANG_VERSION >= 150000
222262306a36Sopenharmony_ci	depends on ARM64_PTR_AUTH_KERNEL && CC_HAS_BRANCH_PROT_PAC_RET
222362306a36Sopenharmony_ci	depends on SHADOW_CALL_STACK
222462306a36Sopenharmony_ci	select UNWIND_TABLES
222562306a36Sopenharmony_ci	select DYNAMIC_SCS
222662306a36Sopenharmony_ci
222762306a36Sopenharmony_ciendmenu # "Kernel Features"
222862306a36Sopenharmony_ci
222962306a36Sopenharmony_cimenu "Boot options"
223062306a36Sopenharmony_ci
223162306a36Sopenharmony_ciconfig ARM64_ACPI_PARKING_PROTOCOL
223262306a36Sopenharmony_ci	bool "Enable support for the ARM64 ACPI parking protocol"
223362306a36Sopenharmony_ci	depends on ACPI
223462306a36Sopenharmony_ci	help
223562306a36Sopenharmony_ci	  Enable support for the ARM64 ACPI parking protocol. If disabled
223662306a36Sopenharmony_ci	  the kernel will not allow booting through the ARM64 ACPI parking
223762306a36Sopenharmony_ci	  protocol even if the corresponding data is present in the ACPI
223862306a36Sopenharmony_ci	  MADT table.
223962306a36Sopenharmony_ci
224062306a36Sopenharmony_ciconfig CMDLINE
224162306a36Sopenharmony_ci	string "Default kernel command string"
224262306a36Sopenharmony_ci	default ""
224362306a36Sopenharmony_ci	help
224462306a36Sopenharmony_ci	  Provide a set of default command-line options at build time by
224562306a36Sopenharmony_ci	  entering them here. As a minimum, you should specify the the
224662306a36Sopenharmony_ci	  root device (e.g. root=/dev/nfs).
224762306a36Sopenharmony_ci
224862306a36Sopenharmony_cichoice
224962306a36Sopenharmony_ci	prompt "Kernel command line type" if CMDLINE != ""
225062306a36Sopenharmony_ci	default CMDLINE_FROM_BOOTLOADER
225162306a36Sopenharmony_ci	help
225262306a36Sopenharmony_ci	  Choose how the kernel will handle the provided default kernel
225362306a36Sopenharmony_ci	  command line string.
225462306a36Sopenharmony_ci
225562306a36Sopenharmony_ciconfig CMDLINE_FROM_BOOTLOADER
225662306a36Sopenharmony_ci	bool "Use bootloader kernel arguments if available"
225762306a36Sopenharmony_ci	help
225862306a36Sopenharmony_ci	  Uses the command-line options passed by the boot loader. If
225962306a36Sopenharmony_ci	  the boot loader doesn't provide any, the default kernel command
226062306a36Sopenharmony_ci	  string provided in CMDLINE will be used.
226162306a36Sopenharmony_ci
226262306a36Sopenharmony_ciconfig CMDLINE_FORCE
226362306a36Sopenharmony_ci	bool "Always use the default kernel command string"
226462306a36Sopenharmony_ci	help
226562306a36Sopenharmony_ci	  Always use the default kernel command string, even if the boot
226662306a36Sopenharmony_ci	  loader passes other arguments to the kernel.
226762306a36Sopenharmony_ci	  This is useful if you cannot or don't want to change the
226862306a36Sopenharmony_ci	  command-line options your boot loader passes to the kernel.
226962306a36Sopenharmony_ci
227062306a36Sopenharmony_ciendchoice
227162306a36Sopenharmony_ci
227262306a36Sopenharmony_ciconfig EFI_STUB
227362306a36Sopenharmony_ci	bool
227462306a36Sopenharmony_ci
227562306a36Sopenharmony_ciconfig EFI
227662306a36Sopenharmony_ci	bool "UEFI runtime support"
227762306a36Sopenharmony_ci	depends on OF && !CPU_BIG_ENDIAN
227862306a36Sopenharmony_ci	depends on KERNEL_MODE_NEON
227962306a36Sopenharmony_ci	select ARCH_SUPPORTS_ACPI
228062306a36Sopenharmony_ci	select LIBFDT
228162306a36Sopenharmony_ci	select UCS2_STRING
228262306a36Sopenharmony_ci	select EFI_PARAMS_FROM_FDT
228362306a36Sopenharmony_ci	select EFI_RUNTIME_WRAPPERS
228462306a36Sopenharmony_ci	select EFI_STUB
228562306a36Sopenharmony_ci	select EFI_GENERIC_STUB
228662306a36Sopenharmony_ci	imply IMA_SECURE_AND_OR_TRUSTED_BOOT
228762306a36Sopenharmony_ci	default y
228862306a36Sopenharmony_ci	help
228962306a36Sopenharmony_ci	  This option provides support for runtime services provided
229062306a36Sopenharmony_ci	  by UEFI firmware (such as non-volatile variables, realtime
229162306a36Sopenharmony_ci	  clock, and platform reset). A UEFI stub is also provided to
229262306a36Sopenharmony_ci	  allow the kernel to be booted as an EFI application. This
229362306a36Sopenharmony_ci	  is only useful on systems that have UEFI firmware.
229462306a36Sopenharmony_ci
229562306a36Sopenharmony_ciconfig DMI
229662306a36Sopenharmony_ci	bool "Enable support for SMBIOS (DMI) tables"
229762306a36Sopenharmony_ci	depends on EFI
229862306a36Sopenharmony_ci	default y
229962306a36Sopenharmony_ci	help
230062306a36Sopenharmony_ci	  This enables SMBIOS/DMI feature for systems.
230162306a36Sopenharmony_ci
230262306a36Sopenharmony_ci	  This option is only useful on systems that have UEFI firmware.
230362306a36Sopenharmony_ci	  However, even with this option, the resultant kernel should
230462306a36Sopenharmony_ci	  continue to boot on existing non-UEFI platforms.
230562306a36Sopenharmony_ci
230662306a36Sopenharmony_ciendmenu # "Boot options"
230762306a36Sopenharmony_ci
230862306a36Sopenharmony_cimenu "Power management options"
230962306a36Sopenharmony_ci
231062306a36Sopenharmony_cisource "kernel/power/Kconfig"
231162306a36Sopenharmony_ci
231262306a36Sopenharmony_ciconfig ARCH_HIBERNATION_POSSIBLE
231362306a36Sopenharmony_ci	def_bool y
231462306a36Sopenharmony_ci	depends on CPU_PM
231562306a36Sopenharmony_ci
231662306a36Sopenharmony_ciconfig ARCH_HIBERNATION_HEADER
231762306a36Sopenharmony_ci	def_bool y
231862306a36Sopenharmony_ci	depends on HIBERNATION
231962306a36Sopenharmony_ci
232062306a36Sopenharmony_ciconfig ARCH_SUSPEND_POSSIBLE
232162306a36Sopenharmony_ci	def_bool y
232262306a36Sopenharmony_ci
232362306a36Sopenharmony_ciendmenu # "Power management options"
232462306a36Sopenharmony_ci
232562306a36Sopenharmony_cimenu "CPU Power Management"
232662306a36Sopenharmony_ci
232762306a36Sopenharmony_cisource "drivers/cpuidle/Kconfig"
232862306a36Sopenharmony_ci
232962306a36Sopenharmony_cisource "drivers/cpufreq/Kconfig"
233062306a36Sopenharmony_ci
233162306a36Sopenharmony_ciendmenu # "CPU Power Management"
233262306a36Sopenharmony_ci
233362306a36Sopenharmony_cisource "drivers/acpi/Kconfig"
233462306a36Sopenharmony_ci
233562306a36Sopenharmony_cisource "arch/arm64/kvm/Kconfig"
233662306a36Sopenharmony_ci
2337