1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 2 3 #ifndef __ASM_CPUCAPS_H 4 #define __ASM_CPUCAPS_H 5 6 #include <asm/cpucap-defs.h> 7 8 #ifndef __ASSEMBLY__ 9 #include <linux/types.h> 10 /* 11 * Check whether a cpucap is possible at compi 12 */ 13 static __always_inline bool 14 cpucap_is_possible(const unsigned int cap) 15 { 16 compiletime_assert(__builtin_constant_ 17 "cap must be a cons 18 compiletime_assert(cap < ARM64_NCAPS, 19 "cap must be < ARM6 20 21 switch (cap) { 22 case ARM64_HAS_PAN: 23 return IS_ENABLED(CONFIG_ARM64 24 case ARM64_HAS_EPAN: 25 return IS_ENABLED(CONFIG_ARM64 26 case ARM64_SVE: 27 return IS_ENABLED(CONFIG_ARM64 28 case ARM64_SME: 29 case ARM64_SME2: 30 case ARM64_SME_FA64: 31 return IS_ENABLED(CONFIG_ARM64 32 case ARM64_HAS_CNP: 33 return IS_ENABLED(CONFIG_ARM64 34 case ARM64_HAS_ADDRESS_AUTH: 35 case ARM64_HAS_GENERIC_AUTH: 36 return IS_ENABLED(CONFIG_ARM64 37 case ARM64_HAS_GIC_PRIO_MASKING: 38 return IS_ENABLED(CONFIG_ARM64 39 case ARM64_MTE: 40 return IS_ENABLED(CONFIG_ARM64 41 case ARM64_BTI: 42 return IS_ENABLED(CONFIG_ARM64 43 case ARM64_HAS_TLB_RANGE: 44 return IS_ENABLED(CONFIG_ARM64 45 case ARM64_UNMAP_KERNEL_AT_EL0: 46 return IS_ENABLED(CONFIG_UNMAP 47 case ARM64_WORKAROUND_843419: 48 return IS_ENABLED(CONFIG_ARM64 49 case ARM64_WORKAROUND_1742098: 50 return IS_ENABLED(CONFIG_ARM64 51 case ARM64_WORKAROUND_2645198: 52 return IS_ENABLED(CONFIG_ARM64 53 case ARM64_WORKAROUND_2658417: 54 return IS_ENABLED(CONFIG_ARM64 55 case ARM64_WORKAROUND_CAVIUM_23154: 56 return IS_ENABLED(CONFIG_CAVIU 57 case ARM64_WORKAROUND_NVIDIA_CARMEL_CN 58 return IS_ENABLED(CONFIG_NVIDI 59 case ARM64_WORKAROUND_REPEAT_TLBI: 60 return IS_ENABLED(CONFIG_ARM64 61 case ARM64_WORKAROUND_SPECULATIVE_SSBS 62 return IS_ENABLED(CONFIG_ARM64 63 } 64 65 return true; 66 } 67 #endif /* __ASSEMBLY__ */ 68 69 #endif /* __ASM_CPUCAPS_H */ 70
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.