arm64/sysreg: More system register generation
cover arm64/sysreg: More system register generation
This series continues on with the conversion of the system registers to automatic generation, together with a few cleanups and improvements that were identified as part of looking through all the register definitions and bringing them into line with the conventions we've been using.
Mark Brown (9):
arm64/sysreg: Remove stray SMIDR_EL1 defines
arm64/sysreg: Add _EL1 to ID_AA64PFR1_EL1 constant names arm64/sysreg: Standardise naming for SSBS feature enumeration arm64/sysreg: Standardise naming for MTE feature enumeration arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 fractional version
fields
arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 BTI enumeration arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 SME enumeration arm64/sysreg: Convert ID_AA64PFR1_EL1 to automatic generation arm64/sysreg: Convert HCRX_EL2 to automatic generation
arch/arm64/include/asm/cpufeature.h | 6 +- arch/arm64/include/asm/el2_setup.h | 2 +- arch/arm64/include/asm/sysreg.h | 27 -------- arch/arm64/kernel/cpufeature.c | 42 ++++++------- arch/arm64/kernel/hyp-stub.S | 2 +- arch/arm64/kernel/idreg-override.c | 6 +- .../arm64/kvm/hyp/include/nvhe/fixed_config.h | 4 +- arch/arm64/kvm/hyp/nvhe/pkvm.c | 2 +- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 2 +- arch/arm64/kvm/sys_regs.c | 4 +- arch/arm64/mm/mmu.c | 2 +- arch/arm64/mm/proc.S | 4 +- arch/arm64/tools/sysreg | 61 +++++++++++++++++++ 13 files changed, 99 insertions(+), 65 deletions(-)
base-commit: b31f932090da32764e5c550a493e25982be4fa01
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/9 arm64/sysreg: Remove stray SMIDR_EL1 defines
SMIDR_EL1 was converted to automatic generation but some of the constants for fields in it were mistakenly left, remove them.
--- arch/arm64/include/asm/sysreg.h | 4 ---- 1 file changed, 4 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -4
@@ -445,10 +445,6 @@#define SYS_CCSIDR_EL1 sys_reg(3, 1, 0, 0, 0)#define SYS_AIDR_EL1 sys_reg(3, 1, 0, 0, 7) -#define SMIDR_EL1_IMPLEMENTER_SHIFT 24 -#define SMIDR_EL1_SMPS_SHIFT 15 -#define SMIDR_EL1_AFFINITY_SHIFT 0 -#define SYS_RNDR_EL0 sys_reg(3, 3, 2, 4, 0)#define SYS_RNDRRS_EL0 sys_reg(3, 3, 2, 4, 1)
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/9 arm64/sysreg: Add _EL1 to ID_AA64PFR1_EL1 constant names
In reply to Mark BrownOur standard is to include the _EL1 in the constant names for registers but we did not do that for ID_AA64PFR1_EL1, update to do so in preparation for conversion to automatic generation. No functional change.
--- arch/arm64/include/asm/cpufeature.h | 6 +-- arch/arm64/include/asm/el2_setup.h | 2 +- arch/arm64/include/asm/sysreg.h | 34 +++++++-------- arch/arm64/kernel/cpufeature.c | 42 +++++++++---------- arch/arm64/kernel/hyp-stub.S | 2 +- arch/arm64/kernel/idreg-override.c | 6 +-- .../arm64/kvm/hyp/include/nvhe/fixed_config.h | 4 +- arch/arm64/kvm/hyp/nvhe/pkvm.c | 2 +- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 2 +- arch/arm64/kvm/sys_regs.c | 4 +- arch/arm64/mm/mmu.c | 2 +- arch/arm64/mm/proc.S | 4 +- 12 files changed, 55 insertions(+), 55 deletions(-)
arch/arm64/include/asm/cpufeature.h +3 -3
@@ -624,16 +624,16 @@ static inline bool id_aa64pfr0_sve(u64 pfr0)static inline bool id_aa64pfr1_sme (u64 pfr1) { -u32 val =cpuid_feature_extract_unsigned_field (pfr1,ID_AA64PFR1_SME_SHIFT ); +u32 val =cpuid_feature_extract_unsigned_field (pfr1,ID_AA64PFR1_EL1_SME_SHIFT );return val >0 ; }static inline bool id_aa64pfr1_mte (u64 pfr1) { -u32 val =cpuid_feature_extract_unsigned_field (pfr1,ID_AA64PFR1_MTE_SHIFT ); +u32 val =cpuid_feature_extract_unsigned_field (pfr1,ID_AA64PFR1_EL1_MTE_SHIFT ); -return val >=ID_AA64PFR1_MTE ; +return val >=ID_AA64PFR1_EL1_MTE ; }void __init setup_cpu_features (void );
arch/arm64/include/asm/el2_setup.h +1 -1
@@ -149,7 +149,7 @@mov x0, xzr mrs x1, id_aa64pfr1_el1 - ubfx x1, x1, #ID_AA64PFR1_SME_SHIFT, #4 + ubfx x1, x1, #ID_AA64PFR1_EL1_SME_SHIFT, #4 cbz x1, .Lset_fgt_\@/* Disable nVHE traps of TPIDR2 and SMPRI */
arch/arm64/include/asm/sysreg.h +17 -17
@@ -714,23 +714,23 @@#define ID_AA64PFR0_ELx_32BIT_64BIT 0x2/* id_aa64pfr1 */ -#define ID_AA64PFR1_SME_SHIFT 24 -#define ID_AA64PFR1_MPAMFRAC_SHIFT 16 -#define ID_AA64PFR1_RASFRAC_SHIFT 12 -#define ID_AA64PFR1_MTE_SHIFT 8 -#define ID_AA64PFR1_SSBS_SHIFT 4 -#define ID_AA64PFR1_BT_SHIFT 0 - -#define ID_AA64PFR1_SSBS_PSTATE_NI 0 -#define ID_AA64PFR1_SSBS_PSTATE_ONLY 1 -#define ID_AA64PFR1_SSBS_PSTATE_INSNS 2 -#define ID_AA64PFR1_BT_BTI 0x1 -#define ID_AA64PFR1_SME 1 - -#define ID_AA64PFR1_MTE_NI 0x0 -#define ID_AA64PFR1_MTE_EL0 0x1 -#define ID_AA64PFR1_MTE 0x2 -#define ID_AA64PFR1_MTE_ASYMM 0x3 +#define ID_AA64PFR1_EL1_SME_SHIFT 24 +#define ID_AA64PFR1_EL1_MPAMFRAC_SHIFT 16 +#define ID_AA64PFR1_EL1_RASFRAC_SHIFT 12 +#define ID_AA64PFR1_EL1_MTE_SHIFT 8 +#define ID_AA64PFR1_EL1_SSBS_SHIFT 4 +#define ID_AA64PFR1_EL1_BT_SHIFT 0 + +#define ID_AA64PFR1_EL1_SSBS_PSTATE_NI 0 +#define ID_AA64PFR1_EL1_SSBS_PSTATE_ONLY 1 +#define ID_AA64PFR1_EL1_SSBS_PSTATE_INSNS 2 +#define ID_AA64PFR1_EL1_BT_BTI 0x1 +#define ID_AA64PFR1_EL1_SME 1 + +#define ID_AA64PFR1_EL1_MTE_NI 0x0 +#define ID_AA64PFR1_EL1_MTE_EL0 0x1 +#define ID_AA64PFR1_EL1_MTE 0x2 +#define ID_AA64PFR1_EL1_MTE_ASYMM 0x3/* id_aa64mmfr0 */ #define ID_AA64MMFR0_ECV_SHIFT 60
arch/arm64/kernel/cpufeature.c +21 -21
105 lines not on this page · raw message
arch/arm64/kernel/hyp-stub.S +1 -1
@@ -109,7 +109,7 @@ SYM_CODE_START_LOCAL(__finalise_el2) msr_s SYS_ZCR_EL2, x1 // length for EL1. .Lskip_sve: - check_override id_aa64pfr1 ID_AA64PFR1_SME_SHIFT .Linit_sme .Lskip_sme + check_override id_aa64pfr1 ID_AA64PFR1_EL1_SME_SHIFT .Linit_sme .Lskip_sme .Linit_sme: /* SME register access and priority mapping */ mrs x0, cptr_el2 // Disable SME traps
arch/arm64/kernel/idreg-override.c +3 -3
@@ -98,9 +98,9 @@ static const struct ftr_set_desc pfr1 __initconst = { .name = "id_aa64pfr1", .override = &id_aa64pfr1_override, .fields = { -FIELD ("bt" ,ID_AA64PFR1_BT_SHIFT ,NULL ), -FIELD ("mte" ,ID_AA64PFR1_MTE_SHIFT ,NULL ), - FIELD("sme", ID_AA64PFR1_SME_SHIFT, pfr1_sme_filter), +FIELD ("bt" ,ID_AA64PFR1_EL1_BT_SHIFT ,NULL ), +FIELD ("mte" ,ID_AA64PFR1_EL1_MTE_SHIFT ,NULL ), + FIELD("sme", ID_AA64PFR1_EL1_SME_SHIFT, pfr1_sme_filter), {} }, };
arch/arm64/kvm/hyp/include/nvhe/fixed_config.h +2 -2
@@ -62,8 +62,8 @@* - Speculative Store Bypassing */ #define PVM_ID_AA64PFR1_ALLOW (\ - ARM64_FEATURE_MASK(ID_AA64PFR1_BT) | \ - ARM64_FEATURE_MASK(ID_AA64PFR1_SSBS) \ + ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_BT) | \ + ARM64_FEATURE_MASK(ID_AA64PFR1_EL1_SSBS) \ )/*
arch/arm64/kvm/hyp/nvhe/pkvm.c +1 -1
@@ -66,7 +66,7 @@ static void pvm_init_traps_aa64pfr1(struct kvm_vcpu *vcpu)u64 hcr_clear =0 ;/* Memory Tagging: Trap and Treat as Untagged if not supported. */ -if (!FIELD_GET (ARM64_FEATURE_MASK (ID_AA64PFR1_MTE ), feature_ids)) { +if (!FIELD_GET (ARM64_FEATURE_MASK (ID_AA64PFR1_EL1_MTE ), feature_ids)) { hcr_set |=HCR_TID5 ; hcr_clear |=HCR_DCT |HCR_ATA ; }
arch/arm64/kvm/hyp/nvhe/sys_regs.c +1 -1
@@ -108,7 +108,7 @@ static u64 get_pvm_id_aa64pfr1(const struct kvm_vcpu *vcpu)u64 allow_mask =PVM_ID_AA64PFR1_ALLOW ;if (!kvm_has_mte (kvm)) - allow_mask &= ~ARM64_FEATURE_MASK (ID_AA64PFR1_MTE ); + allow_mask &= ~ARM64_FEATURE_MASK (ID_AA64PFR1_EL1_MTE );return id_aa64pfr1_el1_sys_val & allow_mask; }
arch/arm64/kvm/sys_regs.c +2 -2
@@ -1130,9 +1130,9 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu,break ;case SYS_ID_AA64PFR1_EL1 :if (!kvm_has_mte (vcpu->kvm)) - val &= ~ARM64_FEATURE_MASK (ID_AA64PFR1_MTE ); + val &= ~ARM64_FEATURE_MASK (ID_AA64PFR1_EL1_MTE ); - val &= ~ARM64_FEATURE_MASK (ID_AA64PFR1_SME ); + val &= ~ARM64_FEATURE_MASK (ID_AA64PFR1_EL1_SME );break ;case SYS_ID_AA64ISAR1_EL1 :if (!vcpu_has_ptrauth (vcpu))
arch/arm64/mm/mmu.c +1 -1
@@ -704,7 +704,7 @@ static bool arm64_early_this_cpu_has_bti(void) pfr1 =__read_sysreg_by_encoding (SYS_ID_AA64PFR1_EL1 );return cpuid_feature_extract_unsigned_field (pfr1, -ID_AA64PFR1_BT_SHIFT ); +ID_AA64PFR1_EL1_BT_SHIFT ); }/*
arch/arm64/mm/proc.S +2 -2
@@ -434,8 +434,8 @@ SYM_FUNC_START(__cpu_setup) * (ID_AA64PFR1_EL1[11:8] > 1). */ mrs x10, ID_AA64PFR1_EL1 - ubfx x10, x10, #ID_AA64PFR1_MTE_SHIFT, #4 - cmp x10, #ID_AA64PFR1_MTE + ubfx x10, x10, #ID_AA64PFR1_EL1_MTE_SHIFT, #4 + cmp x10, #ID_AA64PFR1_EL1_MTE b.lt 1f /* Normal Tagged memory type at the corresponding MAIR index */
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 3/9 arm64/sysreg: Standardise naming for SSBS feature enumeration
In reply to Mark BrownIn preparation for conversion to automatic generation refresh the names given to the items in the SSBS feature enumeration to reflect our standard pattern for naming, corresponding to the architecture feature names they reflect. No functional change.
--- arch/arm64/include/asm/sysreg.h | 10 +++++----- arch/arm64/kernel/cpufeature.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-)
arch/arm64/include/asm/sysreg.h +5 -5
@@ -721,11 +721,11 @@#define ID_AA64PFR1_EL1_SSBS_SHIFT 4#define ID_AA64PFR1_EL1_BT_SHIFT 0 -#define ID_AA64PFR1_EL1_SSBS_PSTATE_NI 0 -#define ID_AA64PFR1_EL1_SSBS_PSTATE_ONLY 1 -#define ID_AA64PFR1_EL1_SSBS_PSTATE_INSNS 2 -#define ID_AA64PFR1_EL1_BT_BTI 0x1 -#define ID_AA64PFR1_EL1_SME 1 +#define ID_AA64PFR1_EL1_SSBS_NI 0 +#define ID_AA64PFR1_EL1_SSBS_IMP 1 +#define ID_AA64PFR1_EL1_SSBS_SSBS2 2 +#define ID_AA64PFR1_EL1_BT_BTI 0x1 +#define ID_AA64PFR1_EL1_SME 1#define ID_AA64PFR1_EL1_MTE_NI 0x0#define ID_AA64PFR1_EL1_MTE_EL0 0x1
arch/arm64/kernel/cpufeature.c +3 -3
@@ -268,7 +268,7 @@ static const struct arm64_ftr_bits ftr_id_aa64pfr1[] = {ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_RASFRAC_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_MTE ),FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_MTE_SHIFT ,4 ,ID_AA64PFR1_EL1_MTE_NI ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_SSBS_SHIFT ,4 ,ID_AA64PFR1_EL1_SSBS_PSTATE_NI ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_SSBS_SHIFT ,4 ,ID_AA64PFR1_EL1_SSBS_NI ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_BTI ),FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_BT_SHIFT ,4 ,0 ), ARM64_FTR_END,
@@ -2341,7 +2341,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .field_pos = ID_AA64PFR1_EL1_SSBS_SHIFT, .field_width = 4, .sign = FTR_UNSIGNED, - .min_field_value = ID_AA64PFR1_EL1_SSBS_PSTATE_ONLY, + .min_field_value = ID_AA64PFR1_EL1_SSBS_IMP, },#ifdef CONFIG_ARM64_CNP {
@@ -2711,7 +2711,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_EL1_F32MM_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_EL1_F32MM_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SVEF32MM ),HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_EL1_F64MM_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_EL1_F64MM_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SVEF64MM ), #endif -HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_EL1_SSBS_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_EL1_SSBS_PSTATE_INSNS ,CAP_HWCAP ,KERNEL_HWCAP_SSBS ), +HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_EL1_SSBS_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_EL1_SSBS_SSBS2 ,CAP_HWCAP ,KERNEL_HWCAP_SSBS ), #ifdef CONFIG_ARM64_BTI HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_EL1_BT_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR1_EL1_BT_BTI, CAP_HWCAP, KERNEL_HWCAP_BTI), #endif
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 4/9 arm64/sysreg: Standardise naming for MTE feature enumeration
In reply to Mark BrownIn preparation for conversion to automatic generation refresh the names given to the items in the MTE feture enumeration to reflect our standard pattern for naming, corresponding to the architecture feature names they reflect. No functional change.
--- arch/arm64/include/asm/cpufeature.h | 2 +- arch/arm64/include/asm/sysreg.h | 6 +++--- arch/arm64/kernel/cpufeature.c | 8 ++++---- arch/arm64/mm/proc.S | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-)
arch/arm64/include/asm/cpufeature.h +1 -1
@@ -633,7 +633,7 @@ static inline bool id_aa64pfr1_mte(u64 pfr1) {u32 val =cpuid_feature_extract_unsigned_field (pfr1,ID_AA64PFR1_EL1_MTE_SHIFT ); -return val >=ID_AA64PFR1_EL1_MTE ; +return val >=ID_AA64PFR1_EL1_MTE_MTE2 ; }void __init setup_cpu_features (void );
arch/arm64/include/asm/sysreg.h +3 -3
@@ -728,9 +728,9 @@#define ID_AA64PFR1_EL1_SME 1#define ID_AA64PFR1_EL1_MTE_NI 0x0 -#define ID_AA64PFR1_EL1_MTE_EL0 0x1 -#define ID_AA64PFR1_EL1_MTE 0x2 -#define ID_AA64PFR1_EL1_MTE_ASYMM 0x3 +#define ID_AA64PFR1_EL1_MTE_IMP 0x1 +#define ID_AA64PFR1_EL1_MTE_MTE2 0x2 +#define ID_AA64PFR1_EL1_MTE_MTE3 0x3/* id_aa64mmfr0 */ #define ID_AA64MMFR0_ECV_SHIFT 60
arch/arm64/kernel/cpufeature.c +4 -4
@@ -2516,7 +2516,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sys_reg = SYS_ID_AA64PFR1_EL1, .field_pos = ID_AA64PFR1_EL1_MTE_SHIFT, .field_width = 4, - .min_field_value = ID_AA64PFR1_EL1_MTE, + .min_field_value = ID_AA64PFR1_EL1_MTE_MTE2, .sign = FTR_UNSIGNED, .cpu_enable = cpu_enable_mte, },
@@ -2528,7 +2528,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sys_reg = SYS_ID_AA64PFR1_EL1, .field_pos = ID_AA64PFR1_EL1_MTE_SHIFT, .field_width = 4, - .min_field_value = ID_AA64PFR1_EL1_MTE_ASYMM, + .min_field_value = ID_AA64PFR1_EL1_MTE_MTE3, .sign = FTR_UNSIGNED, },#endif /* CONFIG_ARM64_MTE */
@@ -2720,8 +2720,8 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { HWCAP_MULTI_CAP(ptr_auth_hwcap_gen_matches, CAP_HWCAP, KERNEL_HWCAP_PACG),#endif #ifdef CONFIG_ARM64_MTE -HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_EL1_MTE_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_EL1_MTE ,CAP_HWCAP ,KERNEL_HWCAP_MTE ), -HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_EL1_MTE_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_EL1_MTE_ASYMM ,CAP_HWCAP ,KERNEL_HWCAP_MTE3 ), +HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_EL1_MTE_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_EL1_MTE_MTE2 ,CAP_HWCAP ,KERNEL_HWCAP_MTE ), +HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_EL1_MTE_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_EL1_MTE_MTE3 ,CAP_HWCAP ,KERNEL_HWCAP_MTE3 ), #endif /* CONFIG_ARM64_MTE */HWCAP_CAP (SYS_ID_AA64MMFR0_EL1 ,ID_AA64MMFR0_ECV_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_HWCAP ,KERNEL_HWCAP_ECV ), HWCAP_CAP(SYS_ID_AA64MMFR1_EL1, ID_AA64MMFR1_AFP_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_AFP),
arch/arm64/mm/proc.S +1 -1
@@ -435,7 +435,7 @@ SYM_FUNC_START(__cpu_setup) */ mrs x10, ID_AA64PFR1_EL1 ubfx x10, x10, #ID_AA64PFR1_EL1_MTE_SHIFT, #4 - cmp x10, #ID_AA64PFR1_EL1_MTE + cmp x10, #ID_AA64PFR1_EL1_MTE_MTE2 b.lt 1f /* Normal Tagged memory type at the corresponding MAIR index */
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 5/9 arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 fractional version fields
In reply to Mark BrownThe naming for fractional versions fields in ID_AA64PFR1_EL1 does not align with that in the architecture, lacking underscores and using upper case where the architecture uses lower case. In preparation for automatic generation of defines bring the code in sync with the architecture, no functional change.
--- arch/arm64/include/asm/sysreg.h | 4 ++-- arch/arm64/kernel/cpufeature.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/include/asm/sysreg.h +2 -2
@@ -715,8 +715,8 @@/* id_aa64pfr1 */ #define ID_AA64PFR1_EL1_SME_SHIFT 24 -#define ID_AA64PFR1_EL1_MPAMFRAC_SHIFT 16 -#define ID_AA64PFR1_EL1_RASFRAC_SHIFT 12 +#define ID_AA64PFR1_EL1_MPAM_frac_SHIFT 16 +#define ID_AA64PFR1_EL1_RAS_frac_SHIFT 12#define ID_AA64PFR1_EL1_MTE_SHIFT 8#define ID_AA64PFR1_EL1_SSBS_SHIFT 4#define ID_AA64PFR1_EL1_BT_SHIFT 0
arch/arm64/kernel/cpufeature.c +2 -2
@@ -264,8 +264,8 @@ static const struct arm64_ftr_bits ftr_id_aa64pfr0[] = {static const struct arm64_ftr_bits ftr_id_aa64pfr1[] = {ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SME ),FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_SME_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_MPAMFRAC_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_RASFRAC_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE , ID_AA64PFR1_EL1_MPAM_frac_SHIFT,4 ,0 ), +ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE , ID_AA64PFR1_EL1_RAS_frac_SHIFT,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_MTE ),FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_MTE_SHIFT ,4 ,ID_AA64PFR1_EL1_MTE_NI ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_AA64PFR1_EL1_SSBS_SHIFT ,4 ,ID_AA64PFR1_EL1_SSBS_NI ),
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 6/9 arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 BTI enumeration
In reply to Mark BrownIn preparation for automatic generation of constants update the define for BTI being implemented to the convention we are using, no functional change.
--- arch/arm64/include/asm/sysreg.h | 2 +- arch/arm64/kernel/cpufeature.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/include/asm/sysreg.h +1 -1
@@ -724,7 +724,7 @@#define ID_AA64PFR1_EL1_SSBS_NI 0#define ID_AA64PFR1_EL1_SSBS_IMP 1#define ID_AA64PFR1_EL1_SSBS_SSBS2 2 -#define ID_AA64PFR1_EL1_BT_BTI 0x1 +#define ID_AA64PFR1_EL1_BT_IMP 0x1#define ID_AA64PFR1_EL1_SME 1#define ID_AA64PFR1_EL1_MTE_NI 0x0
arch/arm64/kernel/cpufeature.c +2 -2
@@ -2503,7 +2503,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sys_reg = SYS_ID_AA64PFR1_EL1, .field_pos = ID_AA64PFR1_EL1_BT_SHIFT, .field_width = 4, - .min_field_value = ID_AA64PFR1_EL1_BT_BTI, + .min_field_value = ID_AA64PFR1_EL1_BT_IMP, .sign = FTR_UNSIGNED, },#endif
@@ -2713,7 +2713,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {#endif HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_EL1_SSBS_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR1_EL1_SSBS_SSBS2, CAP_HWCAP, KERNEL_HWCAP_SSBS),#ifdef CONFIG_ARM64_BTI - HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_EL1_BT_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR1_EL1_BT_BTI, CAP_HWCAP, KERNEL_HWCAP_BTI), + HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_EL1_BT_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR1_EL1_BT_IMP, CAP_HWCAP, KERNEL_HWCAP_BTI),#endif #ifdef CONFIG_ARM64_PTR_AUTH HWCAP_MULTI_CAP(ptr_auth_hwcap_addr_matches, CAP_HWCAP, KERNEL_HWCAP_PACA),
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 7/9 arm64/sysreg: Standardise naming of ID_AA64PFR1_EL1 SME enumeration
In reply to Mark BrownIn preparation for automatic generation of constants update the define for SME being implemented to the convention we are using, no functional change.
--- arch/arm64/include/asm/sysreg.h | 2 +- arch/arm64/kernel/cpufeature.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/include/asm/sysreg.h +1 -1
@@ -725,7 +725,7 @@#define ID_AA64PFR1_EL1_SSBS_IMP 1#define ID_AA64PFR1_EL1_SSBS_SSBS2 2#define ID_AA64PFR1_EL1_BT_IMP 0x1 -#define ID_AA64PFR1_EL1_SME 1 +#define ID_AA64PFR1_EL1_SME_IMP 1#define ID_AA64PFR1_EL1_MTE_NI 0x0#define ID_AA64PFR1_EL1_MTE_IMP 0x1
arch/arm64/kernel/cpufeature.c +2 -2
@@ -2552,7 +2552,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .field_pos = ID_AA64PFR1_EL1_SME_SHIFT, .field_width = 4, - .min_field_value = ID_AA64PFR1_EL1_SME, + .min_field_value = ID_AA64PFR1_EL1_SME_IMP, .matches = has_cpuid_feature, .cpu_enable = sme_kernel_enable, },
@@ -2728,7 +2728,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {HWCAP_CAP (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_EL1_RPRES_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_HWCAP ,KERNEL_HWCAP_RPRES ),HWCAP_CAP (SYS_ID_AA64ISAR2_EL1 , ID_AA64ISAR2_EL1_WFxT_SHIFT,4 ,FTR_UNSIGNED , ID_AA64ISAR2_EL1_WFxT_IMP,CAP_HWCAP ,KERNEL_HWCAP_WFXT ), #ifdef CONFIG_ARM64_SME -HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_EL1_SME_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_EL1_SME ,CAP_HWCAP ,KERNEL_HWCAP_SME ), +HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_EL1_SME_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_EL1_SME_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SME ),HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_EL1_FA64_SHIFT ,1 ,FTR_UNSIGNED ,ID_AA64SMFR0_EL1_FA64_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SME_FA64 ),HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_EL1_I16I64_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64SMFR0_EL1_I16I64_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SME_I16I64 ), HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_F64F64_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_EL1_F64F64_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_F64F64),
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 8/9 arm64/sysreg: Convert ID_AA64PFR1_EL1 to automatic generation
In reply to Mark BrownConvert ID_AA64PFR1_EL1 to be automatically generated as per DDI04187H.a, no functional changes.
--- arch/arm64/include/asm/sysreg.h | 19 -------------- arch/arm64/tools/sysreg | 45 +++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 19 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -19
@@ -713,25 +713,6 @@#define ID_AA64PFR0_ELx_64BIT_ONLY 0x1#define ID_AA64PFR0_ELx_32BIT_64BIT 0x2 -/* id_aa64pfr1 */ -#define ID_AA64PFR1_EL1_SME_SHIFT 24 -#define ID_AA64PFR1_EL1_MPAM_frac_SHIFT 16 -#define ID_AA64PFR1_EL1_RAS_frac_SHIFT 12 -#define ID_AA64PFR1_EL1_MTE_SHIFT 8 -#define ID_AA64PFR1_EL1_SSBS_SHIFT 4 -#define ID_AA64PFR1_EL1_BT_SHIFT 0 - -#define ID_AA64PFR1_EL1_SSBS_NI 0 -#define ID_AA64PFR1_EL1_SSBS_IMP 1 -#define ID_AA64PFR1_EL1_SSBS_SSBS2 2 -#define ID_AA64PFR1_EL1_BT_IMP 0x1 -#define ID_AA64PFR1_EL1_SME_IMP 1 - -#define ID_AA64PFR1_EL1_MTE_NI 0x0 -#define ID_AA64PFR1_EL1_MTE_IMP 0x1 -#define ID_AA64PFR1_EL1_MTE_MTE2 0x2 -#define ID_AA64PFR1_EL1_MTE_MTE3 0x3 -/* id_aa64mmfr0 */ #define ID_AA64MMFR0_ECV_SHIFT 60#define ID_AA64MMFR0_FGT_SHIFT 56
arch/arm64/tools/sysreg +45 -0
51 lines not on this page · raw message
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 9/9 arm64/sysreg: Convert HCRX_EL2 to automatic generation
In reply to Mark BrownConvert HCRX_EL2 to be automatically generated as per DDI04187H.a, n functional changes.
--- arch/arm64/include/asm/sysreg.h | 4 ---- arch/arm64/tools/sysreg | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -4
@@ -533,7 +533,6 @@#define SYS_HFGWTR_EL2 sys_reg(3, 4, 1, 1, 5)#define SYS_HFGITR_EL2 sys_reg(3, 4, 1, 1, 6)#define SYS_TRFCR_EL2 sys_reg(3, 4, 1, 2, 1) -#define SYS_HCRX_EL2 sys_reg(3, 4, 1, 2, 2)#define SYS_HDFGRTR_EL2 sys_reg(3, 4, 3, 1, 4)#define SYS_HDFGWTR_EL2 sys_reg(3, 4, 3, 1, 5)#define SYS_HAFGRTR_EL2 sys_reg(3, 4, 3, 1, 6)
@@ -1005,9 +1004,6 @@#define TRFCR_ELx_ExTRE BIT(1)#define TRFCR_ELx_E0TRE BIT(0) -/* HCRX_EL2 definitions */ -#define HCRX_EL2_SMPME_MASK (1 << 5) -/* GIC Hypervisor interface registers */ /* ICH_MISR_EL2 bit definitions */ #define ICH_MISR_EOI (1 << 0)
arch/arm64/tools/sysreg +16 -0
@@ -559,6 +559,22 @@ Sysreg ZCR_EL2 3 4 1 2 0 Fields ZCR_ELx EndSysreg +Sysreg HCRX_EL2 3 4 1 2 2 +Res0 63:12 +Field 11 MSCEn +Field 10 MCE2 +Field 9 CMOW +Field 8 VFNMI +Field 7 VINMI +Field 6 TALLINT +Field 5 SMPME +Field 4 FGTnXS +Field 3 FnXS +Field 2 EnASR +Field 1 EnALS +Field 0 EnAS0 +EndSysreg + Sysreg SMPRIMAP_EL2 3 4 1 2 5 Field 63:60 P15 Field 59:56 P14
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel