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