@@ -226,6 +226,10 @@ static const struct arm64_ftr_bits ftr_id_aa64isar1[] = {
226226};
227227
228228static const struct arm64_ftr_bits ftr_id_aa64isar2 [] = {
229+ ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_PTR_AUTH ),
230+ FTR_STRICT , FTR_EXACT , ID_AA64ISAR2_APA3_SHIFT , 4 , 0 ),
231+ ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_PTR_AUTH ),
232+ FTR_STRICT , FTR_LOWER_SAFE , ID_AA64ISAR2_GPA3_SHIFT , 4 , 0 ),
229233 ARM64_FTR_BITS (FTR_VISIBLE , FTR_NONSTRICT , FTR_LOWER_SAFE , ID_AA64ISAR2_RPRES_SHIFT , 4 , 0 ),
230234 ARM64_FTR_END ,
231235};
@@ -596,6 +600,7 @@ static const struct arm64_ftr_bits ftr_raz[] = {
596600struct arm64_ftr_override __ro_after_init id_aa64mmfr1_override ;
597601struct arm64_ftr_override __ro_after_init id_aa64pfr1_override ;
598602struct arm64_ftr_override __ro_after_init id_aa64isar1_override ;
603+ struct arm64_ftr_override __ro_after_init id_aa64isar2_override ;
599604
600605static const struct __ftr_reg_entry {
601606 u32 sys_id ;
@@ -644,6 +649,8 @@ static const struct __ftr_reg_entry {
644649 ARM64_FTR_REG_OVERRIDE (SYS_ID_AA64ISAR1_EL1 , ftr_id_aa64isar1 ,
645650 & id_aa64isar1_override ),
646651 ARM64_FTR_REG (SYS_ID_AA64ISAR2_EL1 , ftr_id_aa64isar2 ),
652+ ARM64_FTR_REG_OVERRIDE (SYS_ID_AA64ISAR2_EL1 , ftr_id_aa64isar2 ,
653+ & id_aa64isar2_override ),
647654
648655 /* Op1 = 0, CRn = 0, CRm = 7 */
649656 ARM64_FTR_REG (SYS_ID_AA64MMFR0_EL1 , ftr_id_aa64mmfr0 ),
@@ -1837,17 +1844,19 @@ static bool has_address_auth_metacap(const struct arm64_cpu_capabilities *entry,
18371844{
18381845 bool api = has_address_auth_cpucap (cpu_hwcaps_ptrs [ARM64_HAS_ADDRESS_AUTH_IMP_DEF ], scope );
18391846 bool apa = has_address_auth_cpucap (cpu_hwcaps_ptrs [ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA5 ], scope );
1847+ bool apa3 = has_address_auth_cpucap (cpu_hwcaps_ptrs [ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA3 ], scope );
18401848
1841- return apa || api ;
1849+ return apa || apa3 || api ;
18421850}
18431851
18441852static bool has_generic_auth (const struct arm64_cpu_capabilities * entry ,
18451853 int __unused )
18461854{
18471855 bool gpi = __system_matches_cap (ARM64_HAS_GENERIC_AUTH_IMP_DEF );
18481856 bool gpa = __system_matches_cap (ARM64_HAS_GENERIC_AUTH_ARCH_QARMA5 );
1857+ bool gpa3 = __system_matches_cap (ARM64_HAS_GENERIC_AUTH_ARCH_QARMA3 );
18491858
1850- return gpa || gpi ;
1859+ return gpa || gpa3 || gpi ;
18511860}
18521861#endif /* CONFIG_ARM64_PTR_AUTH */
18531862
@@ -2243,6 +2252,16 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
22432252 .min_field_value = ID_AA64ISAR1_APA_ARCHITECTED ,
22442253 .matches = has_address_auth_cpucap ,
22452254 },
2255+ {
2256+ .desc = "Address authentication (architected QARMA3 algorithm)" ,
2257+ .capability = ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA3 ,
2258+ .type = ARM64_CPUCAP_BOOT_CPU_FEATURE ,
2259+ .sys_reg = SYS_ID_AA64ISAR2_EL1 ,
2260+ .sign = FTR_UNSIGNED ,
2261+ .field_pos = ID_AA64ISAR2_APA3_SHIFT ,
2262+ .min_field_value = ID_AA64ISAR2_APA3_ARCHITECTED ,
2263+ .matches = has_address_auth_cpucap ,
2264+ },
22462265 {
22472266 .desc = "Address authentication (IMP DEF algorithm)" ,
22482267 .capability = ARM64_HAS_ADDRESS_AUTH_IMP_DEF ,
@@ -2268,6 +2287,16 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
22682287 .min_field_value = ID_AA64ISAR1_GPA_ARCHITECTED ,
22692288 .matches = has_cpuid_feature ,
22702289 },
2290+ {
2291+ .desc = "Generic authentication (architected QARMA3 algorithm)" ,
2292+ .capability = ARM64_HAS_GENERIC_AUTH_ARCH_QARMA3 ,
2293+ .type = ARM64_CPUCAP_SYSTEM_FEATURE ,
2294+ .sys_reg = SYS_ID_AA64ISAR2_EL1 ,
2295+ .sign = FTR_UNSIGNED ,
2296+ .field_pos = ID_AA64ISAR2_GPA3_SHIFT ,
2297+ .min_field_value = ID_AA64ISAR2_GPA3_ARCHITECTED ,
2298+ .matches = has_cpuid_feature ,
2299+ },
22712300 {
22722301 .desc = "Generic authentication (IMP DEF algorithm)" ,
22732302 .capability = ARM64_HAS_GENERIC_AUTH_IMP_DEF ,
@@ -2415,6 +2444,10 @@ static const struct arm64_cpu_capabilities ptr_auth_hwcap_addr_matches[] = {
24152444 HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR1_EL1 , ID_AA64ISAR1_APA_SHIFT ,
24162445 FTR_UNSIGNED , ID_AA64ISAR1_APA_ARCHITECTED )
24172446 },
2447+ {
2448+ HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR2_EL1 , ID_AA64ISAR2_APA3_SHIFT ,
2449+ FTR_UNSIGNED , ID_AA64ISAR2_APA3_ARCHITECTED )
2450+ },
24182451 {
24192452 HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR1_EL1 , ID_AA64ISAR1_API_SHIFT ,
24202453 FTR_UNSIGNED , ID_AA64ISAR1_API_IMP_DEF )
@@ -2427,6 +2460,10 @@ static const struct arm64_cpu_capabilities ptr_auth_hwcap_gen_matches[] = {
24272460 HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR1_EL1 , ID_AA64ISAR1_GPA_SHIFT ,
24282461 FTR_UNSIGNED , ID_AA64ISAR1_GPA_ARCHITECTED )
24292462 },
2463+ {
2464+ HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR2_EL1 , ID_AA64ISAR2_GPA3_SHIFT ,
2465+ FTR_UNSIGNED , ID_AA64ISAR2_GPA3_ARCHITECTED )
2466+ },
24302467 {
24312468 HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR1_EL1 , ID_AA64ISAR1_GPI_SHIFT ,
24322469 FTR_UNSIGNED , ID_AA64ISAR1_GPI_IMP_DEF )
0 commit comments