arch_features.mk 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. #
  2. # Copyright (c) 2022-2023, Arm Limited. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. # This file lists all of the architectural features, and initializes
  7. # and enables them based on the configured architecture version.
  8. # This file follows the following format:
  9. # - By default disable any mandatory features.
  10. # - Then Enable mandatory feature if applicable to an Arch Version.
  11. # - Disable or enable any optional feature this would be enabled/disabled if needed by platform.
  12. #
  13. ################################################################################
  14. # Set mandatory features by default to zero.
  15. ################################################################################
  16. #
  17. #----
  18. # 8.1
  19. #----
  20. # Flag to enable access to Privileged Access Never bit of PSTATE.
  21. ENABLE_FEAT_PAN := 0
  22. # Flag to enable Virtualization Host Extensions.
  23. ENABLE_FEAT_VHE := 0
  24. #----
  25. # 8.2
  26. #----
  27. # Enable RAS Support.
  28. ENABLE_FEAT_RAS := 0
  29. #----
  30. # 8.3
  31. #----
  32. # Flag to enable Pointer Authentication. Internal flag not meant for
  33. # direct setting. Use BRANCH_PROTECTION to enable PAUTH.
  34. ENABLE_PAUTH := 0
  35. # Include pointer authentication (ARMv8.3-PAuth) registers in cpu context. This
  36. # must be set to 1 if the platform wants to use this feature in the Secure
  37. # world. It is not necessary for use in the Non-secure world.
  38. CTX_INCLUDE_PAUTH_REGS := 0
  39. #----
  40. # 8.4
  41. #----
  42. # Flag to enable Secure EL-2 feature.
  43. ENABLE_FEAT_SEL2 := 0
  44. # By default, disable trace filter control register access to lower non-secure
  45. # exception levels, i.e. NS-EL2, or NS-EL1 if NS-EL2 is implemented, but
  46. # trace filter control register access is unused if FEAT_TRF is implemented.
  47. ENABLE_TRF_FOR_NS := 0
  48. # Flag to enable Data Independent Timing instructions.
  49. ENABLE_FEAT_DIT := 0
  50. #----
  51. # 8.5
  52. #----
  53. # Flag to enable access to the Random Number Generator registers.
  54. ENABLE_FEAT_RNG := 0
  55. # Flag to enable Speculation Barrier Instruction.
  56. ENABLE_FEAT_SB := 0
  57. # Flag to enable Branch Target Identification.
  58. # Internal flag not meant for direct setting.
  59. # Use BRANCH_PROTECTION to enable BTI.
  60. ENABLE_BTI := 0
  61. #----
  62. # 8.6
  63. #----
  64. # Flag to enable access to the CNTPOFF_EL2 register.
  65. ENABLE_FEAT_ECV := 0
  66. # Flag to enable access to the HDFGRTR_EL2 register.
  67. ENABLE_FEAT_FGT := 0
  68. #----
  69. # 8.7
  70. #----
  71. # Flag to enable access to the HCRX_EL2 register by setting SCR_EL3.HXEn.
  72. ENABLE_FEAT_HCX := 0
  73. #----
  74. # 8.9
  75. #----
  76. # Flag to enable access to TCR2 (FEAT_TCR2).
  77. ENABLE_FEAT_TCR2 := 0
  78. #
  79. ################################################################################
  80. # Enable Mandatory features based on Arch versions.
  81. ################################################################################
  82. #
  83. # Enable the features which are mandatory from ARCH version 8.1 and upwards.
  84. ifeq "8.1" "$(word 1, $(sort 8.1 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
  85. ENABLE_FEAT_PAN := 1
  86. ENABLE_FEAT_VHE := 1
  87. endif
  88. # Enable the features which are mandatory from ARCH version 8.2 and upwards.
  89. ifeq "8.2" "$(word 1, $(sort 8.2 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
  90. ENABLE_FEAT_RAS := 1
  91. endif
  92. # Enable the features which are mandatory from ARCH version 8.4 and upwards.
  93. ifeq "8.4" "$(word 1, $(sort 8.4 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
  94. ENABLE_FEAT_SEL2 := 1
  95. ENABLE_TRF_FOR_NS := 1
  96. ENABLE_FEAT_DIT := 1
  97. endif
  98. # Enable the features which are mandatory from ARCH version 8.5 and upwards.
  99. ifeq "8.5" "$(word 1, $(sort 8.5 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
  100. ENABLE_FEAT_RNG := 1
  101. ENABLE_FEAT_SB := 1
  102. # Enable Memory tagging, Branch Target Identification for aarch64 only.
  103. ifeq ($(ARCH), aarch64)
  104. mem_tag_arch_support := yes
  105. endif #(ARCH=aarch64)
  106. endif
  107. # Enable the features which are mandatory from ARCH version 8.6 and upwards.
  108. ifeq "8.6" "$(word 1, $(sort 8.6 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
  109. ENABLE_FEAT_ECV := 1
  110. ENABLE_FEAT_FGT := 1
  111. endif
  112. # Enable the features which are mandatory from ARCH version 8.7 and upwards.
  113. ifeq "8.7" "$(word 1, $(sort 8.7 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
  114. ENABLE_FEAT_HCX := 1
  115. endif
  116. # Enable the features which are mandatory from ARCH version 8.9 and upwards.
  117. ifeq "8.9" "$(word 1, $(sort 8.9 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
  118. ENABLE_FEAT_TCR2 := 1
  119. endif
  120. #
  121. ################################################################################
  122. # Optional Features defaulted to 0 or 2, if they are not enabled from
  123. # build option. Can also be disabled or enabled by platform if needed.
  124. ################################################################################
  125. #
  126. #----
  127. # 8.0
  128. #----
  129. # Flag to enable CSV2_2 extension.
  130. ENABLE_FEAT_CSV2_2 ?= 0
  131. # By default, disable access of trace system registers from NS lower
  132. # ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused if
  133. # system register trace is implemented. This feature is available if
  134. # trace unit such as ETMv4.x, This feature is OPTIONAL and is only
  135. # permitted in Armv8 implementations.
  136. ENABLE_SYS_REG_TRACE_FOR_NS ?= 0
  137. #----
  138. # 8.2
  139. #----
  140. # Build option to enable/disable the Statistical Profiling Extension,
  141. # keep it enabled by default for AArch64.
  142. ifeq (${ARCH},aarch64)
  143. ENABLE_SPE_FOR_NS ?= 2
  144. else ifeq (${ARCH},aarch32)
  145. ifdef ENABLE_SPE_FOR_NS
  146. $(error ENABLE_SPE_FOR_NS is not supported for AArch32)
  147. else
  148. ENABLE_SPE_FOR_NS := 0
  149. endif
  150. endif
  151. # Enable SVE for non-secure world by default.
  152. ifeq (${ARCH},aarch64)
  153. ENABLE_SVE_FOR_NS ?= 2
  154. # SVE is only supported on AArch64 so disable it on AArch32.
  155. else ifeq (${ARCH},aarch32)
  156. ifdef ENABLE_SVE_FOR_NS
  157. $(error ENABLE_SVE_FOR_NS is not supported for AArch32)
  158. else
  159. ENABLE_SVE_FOR_NS := 0
  160. endif
  161. endif
  162. #----
  163. # 8.4
  164. #----
  165. # Feature flags for supporting Activity monitor extensions.
  166. ENABLE_FEAT_AMU ?= 0
  167. ENABLE_AMU_AUXILIARY_COUNTERS ?= 0
  168. ENABLE_AMU_FCONF ?= 0
  169. AMU_RESTRICT_COUNTERS ?= 0
  170. # Build option to enable MPAM for lower ELs.
  171. ENABLE_MPAM_FOR_LOWER_ELS ?= 0
  172. # Include nested virtualization control (Armv8.4-NV) registers in cpu context.
  173. # This must be set to 1 if architecture implements Nested Virtualization
  174. # Extension and platform wants to use this feature in the Secure world.
  175. CTX_INCLUDE_NEVE_REGS ?= 0
  176. #----
  177. # 8.5
  178. #----
  179. # Flag to enable support for EL3 trapping of reads of the RNDR and RNDRRS
  180. # registers, by setting SCR_EL3.TRNDR.
  181. ENABLE_FEAT_RNG_TRAP ?= 0
  182. # Include Memory Tagging Extension registers in cpu context. This must be set
  183. # to 1 if the platform wants to use this feature in the Secure world and MTE is
  184. # enabled at ELX.
  185. CTX_INCLUDE_MTE_REGS ?= 0
  186. #----
  187. # 8.6
  188. #----
  189. # Flag to enable AMUv1p1 extension.
  190. ENABLE_FEAT_AMUv1p1 ?= 0
  191. # Flag to enable delayed trapping of WFE instruction (FEAT_TWED).
  192. ENABLE_FEAT_TWED ?= 0
  193. # In v8.6+ platforms with delayed trapping of WFE being supported
  194. # via FEAT_TWED, this flag takes the delay value to be set in the
  195. # SCR_EL3.TWEDEL(4bit) field, when FEAT_TWED is implemented.
  196. # By default it takes 0, and need to be updated by the platforms.
  197. TWED_DELAY ?= 0
  198. # Disable MTPMU if FEAT_MTPMU is supported.
  199. DISABLE_MTPMU ?= 0
  200. #----
  201. # 8.9
  202. #----
  203. # Flag to enable NoTagAccess memory region attribute for stage 2 of translation.
  204. ENABLE_FEAT_MTE_PERM ?= 0
  205. # Flag to enable access to Stage 2 Permission Indirection (FEAT_S2PIE).
  206. ENABLE_FEAT_S2PIE ?= 0
  207. # Flag to enable access to Stage 1 Permission Indirection (FEAT_S1PIE).
  208. ENABLE_FEAT_S1PIE ?= 0
  209. # Flag to enable access to Stage 2 Permission Overlay (FEAT_S2POE).
  210. ENABLE_FEAT_S2POE ?= 0
  211. # Flag to enable access to Stage 1 Permission Overlay (FEAT_S1POE).
  212. ENABLE_FEAT_S1POE ?= 0
  213. #----
  214. # 9.0
  215. #----
  216. # Flag to enable Realm Management Extension (FEAT_RME).
  217. ENABLE_RME ?= 0
  218. # Scalable Matrix Extension for non-secure world.
  219. ENABLE_SME_FOR_NS ?= 0
  220. # Scalable Vector Extension for secure world.
  221. ENABLE_SVE_FOR_SWD ?= 0
  222. # By default, disable access of trace buffer control registers from NS
  223. # lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused
  224. # if FEAT_TRBE is implemented.
  225. # Note FEAT_TRBE is only supported on AArch64 - therefore do not enable in
  226. # AArch32.
  227. ifeq (${ARCH},aarch64)
  228. ENABLE_TRBE_FOR_NS ?= 0
  229. else ifeq (${ARCH},aarch32)
  230. ifdef ENABLE_TRBE_FOR_NS
  231. $(error ENABLE_TRBE_FOR_NS is not supported for AArch32)
  232. else
  233. ENABLE_TRBE_FOR_NS := 0
  234. endif
  235. endif
  236. #----
  237. # 9.2
  238. #----
  239. # Scalable Matrix Extension version 2 for non-secure world.
  240. ENABLE_SME2_FOR_NS ?= 0
  241. # Scalable Matrix Extension for secure world.
  242. ENABLE_SME_FOR_SWD ?= 0
  243. # By default, disable access to branch record buffer control registers from NS
  244. # lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused
  245. # if FEAT_BRBE is implemented.
  246. ENABLE_BRBE_FOR_NS ?= 0
  247. #----
  248. #9.4
  249. #----
  250. # Flag to enable access to Guarded Control Stack (FEAT_GCS).
  251. ENABLE_FEAT_GCS ?= 0