arm64/sysreg: More system register generation
v4 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.
v4:
- Rebase onto v5.19-rc3.
v3:
- Fix value for ID_AA64ISAR2_EL1.WFxT IMP enumeration value.
- Add conversions of LOR*_EL1, ID_AA64SMFR0_EL1 and ID_AA64ZFR0_EL1.
- Rebase onto for-next/fixes due to the ID_AA64SMFR0_EL1 conversion.
v2:
- Rework handling of AIVIVT so we just update the define to reflect the naming but don't change the user visible decode, the type was removed from v8 rather than being added in v9.
Mark Brown (26):
arm64/cpuinfo: Restore define for AIVIVT cache type arm64/sysreg: Add LINKER_SCRIPT guards for sysreg.h arm64/sysreg: Add SYS_FIELD_GET() helper
arm64/sysreg: Standardise naming for CTR_EL0 fields arm64/sysreg: Standardise naming for DCZID_EL0 field names arm64/mte: Standardise GMID field name definitions arm64/sysreg: Align pointer auth enumeration defines with architecture arm64/sysreg: Make BHB clear feature defines match the architecture arm64/sysreg: Standardise naming for WFxT defines arm64/sysreg: Standardise naming for ID_AA64SMFR0_EL1 enums arm64/sysreg: Standardise naming for ID_AA64ZFR0_EL1 fields arm64/sysreg: Remove defines for RPRES enumeration arm64/sysreg: Add _EL1 into ID_AA64ISAR1_EL1 definition names arm64/sysreg: Add _EL1 into ID_AA64ISAR2_EL1 definition names arm64/sysreg: Convert CTR_EL0 to automatic generation arm64/sysreg: Convert DCZID_EL0 to automatic generation arm64/sysreg: Convert GMID to automatic generation arm64/sysreg: Convert ID_AA64ISAR1_EL1 to automatic generation arm64/sysreg: Convert ID_AA64ISAR2_EL1 to automatic generation arm64/sysreg: Convert LORSA_EL1 to automatic generation arm64/sysreg: Convert LOREA_EL1 to automatic generation arm64/sysreg: Convert LORN_EL1 to automatic generation arm64/sysreg: Convert LORC_EL1 to automatic generation arm64/sysreg: Convert LORID_EL1 to automatic generation arm64/sysreg: Convert ID_AA64SMFR0_EL1 to automatic generation arm64/sysreg: Convert ID_AA64ZFR0_EL1 to automatic generation
arch/arm64/include/asm/asm_pointer_auth.h | 4 +- arch/arm64/include/asm/cache.h | 29 +- arch/arm64/include/asm/cpufeature.h | 2 +- arch/arm64/include/asm/el2_setup.h | 2 +- arch/arm64/include/asm/gpr-num.h | 3 + arch/arm64/include/asm/sysreg.h | 126 +-------- arch/arm64/kernel/alternative.c | 2 +- arch/arm64/kernel/cpu_errata.c | 2 +- arch/arm64/kernel/cpufeature.c | 220 +++++++-------- arch/arm64/kernel/cpuinfo.c | 16 +- arch/arm64/kernel/idreg-override.c | 12 +- arch/arm64/kernel/traps.c | 6 +- .../arm64/kvm/hyp/include/nvhe/fixed_config.h | 32 +-- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 12 +- arch/arm64/kvm/sys_regs.c | 14 +- arch/arm64/lib/mte.S | 2 +- arch/arm64/tools/sysreg | 263 ++++++++++++++++++ 17 files changed, 443 insertions(+), 304 deletions(-)
base-commit: a111daf0c53ae91e71fd2bfe7497862d14132e3e
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 1/26 arm64/cpuinfo: Restore define for AIVIVT cache type
In 155433cb365ee466 ("arm64: cache: Remove support for ASID-tagged VIVT I-caches") we removed all the support fir AIVIVT cache types and renamed all references to the field to say "unknown" since support for AIVIVT caches was removed from the architecture. Since the correspoding removal from the architecture was done by documenting this value as reserved but still listing the original meaning and naming in order to facilitiate automatic generation of the headers for the system registers rename the kernel internal defines back to AIVIVT. The decoded value displayed to userspace is left as "RESERVED/UNKNOWN" so there is no user visible impact.
--- arch/arm64/include/asm/cache.h | 2 +- arch/arm64/kernel/cpuinfo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/include/asm/cache.h +1 -1
@@ -25,7 +25,7 @@#define CTR_L1IP (ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK)#define ICACHE_POLICY_VPIPT 0 -#define ICACHE_POLICY_RESERVED 1 +#define ICACHE_POLICY_AIVIVT 1#define ICACHE_POLICY_VIPT 2#define ICACHE_POLICY_PIPT 3
arch/arm64/kernel/cpuinfo.c +2 -2
@@ -35,7 +35,7 @@ static struct cpuinfo_arm64 boot_cpu_data;static const char *icache_policy_str[] = { [ICACHE_POLICY_VPIPT ] ="VPIPT" , - [ICACHE_POLICY_RESERVED ] ="RESERVED/UNKNOWN" , + [ICACHE_POLICY_AIVIVT ] ="RESERVED/UNKNOWN" , [ICACHE_POLICY_VIPT ] ="VIPT" , [ICACHE_POLICY_PIPT ] ="PIPT" , };
@@ -347,7 +347,7 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)case ICACHE_POLICY_VPIPT :set_bit (ICACHEF_VPIPT , &__icache_flags);break ; -case ICACHE_POLICY_RESERVED : +case ICACHE_POLICY_AIVIVT :case ICACHE_POLICY_VIPT :/* Assume aliasing */ set_bit (ICACHEF_ALIASING , &__icache_flags);
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 2/26 arm64/sysreg: Add LINKER_SCRIPT guards for sysreg.h
In reply to Mark BrownLinker scripts are preprocessed with __ASSEMBLY__ defined which works well for most things but not for assembler macros. In preparation for allowing sysreg.h to be included in linker files add some LINKER_SCRIPT guard defines around assembler macros in headers so the headers are safe for inclusion in linker scripts.
--- arch/arm64/include/asm/gpr-num.h | 3 +++ arch/arm64/include/asm/sysreg.h | 2 ++ 2 files changed, 5 insertions(+)
arch/arm64/include/asm/gpr-num.h +3 -0
@@ -4,12 +4,15 @@#ifdef __ASSEMBLY__ +#ifndef LINKER_SCRIPT + .irp num,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 .equ .L__gpr_num_x\num, \num .equ .L__gpr_num_w\num, \num .endr .equ .L__gpr_num_xzr,31 .equ .L__gpr_num_wzr,31 +#endif /* !LINKER_SCRIPT */ #else /* __ASSEMBLY__ */
arch/arm64/include/asm/sysreg.h +2 -0
@@ -1219,6 +1219,7 @@#ifdef __ASSEMBLY__ +#ifndef LINKER_SCRIPT .macro mrs_s, rt, sreg __emit_inst(0xd5200000|(\sreg)|(.L__gpr_num_\rt)) .endm
@@ -1226,6 +1227,7 @@ .macro msr_s, sreg, rt __emit_inst(0xd5000000|(\sreg)|(.L__gpr_num_\rt)) .endm +#endif /* !LINKER_SCRIPT */ #else
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 3/26 arm64/sysreg: Add SYS_FIELD_GET() helper
In reply to Mark BrownAdd a SYS_FIELD_GET() helper to match SYS_FIELD_PREP(), providing a simplified interface to FIELD_GET() when using the generated defines with standardized naming.
--- arch/arm64/include/asm/sysreg.h | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/include/asm/sysreg.h +3 -0
@@ -1326,6 +1326,9 @@#endif +#define SYS_FIELD_GET (reg, field, val) \ + FIELD_GET(reg##_##field##_MASK, val) +#define SYS_FIELD_PREP (reg, field, val) \ FIELD_PREP(reg##_##field##_MASK, val)
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 4/26 arm64/sysreg: Standardise naming for CTR_EL0 fields
In reply to Mark Browncache.h contains some defines which are used to represent fields and enumeration values which do not follow the standard naming convention used for when we automatically generate defines for system registers. Update the names of the constants to reflect standardised naming and move them to sysreg.h.
There is also a helper CTR_L1IP() which was open coded and has been converted to use SYS_FIELD_GET().
--- arch/arm64/include/asm/cache.h | 29 +++++++---------------------- arch/arm64/include/asm/sysreg.h | 16 ++++++++++++++++ arch/arm64/kernel/alternative.c | 2 +- arch/arm64/kernel/cpu_errata.c | 2 +- arch/arm64/kernel/cpufeature.c | 20 ++++++++++---------- arch/arm64/kernel/cpuinfo.c | 16 ++++++++-------- arch/arm64/kernel/traps.c | 6 +++--- 7 files changed, 46 insertions(+), 45 deletions(-)
arch/arm64/include/asm/cache.h +7 -22
@@ -7,32 +7,17 @@#include <asm/cputype.h> #include <asm/mte-def.h> - -#define CTR_L1IP_SHIFT 14 -#define CTR_L1IP_MASK 3 -#define CTR_DMINLINE_SHIFT 16 -#define CTR_IMINLINE_SHIFT 0 -#define CTR_IMINLINE_MASK 0xf -#define CTR_ERG_SHIFT 20 -#define CTR_CWG_SHIFT 24 -#define CTR_CWG_MASK 15 -#define CTR_IDC_SHIFT 28 -#define CTR_DIC_SHIFT 29 +#include <asm/sysreg.h> #define CTR_CACHE_MINLINE_MASK \ - (0xf << CTR_DMINLINE_SHIFT | CTR_IMINLINE_MASK << CTR_IMINLINE_SHIFT) - -#define CTR_L1IP (ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK) + (0xf << CTR_EL0_DMINLINE_SHIFT | \ + CTR_EL0_IMINLINE_MASK << CTR_EL0_IMINLINE_SHIFT) -#define ICACHE_POLICY_VPIPT 0 -#define ICACHE_POLICY_AIVIVT 1 -#define ICACHE_POLICY_VIPT 2 -#define ICACHE_POLICY_PIPT 3 +#define CTR_L1IP (ctr) SYS_FIELD_GET(CTR_EL0, L1Ip, ctr)#define L1_CACHE_SHIFT (6)#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) -#define CLIDR_LOUU_SHIFT 27#define CLIDR_LOC_SHIFT 24#define CLIDR_LOUIS_SHIFT 21
@@ -86,7 +71,7 @@ static __always_inline int icache_is_vpipt(void)static inline u32 cache_type_cwg (void ) { -return (read_cpuid_cachetype () >>CTR_CWG_SHIFT ) &CTR_CWG_MASK ; +return (read_cpuid_cachetype () >>CTR_EL0_CWG_SHIFT ) &CTR_EL0_CWG_MASK ; }#define __read_mostly __section(".data..read_mostly")
@@ -120,12 +105,12 @@ static inline u32 __attribute_const__ read_cpuid_effective_cachetype(void) {u32 ctr =read_cpuid_cachetype (); -if (!(ctr &BIT (CTR_IDC_SHIFT ))) { +if (!(ctr &BIT (CTR_EL0_IDC_SHIFT ))) {u64 clidr =read_sysreg (clidr_el1);if (CLIDR_LOC (clidr) ==0 || (CLIDR_LOUIS (clidr) ==0 &&CLIDR_LOUU (clidr) ==0 )) - ctr |=BIT (CTR_IDC_SHIFT ); + ctr |=BIT (CTR_EL0_IDC_SHIFT ); }return ctr;
arch/arm64/include/asm/sysreg.h +16 -0
@@ -1084,6 +1084,22 @@#define MVFR2_FPMISC_SHIFT 4#define MVFR2_SIMDMISC_SHIFT 0 +#define CTR_EL0_L1Ip_VPIPT 0 +#define CTR_EL0_L1Ip_AIVIVT 1 +#define CTR_EL0_L1Ip_VIPT 2 +#define CTR_EL0_L1Ip_PIPT 3 + +#define CTR_EL0_L1Ip_SHIFT 14 +#define CTR_EL0_L1Ip_MASK 3 +#define CTR_EL0_DminLine_SHIFT 16 +#define CTR_EL0_IminLine_SHIFT 0 +#define CTR_EL0_IminLine_MASK 0xf +#define CTR_EL0_ERG_SHIFT 20 +#define CTR_EL0_CWG_SHIFT 24 +#define CTR_EL0_CWG_MASK 15 +#define CTR_EL0_IDC_SHIFT 28 +#define CTR_EL0_DIC_SHIFT 29 +#define DCZID_DZP_SHIFT 4#define DCZID_BS_SHIFT 0
arch/arm64/kernel/alternative.c +1 -1
@@ -121,7 +121,7 @@ static void clean_dcache_range_nopatch(u64 start, u64 end) ctr_el0 =read_sanitised_ftr_reg (SYS_CTR_EL0 ); d_size =4 <<cpuid_feature_extract_unsigned_field (ctr_el0, -CTR_DMINLINE_SHIFT ); + CTR_EL0_DminLine_SHIFT); cur = start & ~(d_size -1 ); do { /*
arch/arm64/kernel/cpu_errata.c +1 -1
@@ -187,7 +187,7 @@ has_neoverse_n1_erratum_1542419(const struct arm64_cpu_capabilities *entry, int scope) {u32 midr =read_cpuid_id (); -bool has_dic =read_cpuid_cachetype () &BIT (CTR_DIC_SHIFT ); +bool has_dic =read_cpuid_cachetype () &BIT (CTR_EL0_DIC_SHIFT );const struct midr_range range =MIDR_ALL_VERSIONS (MIDR_NEOVERSE_N1 );WARN_ON (scope !=SCOPE_LOCAL_CPU ||preemptible ());
arch/arm64/kernel/cpufeature.c +10 -10
@@ -396,18 +396,18 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr2[] = {static const struct arm64_ftr_bits ftr_ctr[] = {ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_EXACT ,31 ,1 ,1 ),/* RES1 */ -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,CTR_DIC_SHIFT ,1 ,1 ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,CTR_IDC_SHIFT ,1 ,1 ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_HIGHER_OR_ZERO_SAFE ,CTR_CWG_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_HIGHER_OR_ZERO_SAFE ,CTR_ERG_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,CTR_DMINLINE_SHIFT ,4 ,1 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,CTR_EL0_DIC_SHIFT ,1 ,1 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,CTR_EL0_IDC_SHIFT ,1 ,1 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_HIGHER_OR_ZERO_SAFE ,CTR_EL0_CWG_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_HIGHER_OR_ZERO_SAFE ,CTR_EL0_ERG_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE , CTR_EL0_DminLine_SHIFT,4 ,1 ),/* * Linux can handle differing I-cache policies. Userspace JITs will * make use of *minLine. * If we have differing I-cache policies, report it as the weakest - VIPT. */ -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_EXACT ,CTR_L1IP_SHIFT ,2 ,ICACHE_POLICY_VIPT ),/* L1Ip */ -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,CTR_IMINLINE_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_EXACT , CTR_EL0_L1Ip_SHIFT,2 , CTR_EL0_L1Ip_VIPT),/* L1Ip */ +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE , CTR_EL0_IminLine_SHIFT,4 ,0 ),ARM64_FTR_END , };
@@ -1480,7 +1480,7 @@ static bool has_cache_idc(const struct arm64_cpu_capabilities *entry,else ctr =read_cpuid_effective_cachetype (); -return ctr &BIT (CTR_IDC_SHIFT ); +return ctr &BIT (CTR_EL0_IDC_SHIFT ); }static void cpu_emulate_effective_ctr (const struct arm64_cpu_capabilities *__unused)
@@ -1491,7 +1491,7 @@ static void cpu_emulate_effective_ctr(const struct arm64_cpu_capabilities *__unu* to the CTR_EL0 on this CPU and emulate it with the real/safe * value. */ -if (!(read_cpuid_cachetype () &BIT (CTR_IDC_SHIFT ))) +if (!(read_cpuid_cachetype () &BIT (CTR_EL0_IDC_SHIFT )))sysreg_clear_set (sctlr_el1,SCTLR_EL1_UCT ,0 ); }
@@ -1505,7 +1505,7 @@ static bool has_cache_dic(const struct arm64_cpu_capabilities *entry,else ctr =read_cpuid_cachetype (); -return ctr &BIT (CTR_DIC_SHIFT ); +return ctr &BIT (CTR_EL0_DIC_SHIFT ); } static bool __maybe_unused
arch/arm64/kernel/cpuinfo.c +8 -8
@@ -34,10 +34,10 @@ DEFINE_PER_CPU(struct cpuinfo_arm64, cpu_data);static struct cpuinfo_arm64 boot_cpu_data;static const char *icache_policy_str[] = { - [ICACHE_POLICY_VPIPT ] ="VPIPT" , - [ICACHE_POLICY_AIVIVT ] ="RESERVED/UNKNOWN" , - [ICACHE_POLICY_VIPT ] ="VIPT" , - [ICACHE_POLICY_PIPT ] ="PIPT" , + [CTR_EL0_L1Ip_VPIPT] ="VPIPT" , + [CTR_EL0_L1Ip_AIVIVT] ="RESERVED/UNKNOWN" , + [CTR_EL0_L1Ip_VIPT] ="VIPT" , + [CTR_EL0_L1Ip_PIPT] ="PIPT" , };unsigned long __icache_flags;
@@ -342,13 +342,13 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)u32 l1ip =CTR_L1IP (info->reg_ctr);switch (l1ip) { -case ICACHE_POLICY_PIPT : +case CTR_EL0_L1Ip_PIPT:break ; -case ICACHE_POLICY_VPIPT : +case CTR_EL0_L1Ip_VPIPT:set_bit (ICACHEF_VPIPT , &__icache_flags);break ; -case ICACHE_POLICY_AIVIVT : -case ICACHE_POLICY_VIPT : +case CTR_EL0_L1Ip_AIVIVT: +case CTR_EL0_L1Ip_VIPT:/* Assume aliasing */ set_bit (ICACHEF_ALIASING , &__icache_flags);break ;
arch/arm64/kernel/traps.c +3 -3
@@ -579,11 +579,11 @@ static void ctr_read_handler(unsigned long esr, struct pt_regs *regs)if (cpus_have_const_cap (ARM64_WORKAROUND_1542419 )) {/* Hide DIC so that we can trap the unnecessary maintenance...*/ - val &= ~BIT (CTR_DIC_SHIFT ); + val &= ~BIT (CTR_EL0_DIC_SHIFT );/* ... and fake IminLine to reduce the number of traps. */ - val &= ~CTR_IMINLINE_MASK ; - val |= (PAGE_SHIFT -2 ) &CTR_IMINLINE_MASK ; + val &= ~CTR_EL0_IminLine_MASK; + val |= (PAGE_SHIFT -2 ) & CTR_EL0_IminLine_MASK; }pt_regs_write_reg (regs, rt, val);
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 5/26 arm64/sysreg: Standardise naming for DCZID_EL0 field names
In reply to Mark BrownThe constants defining field names for DCZID_EL0 do not include the _EL0 that is included as part of our standard naming scheme. In preparation for automatic generation of the defines add the _EL0 in. 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
@@ -1100,8 +1100,8 @@#define CTR_EL0_IDC_SHIFT 28#define CTR_EL0_DIC_SHIFT 29 -#define DCZID_DZP_SHIFT 4 -#define DCZID_BS_SHIFT 0 +#define DCZID_EL0_DZP_SHIFT 4 +#define DCZID_EL0_BS_SHIFT 0#define CPACR_EL1_FPEN_EL1EN (BIT(20))/* enable EL1 access */ #define CPACR_EL1_FPEN_EL0EN (BIT(21))/* enable EL0 access, if EL1EN set */
arch/arm64/kernel/cpufeature.c +2 -2
@@ -453,8 +453,8 @@ static const struct arm64_ftr_bits ftr_mvfr2[] = { };static const struct arm64_ftr_bits ftr_dczid[] = { -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_EXACT ,DCZID_DZP_SHIFT ,1 ,1 ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,DCZID_BS_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_EXACT ,DCZID_EL0_DZP_SHIFT ,1 ,1 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_STRICT ,FTR_LOWER_SAFE ,DCZID_EL0_BS_SHIFT ,4 ,0 ),ARM64_FTR_END , };
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 6/26 arm64/mte: Standardise GMID field name definitions
In reply to Mark BrownUsually our defines for bitfields in system registers do not include a SYS_ prefix but those for GMID do. In preparation for automatic generation of defines remove that prefix. No functional change.
--- arch/arm64/include/asm/sysreg.h | 4 ++-- arch/arm64/kernel/cpufeature.c | 2 +- arch/arm64/lib/mte.S | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/include/asm/sysreg.h +2 -2
@@ -1137,8 +1137,8 @@#define SYS_RGSR_EL1_SEED_MASK 0xffffUL/* GMID_EL1 field definitions */ -#define SYS_GMID_EL1_BS_SHIFT 0 -#define SYS_GMID_EL1_BS_SIZE 4 +#define GMID_EL1_BS_SHIFT 0 +#define GMID_EL1_BS_SIZE 4/* TFSR{,E0}_EL1 bit definitions */ #define SYS_TFSR_EL1_TF0_SHIFT 0
arch/arm64/kernel/cpufeature.c +1 -1
@@ -459,7 +459,7 @@ static const struct arm64_ftr_bits ftr_dczid[] = { };static const struct arm64_ftr_bits ftr_gmid[] = { -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,SYS_GMID_EL1_BS_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_LOWER_SAFE ,GMID_EL1_BS_SHIFT ,4 ,0 ),ARM64_FTR_END , };
arch/arm64/lib/mte.S +1 -1
@@ -18,7 +18,7 @@ */ .macro multitag_transfer_size, reg, tmp mrs_s \reg, SYS_GMID_EL1 - ubfx \reg, \reg, #SYS_GMID_EL1_BS_SHIFT, #SYS_GMID_EL1_BS_SIZE + ubfx \reg, \reg, #GMID_EL1_BS_SHIFT, #GMID_EL1_BS_SIZE mov \tmp, #4 lsl \reg, \tmp, \reg .endm
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 7/26 arm64/sysreg: Align pointer auth enumeration defines with architecture
In reply to Mark BrownThe defines used for the pointer authentication feature enumerations do not follow the naming convention we've decided to use where we name things after the architecture feature that introduced. Prepare for generating the defines for the ISA ID registers by updating to use the feature names. No functional changes.
--- arch/arm64/include/asm/sysreg.h | 34 ++++++++++++++++----------------- arch/arm64/kernel/cpufeature.c | 24 +++++++++++------------ 2 files changed, 29 insertions(+), 29 deletions(-)
arch/arm64/include/asm/sysreg.h +17 -17
@@ -721,21 +721,21 @@#define ID_AA64ISAR1_DPB_SHIFT 0#define ID_AA64ISAR1_APA_NI 0x0 -#define ID_AA64ISAR1_APA_ARCHITECTED 0x1 +#define ID_AA64ISAR1_APA_PAuth 0x1#define ID_AA64ISAR1_APA_ARCH_EPAC 0x2 -#define ID_AA64ISAR1_APA_ARCH_EPAC2 0x3 -#define ID_AA64ISAR1_APA_ARCH_EPAC2_FPAC 0x4 -#define ID_AA64ISAR1_APA_ARCH_EPAC2_FPAC_CMB 0x5 +#define ID_AA64ISAR1_APA_Pauth2 0x3 +#define ID_AA64ISAR1_APA_FPAC 0x4 +#define ID_AA64ISAR1_APA_FPACCOMBINE 0x5#define ID_AA64ISAR1_API_NI 0x0 -#define ID_AA64ISAR1_API_IMP_DEF 0x1 -#define ID_AA64ISAR1_API_IMP_DEF_EPAC 0x2 -#define ID_AA64ISAR1_API_IMP_DEF_EPAC2 0x3 -#define ID_AA64ISAR1_API_IMP_DEF_EPAC2_FPAC 0x4 -#define ID_AA64ISAR1_API_IMP_DEF_EPAC2_FPAC_CMB 0x5 +#define ID_AA64ISAR1_API_PAuth 0x1 +#define ID_AA64ISAR1_API_EPAC 0x2 +#define ID_AA64ISAR1_API_PAuth2 0x3 +#define ID_AA64ISAR1_API_FPAC 0x4 +#define ID_AA64ISAR1_API_FPACCOMBINE 0x5#define ID_AA64ISAR1_GPA_NI 0x0 -#define ID_AA64ISAR1_GPA_ARCHITECTED 0x1 +#define ID_AA64ISAR1_GPA_IMP 0x1#define ID_AA64ISAR1_GPI_NI 0x0 -#define ID_AA64ISAR1_GPI_IMP_DEF 0x1 +#define ID_AA64ISAR1_GPI_IMP 0x1/* id_aa64isar2 */ #define ID_AA64ISAR2_CLEARBHB_SHIFT 28
@@ -755,14 +755,14 @@#define ID_AA64ISAR2_WFXT_SUPPORTED 0x2#define ID_AA64ISAR2_APA3_NI 0x0 -#define ID_AA64ISAR2_APA3_ARCHITECTED 0x1 -#define ID_AA64ISAR2_APA3_ARCH_EPAC 0x2 -#define ID_AA64ISAR2_APA3_ARCH_EPAC2 0x3 -#define ID_AA64ISAR2_APA3_ARCH_EPAC2_FPAC 0x4 -#define ID_AA64ISAR2_APA3_ARCH_EPAC2_FPAC_CMB 0x5 +#define ID_AA64ISAR2_APA3_PAuth 0x1 +#define ID_AA64ISAR2_APA3_EPAC 0x2 +#define ID_AA64ISAR2_APA3_PAuth2 0x3 +#define ID_AA64ISAR2_APA3_FPAC 0x4 +#define ID_AA64ISAR2_APA3_FPACCOMBINE 0x5#define ID_AA64ISAR2_GPA3_NI 0x0 -#define ID_AA64ISAR2_GPA3_ARCHITECTED 0x1 +#define ID_AA64ISAR2_GPA3_IMP 0x1/* id_aa64pfr0 */ #define ID_AA64PFR0_CSV3_SHIFT 60
arch/arm64/kernel/cpufeature.c +12 -12
@@ -2317,7 +2317,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .field_pos = ID_AA64ISAR1_APA_SHIFT, .field_width = 4, - .min_field_value = ID_AA64ISAR1_APA_ARCHITECTED, + .min_field_value = ID_AA64ISAR1_APA_PAuth, .matches = has_address_auth_cpucap, }, {
@@ -2328,7 +2328,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .field_pos = ID_AA64ISAR2_APA3_SHIFT, .field_width = 4, - .min_field_value = ID_AA64ISAR2_APA3_ARCHITECTED, + .min_field_value = ID_AA64ISAR2_APA3_PAuth, .matches = has_address_auth_cpucap, }, {
@@ -2339,7 +2339,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .field_pos = ID_AA64ISAR1_API_SHIFT, .field_width = 4, - .min_field_value = ID_AA64ISAR1_API_IMP_DEF, + .min_field_value = ID_AA64ISAR1_API_PAuth, .matches = has_address_auth_cpucap, }, {
@@ -2355,7 +2355,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .field_pos = ID_AA64ISAR1_GPA_SHIFT, .field_width = 4, - .min_field_value = ID_AA64ISAR1_GPA_ARCHITECTED, + .min_field_value = ID_AA64ISAR1_GPA_IMP, .matches = has_cpuid_feature, }, {
@@ -2366,7 +2366,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .field_pos = ID_AA64ISAR2_GPA3_SHIFT, .field_width = 4, - .min_field_value = ID_AA64ISAR2_GPA3_ARCHITECTED, + .min_field_value = ID_AA64ISAR2_GPA3_IMP, .matches = has_cpuid_feature, }, {
@@ -2377,7 +2377,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .field_pos = ID_AA64ISAR1_GPI_SHIFT, .field_width = 4, - .min_field_value = ID_AA64ISAR1_GPI_IMP_DEF, + .min_field_value = ID_AA64ISAR1_GPI_IMP, .matches = has_cpuid_feature, }, {
@@ -2562,15 +2562,15 @@ static const struct arm64_cpu_capabilities ptr_auth_hwcap_addr_matches[] = { {HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR1_EL1 ,ID_AA64ISAR1_APA_SHIFT ,4 ,FTR_UNSIGNED , -ID_AA64ISAR1_APA_ARCHITECTED ) + ID_AA64ISAR1_APA_PAuth) }, {HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_APA3_SHIFT , -4 ,FTR_UNSIGNED ,ID_AA64ISAR2_APA3_ARCHITECTED ) +4 ,FTR_UNSIGNED , ID_AA64ISAR2_APA3_PAuth) }, {HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR1_EL1 ,ID_AA64ISAR1_API_SHIFT , -4 ,FTR_UNSIGNED ,ID_AA64ISAR1_API_IMP_DEF ) +4 ,FTR_UNSIGNED , ID_AA64ISAR1_API_PAuth) }, {}, };
@@ -2578,15 +2578,15 @@ static const struct arm64_cpu_capabilities ptr_auth_hwcap_addr_matches[] = {static const struct arm64_cpu_capabilities ptr_auth_hwcap_gen_matches[] = { {HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR1_EL1 ,ID_AA64ISAR1_GPA_SHIFT , -4 ,FTR_UNSIGNED ,ID_AA64ISAR1_GPA_ARCHITECTED ) +4 ,FTR_UNSIGNED ,ID_AA64ISAR1_GPA_IMP ) }, {HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_GPA3_SHIFT , -4 ,FTR_UNSIGNED ,ID_AA64ISAR2_GPA3_ARCHITECTED ) +4 ,FTR_UNSIGNED ,ID_AA64ISAR2_GPA3_IMP ) }, {HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR1_EL1 ,ID_AA64ISAR1_GPI_SHIFT , -4 ,FTR_UNSIGNED ,ID_AA64ISAR1_GPI_IMP_DEF ) +4 ,FTR_UNSIGNED ,ID_AA64ISAR1_GPI_IMP ) }, {}, };
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 8/26 arm64/sysreg: Make BHB clear feature defines match the architecture
In reply to Mark BrownThe architecture refers to the field identifying support for BHB clear as BC but the kernel has called it CLEARBHB. In preparation for generation of defines for ID_AA64ISAR2_EL1 rename to use the architecture's naming. No functional changes.
--- arch/arm64/include/asm/cpufeature.h | 2 +- arch/arm64/include/asm/sysreg.h | 2 +- arch/arm64/kernel/cpufeature.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm64/include/asm/cpufeature.h +1 -1
@@ -673,7 +673,7 @@ static inline bool supports_clearbhb(int scope) isar2 =read_sanitised_ftr_reg (SYS_ID_AA64ISAR2_EL1 );return cpuid_feature_extract_unsigned_field (isar2, -ID_AA64ISAR2_CLEARBHB_SHIFT ); +ID_AA64ISAR2_BC_SHIFT ); }const struct cpumask *system_32bit_el0_cpumask (void );
arch/arm64/include/asm/sysreg.h +1 -1
@@ -738,7 +738,7 @@#define ID_AA64ISAR1_GPI_IMP 0x1/* id_aa64isar2 */ -#define ID_AA64ISAR2_CLEARBHB_SHIFT 28 +#define ID_AA64ISAR2_BC_SHIFT 28#define ID_AA64ISAR2_APA3_SHIFT 12#define ID_AA64ISAR2_GPA3_SHIFT 8#define ID_AA64ISAR2_RPRES_SHIFT 4
arch/arm64/kernel/cpufeature.c +1 -1
@@ -231,7 +231,7 @@ static const struct arm64_ftr_bits ftr_id_aa64isar1[] = { };static const struct arm64_ftr_bits ftr_id_aa64isar2[] = { -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_HIGHER_SAFE ,ID_AA64ISAR2_CLEARBHB_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_HIGHER_SAFE ,ID_AA64ISAR2_BC_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_PTR_AUTH ),FTR_STRICT ,FTR_EXACT ,ID_AA64ISAR2_APA3_SHIFT ,4 ,0 ), ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 9/26 arm64/sysreg: Standardise naming for WFxT defines
In reply to Mark BrownThe defines for WFxT refer to the feature as WFXT and use SUPPORTED rather than IMP. In preparation for automatic generation of defines update these to be more standard. No functional changes.
--- arch/arm64/include/asm/sysreg.h | 6 +++--- arch/arm64/kernel/cpufeature.c | 8 ++++---- arch/arm64/kvm/sys_regs.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-)
arch/arm64/include/asm/sysreg.h +3 -3
@@ -742,7 +742,7 @@#define ID_AA64ISAR2_APA3_SHIFT 12#define ID_AA64ISAR2_GPA3_SHIFT 8#define ID_AA64ISAR2_RPRES_SHIFT 4 -#define ID_AA64ISAR2_WFXT_SHIFT 0 +#define ID_AA64ISAR2_WFxT_SHIFT 0#define ID_AA64ISAR2_RPRES_8BIT 0x0#define ID_AA64ISAR2_RPRES_12BIT 0x1
@@ -751,8 +751,8 @@* reserved, but has not yet been removed from the ARM ARM * as of ARM DDI 0487G.b. */ -#define ID_AA64ISAR2_WFXT_NI 0x0 -#define ID_AA64ISAR2_WFXT_SUPPORTED 0x2 +#define ID_AA64ISAR2_WFxT_NI 0x0 +#define ID_AA64ISAR2_WFxT_IMP 0x2#define ID_AA64ISAR2_APA3_NI 0x0#define ID_AA64ISAR2_APA3_PAuth 0x1
arch/arm64/kernel/cpufeature.c +4 -4
@@ -237,7 +237,7 @@ static const struct arm64_ftr_bits ftr_id_aa64isar2[] = {ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_PTR_AUTH ),FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ISAR2_GPA3_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_AA64ISAR2_RPRES_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_AA64ISAR2_WFXT_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE , ID_AA64ISAR2_WFxT_SHIFT,4 ,0 ), ARM64_FTR_END, };
@@ -2516,10 +2516,10 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .type = ARM64_CPUCAP_SYSTEM_FEATURE, .sys_reg = SYS_ID_AA64ISAR2_EL1, .sign = FTR_UNSIGNED, - .field_pos = ID_AA64ISAR2_WFXT_SHIFT, + .field_pos = ID_AA64ISAR2_WFxT_SHIFT, .field_width = 4, .matches = has_cpuid_feature, - .min_field_value = ID_AA64ISAR2_WFXT_SUPPORTED, + .min_field_value = ID_AA64ISAR2_WFxT_IMP, }, {}, };
@@ -2654,7 +2654,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {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 ),HWCAP_CAP (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_RPRES_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_HWCAP ,KERNEL_HWCAP_RPRES ), -HWCAP_CAP (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_WFXT_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ISAR2_WFXT_SUPPORTED ,CAP_HWCAP ,KERNEL_HWCAP_WFXT ), +HWCAP_CAP (SYS_ID_AA64ISAR2_EL1 , ID_AA64ISAR2_WFxT_SHIFT,4 ,FTR_UNSIGNED , ID_AA64ISAR2_WFxT_IMP,CAP_HWCAP ,KERNEL_HWCAP_WFXT ), #ifdef CONFIG_ARM64_SMEHWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_SME_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_SME ,CAP_HWCAP ,KERNEL_HWCAP_SME ), HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_FA64_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_FA64, CAP_HWCAP, KERNEL_HWCAP_SME_FA64),
arch/arm64/kvm/sys_regs.c +1 -1
@@ -1146,7 +1146,7 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu, val &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR2_APA3 ) |ARM64_FEATURE_MASK (ID_AA64ISAR2_GPA3 ));if (!cpus_have_final_cap (ARM64_HAS_WFXT )) - val &= ~ARM64_FEATURE_MASK (ID_AA64ISAR2_WFXT ); + val &= ~ARM64_FEATURE_MASK (ID_AA64ISAR2_WFxT);break ;case SYS_ID_AA64DFR0_EL1 :/* Limit debug to ARMv8.0 */
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 12/26 arm64/sysreg: Remove defines for RPRES enumeration
In reply to Mark BrownWe have defines for the RPRES enumeration in ID_AA64ISAR2 which do not follow our normal conventions. Since these defines are never used just remove them. No functional changes.
--- arch/arm64/include/asm/sysreg.h | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -2
@@ -744,8 +744,6 @@#define ID_AA64ISAR2_RPRES_SHIFT 4#define ID_AA64ISAR2_WFxT_SHIFT 0 -#define ID_AA64ISAR2_RPRES_8BIT 0x0 -#define ID_AA64ISAR2_RPRES_12BIT 0x1/* * Value 0x1 has been removed from the architecture, and is * reserved, but has not yet been removed from the ARM ARM
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 10/26 arm64/sysreg: Standardise naming for ID_AA64SMFR0_EL1 enums
In reply to Mark BrownWe have a series of defines for enumeration values we test for in the fields in ID_AA64SMFR0_EL1 which do not follow our usual convention of including the EL1 in the name and having _IMP at the end of the basic "feature present" define. In preparation for automatic register generation bring the defines into sync with convention, no functional change.
--- arch/arm64/include/asm/el2_setup.h | 2 +- arch/arm64/include/asm/sysreg.h | 30 ++++++++++++++-------------- arch/arm64/kernel/cpufeature.c | 32 +++++++++++++++--------------- 3 files changed, 32 insertions(+), 32 deletions(-)
arch/arm64/include/asm/el2_setup.h +1 -1
@@ -161,7 +161,7 @@ mov x1, #0 // SMCR controlsmrs_s x2,SYS_ID_AA64SMFR0_EL1 - ubfx x2, x2, #ID_AA64SMFR0_FA64_SHIFT, #1 // Full FP in SM? + ubfx x2, x2, #ID_AA64SMFR0_EL1_FA64_SHIFT, #1 // Full FP in SM? cbz x2, .Lskip_sme_fa64_\@ orr x1, x1, SMCR_ELx_FA64_MASK
arch/arm64/include/asm/sysreg.h +15 -15
@@ -834,21 +834,21 @@#define ID_AA64ZFR0_SVEVER_SVE2 0x1/* id_aa64smfr0 */ -#define ID_AA64SMFR0_FA64_SHIFT 63 -#define ID_AA64SMFR0_I16I64_SHIFT 52 -#define ID_AA64SMFR0_F64F64_SHIFT 48 -#define ID_AA64SMFR0_I8I32_SHIFT 36 -#define ID_AA64SMFR0_F16F32_SHIFT 35 -#define ID_AA64SMFR0_B16F32_SHIFT 34 -#define ID_AA64SMFR0_F32F32_SHIFT 32 - -#define ID_AA64SMFR0_FA64 0x1 -#define ID_AA64SMFR0_I16I64 0xf -#define ID_AA64SMFR0_F64F64 0x1 -#define ID_AA64SMFR0_I8I32 0xf -#define ID_AA64SMFR0_F16F32 0x1 -#define ID_AA64SMFR0_B16F32 0x1 -#define ID_AA64SMFR0_F32F32 0x1 +#define ID_AA64SMFR0_EL1_FA64_SHIFT 63 +#define ID_AA64SMFR0_EL1_I16I64_SHIFT 52 +#define ID_AA64SMFR0_EL1_F64F64_SHIFT 48 +#define ID_AA64SMFR0_EL1_I8I32_SHIFT 36 +#define ID_AA64SMFR0_EL1_F16F32_SHIFT 35 +#define ID_AA64SMFR0_EL1_B16F32_SHIFT 34 +#define ID_AA64SMFR0_EL1_F32F32_SHIFT 32 + +#define ID_AA64SMFR0_EL1_FA64_IMP 0x1 +#define ID_AA64SMFR0_EL1_I16I64_IMP 0xf +#define ID_AA64SMFR0_EL1_F64F64_IMP 0x1 +#define ID_AA64SMFR0_EL1_I8I32_IMP 0xf +#define ID_AA64SMFR0_EL1_F16F32_IMP 0x1 +#define ID_AA64SMFR0_EL1_B16F32_IMP 0x1 +#define ID_AA64SMFR0_EL1_F32F32_IMP 0x1/* id_aa64mmfr0 */ #define ID_AA64MMFR0_ECV_SHIFT 60
arch/arm64/kernel/cpufeature.c +16 -16
@@ -298,19 +298,19 @@ static const struct arm64_ftr_bits ftr_id_aa64zfr0[] = {static const struct arm64_ftr_bits ftr_id_aa64smfr0[] = {ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SME ), -FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_FA64_SHIFT ,1 ,0 ), +FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_EL1_FA64_SHIFT ,1 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SME ), -FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_I16I64_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_EL1_I16I64_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SME ), -FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_F64F64_SHIFT ,1 ,0 ), +FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_EL1_F64F64_SHIFT ,1 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SME ), -FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_I8I32_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_EL1_I8I32_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SME ), -FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_F16F32_SHIFT ,1 ,0 ), +FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_EL1_F16F32_SHIFT ,1 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SME ), -FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_B16F32_SHIFT ,1 ,0 ), +FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_EL1_B16F32_SHIFT ,1 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SME ), -FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_F32F32_SHIFT ,1 ,0 ), +FTR_STRICT ,FTR_EXACT ,ID_AA64SMFR0_EL1_F32F32_SHIFT ,1 ,0 ),ARM64_FTR_END , };
@@ -2503,9 +2503,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .capability = ARM64_SME_FA64, .sys_reg = SYS_ID_AA64SMFR0_EL1, .sign = FTR_UNSIGNED, - .field_pos = ID_AA64SMFR0_FA64_SHIFT, + .field_pos = ID_AA64SMFR0_EL1_FA64_SHIFT, .field_width = 1, - .min_field_value = ID_AA64SMFR0_FA64, + .min_field_value = ID_AA64SMFR0_EL1_FA64_IMP, .matches = has_cpuid_feature, .cpu_enable = fa64_kernel_enable, },
@@ -2657,13 +2657,13 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { HWCAP_CAP(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_WFxT_SHIFT, 4, FTR_UNSIGNED, ID_AA64ISAR2_WFxT_IMP, CAP_HWCAP, KERNEL_HWCAP_WFXT),#ifdef CONFIG_ARM64_SME HWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_SME_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_SME ,CAP_HWCAP ,KERNEL_HWCAP_SME ), -HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_FA64_SHIFT ,1 ,FTR_UNSIGNED ,ID_AA64SMFR0_FA64 ,CAP_HWCAP ,KERNEL_HWCAP_SME_FA64 ), -HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_I16I64_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64SMFR0_I16I64 ,CAP_HWCAP ,KERNEL_HWCAP_SME_I16I64 ), -HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_F64F64_SHIFT ,1 ,FTR_UNSIGNED ,ID_AA64SMFR0_F64F64 ,CAP_HWCAP ,KERNEL_HWCAP_SME_F64F64 ), -HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_I8I32_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64SMFR0_I8I32 ,CAP_HWCAP ,KERNEL_HWCAP_SME_I8I32 ), -HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_F16F32_SHIFT ,1 ,FTR_UNSIGNED ,ID_AA64SMFR0_F16F32 ,CAP_HWCAP ,KERNEL_HWCAP_SME_F16F32 ), -HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_B16F32_SHIFT ,1 ,FTR_UNSIGNED ,ID_AA64SMFR0_B16F32 ,CAP_HWCAP ,KERNEL_HWCAP_SME_B16F32 ), - HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_F32F32_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_F32F32, CAP_HWCAP, KERNEL_HWCAP_SME_F32F32), +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 ), +HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_EL1_I8I32_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64SMFR0_EL1_I8I32_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SME_I8I32 ), +HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_EL1_F16F32_SHIFT ,1 ,FTR_UNSIGNED ,ID_AA64SMFR0_EL1_F16F32_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SME_F16F32 ), +HWCAP_CAP (SYS_ID_AA64SMFR0_EL1 ,ID_AA64SMFR0_EL1_B16F32_SHIFT ,1 ,FTR_UNSIGNED ,ID_AA64SMFR0_EL1_B16F32_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SME_B16F32 ), + HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_F32F32_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_EL1_F32F32_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_F32F32), #endif /* CONFIG_ARM64_SME */ {}, };
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 11/26 arm64/sysreg: Standardise naming for ID_AA64ZFR0_EL1 fields
In reply to Mark BrownThe various defines for bitfields in ID_AA64ZFR0_EL1 do not follow our conventions for register field names, they omit the _EL1, they don't use specific defines for enumeration values and they don't follow the naming in the architecture in some cases. In preparation for automatic generation bring them into line with convention. No functional changes.
--- arch/arm64/include/asm/sysreg.h | 40 ++++++++++++++++----------------- arch/arm64/kernel/cpufeature.c | 38 +++++++++++++++---------------- 2 files changed, 39 insertions(+), 39 deletions(-)
arch/arm64/include/asm/sysreg.h +20 -20
@@ -812,26 +812,26 @@#define ID_AA64PFR1_MTE_ASYMM 0x3/* id_aa64zfr0 */ -#define ID_AA64ZFR0_F64MM_SHIFT 56 -#define ID_AA64ZFR0_F32MM_SHIFT 52 -#define ID_AA64ZFR0_I8MM_SHIFT 44 -#define ID_AA64ZFR0_SM4_SHIFT 40 -#define ID_AA64ZFR0_SHA3_SHIFT 32 -#define ID_AA64ZFR0_BF16_SHIFT 20 -#define ID_AA64ZFR0_BITPERM_SHIFT 16 -#define ID_AA64ZFR0_AES_SHIFT 4 -#define ID_AA64ZFR0_SVEVER_SHIFT 0 - -#define ID_AA64ZFR0_F64MM 0x1 -#define ID_AA64ZFR0_F32MM 0x1 -#define ID_AA64ZFR0_I8MM 0x1 -#define ID_AA64ZFR0_BF16 0x1 -#define ID_AA64ZFR0_SM4 0x1 -#define ID_AA64ZFR0_SHA3 0x1 -#define ID_AA64ZFR0_BITPERM 0x1 -#define ID_AA64ZFR0_AES 0x1 -#define ID_AA64ZFR0_AES_PMULL 0x2 -#define ID_AA64ZFR0_SVEVER_SVE2 0x1 +#define ID_AA64ZFR0_EL1_F64MM_SHIFT 56 +#define ID_AA64ZFR0_EL1_F32MM_SHIFT 52 +#define ID_AA64ZFR0_EL1_I8MM_SHIFT 44 +#define ID_AA64ZFR0_EL1_SM4_SHIFT 40 +#define ID_AA64ZFR0_EL1_SHA3_SHIFT 32 +#define ID_AA64ZFR0_EL1_BF16_SHIFT 20 +#define ID_AA64ZFR0_EL1_BitPerm_SHIFT 16 +#define ID_AA64ZFR0_EL1_AES_SHIFT 4 +#define ID_AA64ZFR0_EL1_SVEver_SHIFT 0 + +#define ID_AA64ZFR0_EL1_F64MM_IMP 0x1 +#define ID_AA64ZFR0_EL1_F32MM_IMP 0x1 +#define ID_AA64ZFR0_EL1_I8MM_IMP 0x1 +#define ID_AA64ZFR0_EL1_BF16_IMP 0x1 +#define ID_AA64ZFR0_EL1_SM4_IMP 0x1 +#define ID_AA64ZFR0_EL1_SHA3_IMP 0x1 +#define ID_AA64ZFR0_EL1_BitPerm_IMP 0x1 +#define ID_AA64ZFR0_EL1_AES_IMP 0x1 +#define ID_AA64ZFR0_EL1_AES_PMULL128 0x2 +#define ID_AA64ZFR0_EL1_SVEver_SVE2 0x1/* id_aa64smfr0 */ #define ID_AA64SMFR0_EL1_FA64_SHIFT 63
arch/arm64/kernel/cpufeature.c +19 -19
@@ -276,23 +276,23 @@ static const struct arm64_ftr_bits ftr_id_aa64pfr1[] = {static const struct arm64_ftr_bits ftr_id_aa64zfr0[] = {ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_F64MM_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_EL1_F64MM_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_F32MM_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_EL1_F32MM_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_I8MM_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_EL1_I8MM_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_SM4_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_EL1_SM4_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_SHA3_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_EL1_SHA3_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_BF16_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_EL1_BF16_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_BITPERM_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE , ID_AA64ZFR0_EL1_BitPerm_SHIFT,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_AES_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_EL1_AES_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_SVE ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ZFR0_SVEVER_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE , ID_AA64ZFR0_EL1_SVEver_SHIFT,4 ,0 ),ARM64_FTR_END , };
@@ -2628,16 +2628,16 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { HWCAP_CAP(SYS_ID_AA64MMFR2_EL1, ID_AA64MMFR2_AT_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_USCAT),#ifdef CONFIG_ARM64_SVE HWCAP_CAP (SYS_ID_AA64PFR0_EL1 ,ID_AA64PFR0_SVE_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR0_SVE ,CAP_HWCAP ,KERNEL_HWCAP_SVE ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_SVEVER_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_SVEVER_SVE2 ,CAP_HWCAP ,KERNEL_HWCAP_SVE2 ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_AES_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_AES ,CAP_HWCAP ,KERNEL_HWCAP_SVEAES ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_AES_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_AES_PMULL ,CAP_HWCAP ,KERNEL_HWCAP_SVEPMULL ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_BITPERM_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_BITPERM ,CAP_HWCAP ,KERNEL_HWCAP_SVEBITPERM ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_BF16_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_BF16 ,CAP_HWCAP ,KERNEL_HWCAP_SVEBF16 ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_SHA3_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_SHA3 ,CAP_HWCAP ,KERNEL_HWCAP_SVESHA3 ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_SM4_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_SM4 ,CAP_HWCAP ,KERNEL_HWCAP_SVESM4 ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_I8MM_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_I8MM ,CAP_HWCAP ,KERNEL_HWCAP_SVEI8MM ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_F32MM_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_F32MM ,CAP_HWCAP ,KERNEL_HWCAP_SVEF32MM ), -HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_F64MM_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_F64MM ,CAP_HWCAP ,KERNEL_HWCAP_SVEF64MM ), +HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 , ID_AA64ZFR0_EL1_SVEver_SHIFT,4 ,FTR_UNSIGNED , ID_AA64ZFR0_EL1_SVEver_SVE2,CAP_HWCAP ,KERNEL_HWCAP_SVE2 ), +HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_EL1_AES_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_EL1_AES_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SVEAES ), +HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_EL1_AES_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_EL1_AES_PMULL128 ,CAP_HWCAP ,KERNEL_HWCAP_SVEPMULL ), +HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 , ID_AA64ZFR0_EL1_BitPerm_SHIFT,4 ,FTR_UNSIGNED , ID_AA64ZFR0_EL1_BitPerm_IMP,CAP_HWCAP ,KERNEL_HWCAP_SVEBITPERM ), +HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_EL1_BF16_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_EL1_BF16_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SVEBF16 ), +HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_EL1_SHA3_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_EL1_SHA3_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SVESHA3 ), +HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_EL1_SM4_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_EL1_SM4_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SVESM4 ), +HWCAP_CAP (SYS_ID_AA64ZFR0_EL1 ,ID_AA64ZFR0_EL1_I8MM_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64ZFR0_EL1_I8MM_IMP ,CAP_HWCAP ,KERNEL_HWCAP_SVEI8MM ), +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 ), #endifHWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_SSBS_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_SSBS_PSTATE_INSNS ,CAP_HWCAP ,KERNEL_HWCAP_SSBS ), #ifdef CONFIG_ARM64_BTI
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 13/26 arm64/sysreg: Add _EL1 into ID_AA64ISAR1_EL1 definition names
In reply to Mark BrownNormally we include the full register name in the defines for fields within registers but this has not been followed for ID registers. In preparation for automatic generation of defines add the _EL1s into the defines for ID_AA64ISAR1_EL1 to follow the convention. No functional changes.
--- arch/arm64/include/asm/asm_pointer_auth.h | 2 +- arch/arm64/include/asm/sysreg.h | 62 ++++++------- arch/arm64/kernel/cpufeature.c | 90 +++++++++---------- arch/arm64/kernel/idreg-override.c | 8 +- .../arm64/kvm/hyp/include/nvhe/fixed_config.h | 28 +++--- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 8 +- arch/arm64/kvm/sys_regs.c | 8 +- 7 files changed, 103 insertions(+), 103 deletions(-)
arch/arm64/include/asm/asm_pointer_auth.h +1 -1
@@ -59,7 +59,7 @@ alternative_else_nop_endif .macro __ptrauth_keys_init_cpu tsk, tmp1, tmp2, tmp3 mrs \tmp1, id_aa64isar1_el1 - ubfx \tmp1, \tmp1, #ID_AA64ISAR1_APA_SHIFT, #8 + ubfx \tmp1, \tmp1, #ID_AA64ISAR1_EL1_APA_SHIFT, #8 mrs_s \tmp2, SYS_ID_AA64ISAR2_EL1 ubfx \tmp2, \tmp2, #ID_AA64ISAR2_APA3_SHIFT, #4 orr \tmp1, \tmp1, \tmp2
arch/arm64/include/asm/sysreg.h +31 -31
68 lines not on this page · raw message
arch/arm64/kernel/cpufeature.c +45 -45
183 lines not on this page · raw message
arch/arm64/kernel/idreg-override.c +4 -4
@@ -63,10 +63,10 @@ static const struct ftr_set_desc isar1 __initconst = { .name = "id_aa64isar1", .override = &id_aa64isar1_override, .fields = { - { "gpi", ID_AA64ISAR1_GPI_SHIFT }, - { "gpa", ID_AA64ISAR1_GPA_SHIFT }, - { "api", ID_AA64ISAR1_API_SHIFT }, - { "apa", ID_AA64ISAR1_APA_SHIFT }, + { "gpi", ID_AA64ISAR1_EL1_GPI_SHIFT }, + { "gpa", ID_AA64ISAR1_EL1_GPA_SHIFT }, + { "api", ID_AA64ISAR1_EL1_API_SHIFT }, + { "apa", ID_AA64ISAR1_EL1_APA_SHIFT }, {} }, };
arch/arm64/kvm/hyp/include/nvhe/fixed_config.h +14 -14
@@ -176,20 +176,20 @@ )#define PVM_ID_AA64ISAR1_ALLOW (\ - ARM64_FEATURE_MASK(ID_AA64ISAR1_DPB) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_APA) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_API) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_JSCVT) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_FCMA) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_LRCPC) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_GPA) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_GPI) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_FRINTTS) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_SB) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_SPECRES) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_BF16) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_DGH) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR1_I8MM) \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_DPB) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_APA) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_API) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_JSCVT) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_FCMA) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_LRCPC) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_GPA) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_GPI) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_FRINTTS) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_SB) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_SPECRES) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_BF16) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_DGH) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_I8MM) \ )#define PVM_ID_AA64ISAR2_ALLOW (\
arch/arm64/kvm/hyp/nvhe/sys_regs.c +4 -4
@@ -173,10 +173,10 @@ static u64 get_pvm_id_aa64isar1(const struct kvm_vcpu *vcpu)u64 allow_mask =PVM_ID_AA64ISAR1_ALLOW ;if (!vcpu_has_ptrauth (vcpu)) - allow_mask &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR1_APA ) | -ARM64_FEATURE_MASK (ID_AA64ISAR1_API ) | -ARM64_FEATURE_MASK (ID_AA64ISAR1_GPA ) | -ARM64_FEATURE_MASK (ID_AA64ISAR1_GPI )); + allow_mask &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR1_EL1_APA ) | +ARM64_FEATURE_MASK (ID_AA64ISAR1_EL1_API ) | +ARM64_FEATURE_MASK (ID_AA64ISAR1_EL1_GPA ) | +ARM64_FEATURE_MASK (ID_AA64ISAR1_EL1_GPI ));return id_aa64isar1_el1_sys_val & allow_mask; }
arch/arm64/kvm/sys_regs.c +4 -4
@@ -1136,10 +1136,10 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu,break ;case SYS_ID_AA64ISAR1_EL1 :if (!vcpu_has_ptrauth (vcpu)) - val &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR1_APA ) | -ARM64_FEATURE_MASK (ID_AA64ISAR1_API ) | -ARM64_FEATURE_MASK (ID_AA64ISAR1_GPA ) | -ARM64_FEATURE_MASK (ID_AA64ISAR1_GPI )); + val &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR1_EL1_APA ) | +ARM64_FEATURE_MASK (ID_AA64ISAR1_EL1_API ) | +ARM64_FEATURE_MASK (ID_AA64ISAR1_EL1_GPA ) | +ARM64_FEATURE_MASK (ID_AA64ISAR1_EL1_GPI ));break ;case SYS_ID_AA64ISAR2_EL1 :if (!vcpu_has_ptrauth (vcpu))
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 14/26 arm64/sysreg: Add _EL1 into ID_AA64ISAR2_EL1 definition names
In reply to Mark BrownNormally we include the full register name in the defines for fields within registers but this has not been followed for ID registers. In preparation for automatic generation of defines add the _EL1s into the defines for ID_AA64ISAR2_EL1 to follow the convention. No functional changes.
--- arch/arm64/include/asm/asm_pointer_auth.h | 2 +- arch/arm64/include/asm/cpufeature.h | 2 +- arch/arm64/include/asm/sysreg.h | 34 +++++++++---------- arch/arm64/kernel/cpufeature.c | 34 +++++++++---------- arch/arm64/kernel/idreg-override.c | 4 +-- .../arm64/kvm/hyp/include/nvhe/fixed_config.h | 4 +-- arch/arm64/kvm/hyp/nvhe/sys_regs.c | 4 +-- arch/arm64/kvm/sys_regs.c | 6 ++-- 8 files changed, 45 insertions(+), 45 deletions(-)
arch/arm64/include/asm/asm_pointer_auth.h +1 -1
@@ -61,7 +61,7 @@ alternative_else_nop_endif mrs \tmp1, id_aa64isar1_el1 ubfx \tmp1, \tmp1, #ID_AA64ISAR1_EL1_APA_SHIFT, #8 mrs_s \tmp2, SYS_ID_AA64ISAR2_EL1 - ubfx \tmp2, \tmp2, #ID_AA64ISAR2_APA3_SHIFT, #4 + ubfx \tmp2, \tmp2, #ID_AA64ISAR2_EL1_APA3_SHIFT, #4 orr \tmp1, \tmp1, \tmp2 cbz \tmp1, .Lno_addr_auth\@ mov_q \tmp1, (SCTLR_ELx_ENIA | SCTLR_ELx_ENIB | \
arch/arm64/include/asm/cpufeature.h +1 -1
@@ -673,7 +673,7 @@ static inline bool supports_clearbhb(int scope) isar2 =read_sanitised_ftr_reg (SYS_ID_AA64ISAR2_EL1 );return cpuid_feature_extract_unsigned_field (isar2, -ID_AA64ISAR2_BC_SHIFT ); +ID_AA64ISAR2_EL1_BC_SHIFT ); }const struct cpumask *system_32bit_el0_cpumask (void );
arch/arm64/include/asm/sysreg.h +17 -17
@@ -738,29 +738,29 @@#define ID_AA64ISAR1_EL1_GPI_IMP 0x1/* id_aa64isar2 */ -#define ID_AA64ISAR2_BC_SHIFT 28 -#define ID_AA64ISAR2_APA3_SHIFT 12 -#define ID_AA64ISAR2_GPA3_SHIFT 8 -#define ID_AA64ISAR2_RPRES_SHIFT 4 -#define ID_AA64ISAR2_WFxT_SHIFT 0 +#define ID_AA64ISAR2_EL1_BC_SHIFT 28 +#define ID_AA64ISAR2_EL1_APA3_SHIFT 12 +#define ID_AA64ISAR2_EL1_GPA3_SHIFT 8 +#define ID_AA64ISAR2_EL1_RPRES_SHIFT 4 +#define ID_AA64ISAR2_EL1_WFxT_SHIFT 0/* * Value 0x1 has been removed from the architecture, and is * reserved, but has not yet been removed from the ARM ARM * as of ARM DDI 0487G.b. */ -#define ID_AA64ISAR2_WFxT_NI 0x0 -#define ID_AA64ISAR2_WFxT_IMP 0x2 - -#define ID_AA64ISAR2_APA3_NI 0x0 -#define ID_AA64ISAR2_APA3_PAuth 0x1 -#define ID_AA64ISAR2_APA3_EPAC 0x2 -#define ID_AA64ISAR2_APA3_PAuth2 0x3 -#define ID_AA64ISAR2_APA3_FPAC 0x4 -#define ID_AA64ISAR2_APA3_FPACCOMBINE 0x5 - -#define ID_AA64ISAR2_GPA3_NI 0x0 -#define ID_AA64ISAR2_GPA3_IMP 0x1 +#define ID_AA64ISAR2_EL1_WFxT_NI 0x0 +#define ID_AA64ISAR2_EL1_WFxT_IMP 0x2 + +#define ID_AA64ISAR2_EL1_APA3_NI 0x0 +#define ID_AA64ISAR2_EL1_APA3_PAuth 0x1 +#define ID_AA64ISAR2_EL1_APA3_EPAC 0x2 +#define ID_AA64ISAR2_EL1_APA3_PAuth2 0x3 +#define ID_AA64ISAR2_EL1_APA3_FPAC 0x4 +#define ID_AA64ISAR2_EL1_APA3_FPACCOMBINE 0x5 + +#define ID_AA64ISAR2_EL1_GPA3_NI 0x0 +#define ID_AA64ISAR2_EL1_GPA3_IMP 0x1/* id_aa64pfr0 */ #define ID_AA64PFR0_CSV3_SHIFT 60
arch/arm64/kernel/cpufeature.c +17 -17
@@ -231,13 +231,13 @@ static const struct arm64_ftr_bits ftr_id_aa64isar1[] = { };static const struct arm64_ftr_bits ftr_id_aa64isar2[] = { -ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_HIGHER_SAFE ,ID_AA64ISAR2_BC_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_HIDDEN ,FTR_STRICT ,FTR_HIGHER_SAFE ,ID_AA64ISAR2_EL1_BC_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_PTR_AUTH ), -FTR_STRICT ,FTR_EXACT ,ID_AA64ISAR2_APA3_SHIFT ,4 ,0 ), +FTR_STRICT ,FTR_EXACT ,ID_AA64ISAR2_EL1_APA3_SHIFT ,4 ,0 ),ARM64_FTR_BITS (FTR_VISIBLE_IF_IS_ENABLED (CONFIG_ARM64_PTR_AUTH ), -FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ISAR2_GPA3_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_AA64ISAR2_RPRES_SHIFT ,4 ,0 ), -ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE , ID_AA64ISAR2_WFxT_SHIFT,4 ,0 ), +FTR_STRICT ,FTR_LOWER_SAFE ,ID_AA64ISAR2_EL1_GPA3_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE ,ID_AA64ISAR2_EL1_RPRES_SHIFT ,4 ,0 ), +ARM64_FTR_BITS (FTR_VISIBLE ,FTR_NONSTRICT ,FTR_LOWER_SAFE , ID_AA64ISAR2_EL1_WFxT_SHIFT,4 ,0 ),ARM64_FTR_END , };
@@ -2326,9 +2326,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .type = ARM64_CPUCAP_BOOT_CPU_FEATURE, .sys_reg = SYS_ID_AA64ISAR2_EL1, .sign = FTR_UNSIGNED, - .field_pos = ID_AA64ISAR2_APA3_SHIFT, + .field_pos = ID_AA64ISAR2_EL1_APA3_SHIFT, .field_width = 4, - .min_field_value = ID_AA64ISAR2_APA3_PAuth, + .min_field_value = ID_AA64ISAR2_EL1_APA3_PAuth, .matches = has_address_auth_cpucap, }, {
@@ -2364,9 +2364,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .type = ARM64_CPUCAP_SYSTEM_FEATURE, .sys_reg = SYS_ID_AA64ISAR2_EL1, .sign = FTR_UNSIGNED, - .field_pos = ID_AA64ISAR2_GPA3_SHIFT, + .field_pos = ID_AA64ISAR2_EL1_GPA3_SHIFT, .field_width = 4, - .min_field_value = ID_AA64ISAR2_GPA3_IMP, + .min_field_value = ID_AA64ISAR2_EL1_GPA3_IMP, .matches = has_cpuid_feature, }, {
@@ -2516,10 +2516,10 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .type = ARM64_CPUCAP_SYSTEM_FEATURE, .sys_reg = SYS_ID_AA64ISAR2_EL1, .sign = FTR_UNSIGNED, - .field_pos = ID_AA64ISAR2_WFxT_SHIFT, + .field_pos = ID_AA64ISAR2_EL1_WFxT_SHIFT, .field_width = 4, .matches = has_cpuid_feature, - .min_field_value = ID_AA64ISAR2_WFxT_IMP, + .min_field_value = ID_AA64ISAR2_EL1_WFxT_IMP, }, {}, };
@@ -2565,8 +2565,8 @@ static const struct arm64_cpu_capabilities ptr_auth_hwcap_addr_matches[] = { ID_AA64ISAR1_EL1_APA_PAuth) }, { -HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_APA3_SHIFT , -4 ,FTR_UNSIGNED , ID_AA64ISAR2_APA3_PAuth) +HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_EL1_APA3_SHIFT , +4 ,FTR_UNSIGNED , ID_AA64ISAR2_EL1_APA3_PAuth) }, { HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_API_SHIFT,
@@ -2581,8 +2581,8 @@ static const struct arm64_cpu_capabilities ptr_auth_hwcap_gen_matches[] = { 4, FTR_UNSIGNED, ID_AA64ISAR1_EL1_GPA_IMP) }, { -HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_GPA3_SHIFT , -4 ,FTR_UNSIGNED ,ID_AA64ISAR2_GPA3_IMP ) +HWCAP_CPUID_MATCH (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_EL1_GPA3_SHIFT , +4 ,FTR_UNSIGNED ,ID_AA64ISAR2_EL1_GPA3_IMP ) }, { HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_GPI_SHIFT,
@@ -2653,8 +2653,8 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {#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 ), -HWCAP_CAP (SYS_ID_AA64ISAR2_EL1 ,ID_AA64ISAR2_RPRES_SHIFT ,4 ,FTR_UNSIGNED ,1 ,CAP_HWCAP ,KERNEL_HWCAP_RPRES ), -HWCAP_CAP (SYS_ID_AA64ISAR2_EL1 , ID_AA64ISAR2_WFxT_SHIFT,4 ,FTR_UNSIGNED , ID_AA64ISAR2_WFxT_IMP,CAP_HWCAP ,KERNEL_HWCAP_WFXT ), +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_SMEHWCAP_CAP (SYS_ID_AA64PFR1_EL1 ,ID_AA64PFR1_SME_SHIFT ,4 ,FTR_UNSIGNED ,ID_AA64PFR1_SME ,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),
arch/arm64/kernel/idreg-override.c +2 -2
@@ -75,8 +75,8 @@ static const struct ftr_set_desc isar2 __initconst = { .name = "id_aa64isar2", .override = &id_aa64isar2_override, .fields = { - { "gpa3", ID_AA64ISAR2_GPA3_SHIFT }, - { "apa3", ID_AA64ISAR2_APA3_SHIFT }, + { "gpa3", ID_AA64ISAR2_EL1_GPA3_SHIFT }, + { "apa3", ID_AA64ISAR2_EL1_APA3_SHIFT }, {} }, };
arch/arm64/kvm/hyp/include/nvhe/fixed_config.h +2 -2
@@ -193,8 +193,8 @@ )#define PVM_ID_AA64ISAR2_ALLOW (\ - ARM64_FEATURE_MASK(ID_AA64ISAR2_GPA3) | \ - ARM64_FEATURE_MASK(ID_AA64ISAR2_APA3) \ + ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_GPA3) | \ + ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_APA3) \ )u64 pvm_read_id_reg (const struct kvm_vcpu *vcpu,u32 id);
arch/arm64/kvm/hyp/nvhe/sys_regs.c +2 -2
@@ -186,8 +186,8 @@ static u64 get_pvm_id_aa64isar2(const struct kvm_vcpu *vcpu)u64 allow_mask =PVM_ID_AA64ISAR2_ALLOW ;if (!vcpu_has_ptrauth (vcpu)) - allow_mask &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR2_APA3 ) | -ARM64_FEATURE_MASK (ID_AA64ISAR2_GPA3 )); + allow_mask &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR2_EL1_APA3 ) | +ARM64_FEATURE_MASK (ID_AA64ISAR2_EL1_GPA3 ));return id_aa64isar2_el1_sys_val & allow_mask; }
arch/arm64/kvm/sys_regs.c +3 -3
@@ -1143,10 +1143,10 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu,break ;case SYS_ID_AA64ISAR2_EL1 :if (!vcpu_has_ptrauth (vcpu)) - val &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR2_APA3 ) | -ARM64_FEATURE_MASK (ID_AA64ISAR2_GPA3 )); + val &= ~(ARM64_FEATURE_MASK (ID_AA64ISAR2_EL1_APA3 ) | +ARM64_FEATURE_MASK (ID_AA64ISAR2_EL1_GPA3 ));if (!cpus_have_final_cap (ARM64_HAS_WFXT )) - val &= ~ARM64_FEATURE_MASK (ID_AA64ISAR2_WFxT); + val &= ~ARM64_FEATURE_MASK (ID_AA64ISAR2_EL1_WFxT);break ;case SYS_ID_AA64DFR0_EL1 :/* Limit debug to ARMv8.0 */
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 16/26 arm64/sysreg: Convert DCZID_EL0 to automatic generation
In reply to Mark BrownConvert DCZID_EL0 to automatic register generation as per DDI0487H.a, no functional change.
--- arch/arm64/include/asm/sysreg.h | 5 ----- arch/arm64/tools/sysreg | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -5
@@ -461,8 +461,6 @@#define SMIDR_EL1_SMPS_SHIFT 15#define SMIDR_EL1_AFFINITY_SHIFT 0 -#define SYS_DCZID_EL0 sys_reg(3, 3, 0, 0, 7) -#define SYS_RNDR_EL0 sys_reg(3, 3, 2, 4, 0)#define SYS_RNDRRS_EL0 sys_reg(3, 3, 2, 4, 1)
@@ -1081,9 +1079,6 @@#define MVFR2_FPMISC_SHIFT 4#define MVFR2_SIMDMISC_SHIFT 0 -#define DCZID_EL0_DZP_SHIFT 4 -#define DCZID_EL0_BS_SHIFT 0 -#define CPACR_EL1_FPEN_EL1EN (BIT(20))/* enable EL1 access */ #define CPACR_EL1_FPEN_EL0EN (BIT(21))/* enable EL0 access, if EL1EN set */
arch/arm64/tools/sysreg +6 -0
@@ -293,6 +293,12 @@ Res0 13:4 Field 3:0 IminLine EndSysreg +Sysreg DCZID_EL0 3 3 0 0 7 +Res0 63:5 +Field 4 DZP +Field 3:0 BS +EndSysreg + Sysreg SVCR 3 3 4 2 2 Res0 63:2 Field 1 ZA
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 15/26 arm64/sysreg: Convert CTR_EL0 to automatic generation
In reply to Mark BrownConvert CTR_EL0 to automatic register generation as per DDI0487H.a, no functional change.
--- arch/arm64/include/asm/sysreg.h | 17 ----------------- arch/arm64/tools/sysreg | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 17 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -17
@@ -461,7 +461,6 @@#define SMIDR_EL1_SMPS_SHIFT 15#define SMIDR_EL1_AFFINITY_SHIFT 0 -#define SYS_CTR_EL0 sys_reg(3, 3, 0, 0, 1)#define SYS_DCZID_EL0 sys_reg(3, 3, 0, 0, 7)#define SYS_RNDR_EL0 sys_reg(3, 3, 2, 4, 0)
@@ -1082,22 +1081,6 @@#define MVFR2_FPMISC_SHIFT 4#define MVFR2_SIMDMISC_SHIFT 0 -#define CTR_EL0_L1Ip_VPIPT 0 -#define CTR_EL0_L1Ip_AIVIVT 1 -#define CTR_EL0_L1Ip_VIPT 2 -#define CTR_EL0_L1Ip_PIPT 3 - -#define CTR_EL0_L1Ip_SHIFT 14 -#define CTR_EL0_L1Ip_MASK 3 -#define CTR_EL0_DminLine_SHIFT 16 -#define CTR_EL0_IminLine_SHIFT 0 -#define CTR_EL0_IminLine_MASK 0xf -#define CTR_EL0_ERG_SHIFT 20 -#define CTR_EL0_CWG_SHIFT 24 -#define CTR_EL0_CWG_MASK 15 -#define CTR_EL0_IDC_SHIFT 28 -#define CTR_EL0_DIC_SHIFT 29 -#define DCZID_EL0_DZP_SHIFT 4#define DCZID_EL0_BS_SHIFT 0
arch/arm64/tools/sysreg +20 -0
@@ -273,6 +273,26 @@ Field 3:1 Level Field 0 InD EndSysreg +Sysreg CTR_EL0 3 3 0 0 1 +Res0 63:38 +Field 37:32 TminLine +Res1 31 +Res0 30 +Field 29 DIC +Field 28 IDC +Field 27:24 CWG +Field 23:20 ERG +Field 19:16 DminLine +Enum 15:14 L1Ip + 0b00 VPIPT + 0b01 AIVIVT + 0b10 VIPT + 0b11 PIPT +EndEnum +Res0 13:4 +Field 3:0 IminLine +EndSysreg + Sysreg SVCR 3 3 4 2 2 Res0 63:2 Field 1 ZA
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 17/26 arm64/sysreg: Convert GMID to automatic generation
In reply to Mark BrownAutomatically generate the register definitions for GMID as per DDI0487H.a, no functional change.
--- arch/arm64/include/asm/sysreg.h | 1 - arch/arm64/tools/sysreg | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm64/include/asm/sysreg.h +0 -1
@@ -454,7 +454,6 @@#define SYS_CNTKCTL_EL1 sys_reg(3, 0, 14, 1, 0)#define SYS_CCSIDR_EL1 sys_reg(3, 1, 0, 0, 0) -#define SYS_GMID_EL1 sys_reg(3, 1, 0, 0, 4)#define SYS_AIDR_EL1 sys_reg(3, 1, 0, 0, 7)#define SMIDR_EL1_IMPLEMENTER_SHIFT 24
arch/arm64/tools/sysreg +5 -0
@@ -257,6 +257,11 @@ Field 5:3 Ctype2 Field 2:0 Ctype1 EndSysreg +Sysreg GMID_EL1 3 1 0 0 4 +Res0 63:4 +Field 3:0 BS +EndSysreg + Sysreg SMIDR_EL1 3 1 0 0 6 Res0 63:32 Field 31:24 IMPLEMENTER
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 19/26 arm64/sysreg: Convert ID_AA64ISAR2_EL1 to automatic generation
In reply to Mark BrownAutomatically generate defines for ID_AA64ISAR2_EL1, using the definitions in DDI0487H.a. No functional changes.
--- arch/arm64/include/asm/sysreg.h | 27 --------------------------- arch/arm64/tools/sysreg | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 27 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -27
@@ -201,8 +201,6 @@#define SYS_ID_AA64AFR0_EL1 sys_reg(3, 0, 0, 5, 4)#define SYS_ID_AA64AFR1_EL1 sys_reg(3, 0, 0, 5, 5) -#define SYS_ID_AA64ISAR2_EL1 sys_reg(3, 0, 0, 6, 2) -#define SYS_ID_AA64MMFR0_EL1 sys_reg(3, 0, 0, 7, 0)#define SYS_ID_AA64MMFR1_EL1 sys_reg(3, 0, 0, 7, 1)#define SYS_ID_AA64MMFR2_EL1 sys_reg(3, 0, 0, 7, 2)
@@ -699,31 +697,6 @@/* Position the attr at the correct index */ #define MAIR_ATTRIDX (attr, idx) ((attr) << ((idx) * 8)) -/* id_aa64isar2 */ -#define ID_AA64ISAR2_EL1_BC_SHIFT 28 -#define ID_AA64ISAR2_EL1_APA3_SHIFT 12 -#define ID_AA64ISAR2_EL1_GPA3_SHIFT 8 -#define ID_AA64ISAR2_EL1_RPRES_SHIFT 4 -#define ID_AA64ISAR2_EL1_WFxT_SHIFT 0 - -/* -* Value 0x1 has been removed from the architecture, and is -* reserved, but has not yet been removed from the ARM ARM -* as of ARM DDI 0487G.b. -*/ -#define ID_AA64ISAR2_EL1_WFxT_NI 0x0 -#define ID_AA64ISAR2_EL1_WFxT_IMP 0x2 - -#define ID_AA64ISAR2_EL1_APA3_NI 0x0 -#define ID_AA64ISAR2_EL1_APA3_PAuth 0x1 -#define ID_AA64ISAR2_EL1_APA3_EPAC 0x2 -#define ID_AA64ISAR2_EL1_APA3_PAuth2 0x3 -#define ID_AA64ISAR2_EL1_APA3_FPAC 0x4 -#define ID_AA64ISAR2_EL1_APA3_FPACCOMBINE 0x5 - -#define ID_AA64ISAR2_EL1_GPA3_NI 0x0 -#define ID_AA64ISAR2_EL1_GPA3_IMP 0x1 -/* id_aa64pfr0 */ #define ID_AA64PFR0_CSV3_SHIFT 60#define ID_AA64PFR0_CSV2_SHIFT 56
arch/arm64/tools/sysreg +33 -0
@@ -193,8 +193,41 @@ Enum 3:0 DPB 0b0010 DPB2 EndEnum EndSysreg + +Sysreg ID_AA64ISAR2_EL1 3 0 0 6 2 +Res0 63:28 +Enum 27:24 PAC_frac + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 23:20 BC + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 19:16 MOPS + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 15:12 APA3 + 0b0000 NI + 0b0001 PAuth + 0b0010 EPAC + 0b0011 PAuth2 + 0b0100 FPAC + 0b0101 FPACCOMBINE +EndEnum +Enum 11:8 GPA3 + 0b0000 NI 0b0001 IMP EndEnum +Enum 7:4 RPRES + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 3:0 WFxT + 0b0000 NI + 0b0010 IMP +EndEnum EndSysreg Sysreg SCTLR_EL1 3 0 1 0 0
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 18/26 arm64/sysreg: Convert ID_AA64ISAR1_EL1 to automatic generation
In reply to Mark BrownAutomatically generate defines for ID_AA64ISAR1_EL1, using the definitions in DDI0487H.a. No functional changes.
--- arch/arm64/include/asm/sysreg.h | 34 -------------- arch/arm64/tools/sysreg | 83 +++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 34 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -34
@@ -201,7 +201,6 @@#define SYS_ID_AA64AFR0_EL1 sys_reg(3, 0, 0, 5, 4)#define SYS_ID_AA64AFR1_EL1 sys_reg(3, 0, 0, 5, 5) -#define SYS_ID_AA64ISAR1_EL1 sys_reg(3, 0, 0, 6, 1)#define SYS_ID_AA64ISAR2_EL1 sys_reg(3, 0, 0, 6, 2)#define SYS_ID_AA64MMFR0_EL1 sys_reg(3, 0, 0, 7, 0)
@@ -700,39 +699,6 @@/* Position the attr at the correct index */ #define MAIR_ATTRIDX (attr, idx) ((attr) << ((idx) * 8)) -/* id_aa64isar1 */ -#define ID_AA64ISAR1_EL1_I8MM_SHIFT 52 -#define ID_AA64ISAR1_EL1_DGH_SHIFT 48 -#define ID_AA64ISAR1_EL1_BF16_SHIFT 44 -#define ID_AA64ISAR1_EL1_SPECRES_SHIFT 40 -#define ID_AA64ISAR1_EL1_SB_SHIFT 36 -#define ID_AA64ISAR1_EL1_FRINTTS_SHIFT 32 -#define ID_AA64ISAR1_EL1_GPI_SHIFT 28 -#define ID_AA64ISAR1_EL1_GPA_SHIFT 24 -#define ID_AA64ISAR1_EL1_LRCPC_SHIFT 20 -#define ID_AA64ISAR1_EL1_FCMA_SHIFT 16 -#define ID_AA64ISAR1_EL1_JSCVT_SHIFT 12 -#define ID_AA64ISAR1_EL1_API_SHIFT 8 -#define ID_AA64ISAR1_EL1_APA_SHIFT 5 -#define ID_AA64ISAR1_EL1_DPB_SHIFT 0 - -#define ID_AA64ISAR1_EL1_APA_NI 0x0 -#define ID_AA64ISAR1_EL1_APA_PAuth 0x1 -#define ID_AA64ISAR1_EL1_APA_ARCH_EPAC 0x2 -#define ID_AA64ISAR1_EL1_APA_Pauth2 0x3 -#define ID_AA64ISAR1_EL1_APA_FPAC 0x4 -#define ID_AA64ISAR1_EL1_APA_FPACCOMBINE 0x5 -#define ID_AA64ISAR1_EL1_API_NI 0x0 -#define ID_AA64ISAR1_EL1_API_PAuth 0x1 -#define ID_AA64ISAR1_EL1_API_EPAC 0x2 -#define ID_AA64ISAR1_EL1_API_PAuth2 0x3 -#define ID_AA64ISAR1_EL1_API_FPAC 0x4 -#define ID_AA64ISAR1_EL1_API_FPACCOMBINE 0x5 -#define ID_AA64ISAR1_EL1_GPA_NI 0x0 -#define ID_AA64ISAR1_EL1_GPA_IMP 0x1 -#define ID_AA64ISAR1_EL1_GPI_NI 0x0 -#define ID_AA64ISAR1_EL1_GPI_IMP 0x1 -/* id_aa64isar2 */ #define ID_AA64ISAR2_EL1_BC_SHIFT 28#define ID_AA64ISAR2_EL1_APA3_SHIFT 12
arch/arm64/tools/sysreg +83 -0
89 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 v4 20/26 arm64/sysreg: Convert LORSA_EL1 to automatic generation
In reply to Mark BrownConvert LORSA_EL1 to automatic register generation as per DDI0487H.a, no functional changes.
--- arch/arm64/include/asm/sysreg.h | 1 - arch/arm64/tools/sysreg | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-)
arch/arm64/include/asm/sysreg.h +0 -1
@@ -407,7 +407,6 @@#define SYS_MAIR_EL1 sys_reg(3, 0, 10, 2, 0)#define SYS_AMAIR_EL1 sys_reg(3, 0, 10, 3, 0) -#define SYS_LORSA_EL1 sys_reg(3, 0, 10, 4, 0)#define SYS_LOREA_EL1 sys_reg(3, 0, 10, 4, 1)#define SYS_LORN_EL1 sys_reg(3, 0, 10, 4, 2)#define SYS_LORC_EL1 sys_reg(3, 0, 10, 4, 3)
arch/arm64/tools/sysreg +8 -0
@@ -514,3 +514,11 @@ EndSysreg Sysreg TTBR1_EL1 3 0 2 0 1 Fields TTBRx_EL1 EndSysreg + +Sysreg LORSA_EL1 3 0 10 4 0 +Res0 63:52 +Field 51:16 SA +Res0 15:1 +Field 0 Valid +EndSysreg +
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 21/26 arm64/sysreg: Convert LOREA_EL1 to automatic generation
In reply to Mark BrownConvert LOREA_EL1 to automatic register generation as per DDI0487H.a, no functional changes.
--- arch/arm64/include/asm/sysreg.h | 1 - arch/arm64/tools/sysreg | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arm64/include/asm/sysreg.h +0 -1
@@ -407,7 +407,6 @@#define SYS_MAIR_EL1 sys_reg(3, 0, 10, 2, 0)#define SYS_AMAIR_EL1 sys_reg(3, 0, 10, 3, 0) -#define SYS_LOREA_EL1 sys_reg(3, 0, 10, 4, 1)#define SYS_LORN_EL1 sys_reg(3, 0, 10, 4, 2)#define SYS_LORC_EL1 sys_reg(3, 0, 10, 4, 3)#define SYS_LORID_EL1 sys_reg(3, 0, 10, 4, 7)
arch/arm64/tools/sysreg +6 -0
@@ -522,3 +522,9 @@ Res0 15:1 Field 0 Valid EndSysreg +Sysreg LOREA_EL1 3 0 10 4 1 +Res0 63:52 +Field 51:48 EA_51_48 +Field 47:16 EA_47_16 +Res0 15:0 +EndSysreg
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 22/26 arm64/sysreg: Convert LORN_EL1 to automatic generation
In reply to Mark BrownConvert LORN_EL1 to automatic register generation as per DDI0487H.a, no functional changes.
--- arch/arm64/include/asm/sysreg.h | 1 - arch/arm64/tools/sysreg | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm64/include/asm/sysreg.h +0 -1
@@ -407,7 +407,6 @@#define SYS_MAIR_EL1 sys_reg(3, 0, 10, 2, 0)#define SYS_AMAIR_EL1 sys_reg(3, 0, 10, 3, 0) -#define SYS_LORN_EL1 sys_reg(3, 0, 10, 4, 2)#define SYS_LORC_EL1 sys_reg(3, 0, 10, 4, 3)#define SYS_LORID_EL1 sys_reg(3, 0, 10, 4, 7)
arch/arm64/tools/sysreg +5 -0
@@ -528,3 +528,8 @@ Field 51:48 EA_51_48 Field 47:16 EA_47_16 Res0 15:0 EndSysreg + +Sysreg LORN_EL1 3 0 10 4 2 +Res0 63:8 +Field 7:0 Num +EndSysreg
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 23/26 arm64/sysreg: Convert LORC_EL1 to automatic generation
In reply to Mark BrownConvert LORC_EL1 to automatic register generation as per DDI0487H.a, no functional changes.
--- arch/arm64/include/asm/sysreg.h | 1 - arch/arm64/tools/sysreg | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
arch/arm64/include/asm/sysreg.h +0 -1
@@ -407,7 +407,6 @@#define SYS_MAIR_EL1 sys_reg(3, 0, 10, 2, 0)#define SYS_AMAIR_EL1 sys_reg(3, 0, 10, 3, 0) -#define SYS_LORC_EL1 sys_reg(3, 0, 10, 4, 3)#define SYS_LORID_EL1 sys_reg(3, 0, 10, 4, 7)#define SYS_VBAR_EL1 sys_reg(3, 0, 12, 0, 0)
arch/arm64/tools/sysreg +7 -0
@@ -533,3 +533,10 @@ Sysreg LORN_EL1 3 0 10 4 2 Res0 63:8 Field 7:0 Num EndSysreg + +Sysreg LORC_EL1 3 0 10 4 3 +Res0 63:10 +Field 9:2 DS +Res0 1 +Field 0 EN +EndSysreg
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 24/26 arm64/sysreg: Convert LORID_EL1 to automatic generation
In reply to Mark BrownConvert LORID_EL1 to automatic register generation as per DDI0487H.a, no functional changes.
--- arch/arm64/include/asm/sysreg.h | 2 -- arch/arm64/tools/sysreg | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -2
@@ -407,8 +407,6 @@#define SYS_MAIR_EL1 sys_reg(3, 0, 10, 2, 0)#define SYS_AMAIR_EL1 sys_reg(3, 0, 10, 3, 0) -#define SYS_LORID_EL1 sys_reg(3, 0, 10, 4, 7) -#define SYS_VBAR_EL1 sys_reg(3, 0, 12, 0, 0)#define SYS_DISR_EL1 sys_reg(3, 0, 12, 1, 1)
arch/arm64/tools/sysreg +7 -0
@@ -540,3 +540,10 @@ Field 9:2 DS Res0 1 Field 0 EN EndSysreg + +Sysreg LORID_EL1 3 0 10 4 7 +Res0 63:24 +Field 23:16 LD +Res0 15:8 +Field 7:0 LR +EndSysreg
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 25/26 arm64/sysreg: Convert ID_AA64SMFR0_EL1 to automatic generation
In reply to Mark BrownConvert ID_AA64SMFR0_EL1 to automatic register generation as per DDI0487H.a, no functional change.
--- arch/arm64/include/asm/sysreg.h | 18 ---------------- arch/arm64/tools/sysreg | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 18 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -18
@@ -193,7 +193,6 @@#define SYS_ID_AA64PFR0_EL1 sys_reg(3, 0, 0, 4, 0)#define SYS_ID_AA64PFR1_EL1 sys_reg(3, 0, 0, 4, 1)#define SYS_ID_AA64ZFR0_EL1 sys_reg(3, 0, 0, 4, 4) -#define SYS_ID_AA64SMFR0_EL1 sys_reg(3, 0, 0, 4, 5)#define SYS_ID_AA64DFR0_EL1 sys_reg(3, 0, 0, 5, 0)#define SYS_ID_AA64DFR1_EL1 sys_reg(3, 0, 0, 5, 1)
@@ -760,23 +759,6 @@#define ID_AA64ZFR0_EL1_AES_PMULL128 0x2#define ID_AA64ZFR0_EL1_SVEver_SVE2 0x1 -/* id_aa64smfr0 */ -#define ID_AA64SMFR0_EL1_FA64_SHIFT 63 -#define ID_AA64SMFR0_EL1_I16I64_SHIFT 52 -#define ID_AA64SMFR0_EL1_F64F64_SHIFT 48 -#define ID_AA64SMFR0_EL1_I8I32_SHIFT 36 -#define ID_AA64SMFR0_EL1_F16F32_SHIFT 35 -#define ID_AA64SMFR0_EL1_B16F32_SHIFT 34 -#define ID_AA64SMFR0_EL1_F32F32_SHIFT 32 - -#define ID_AA64SMFR0_EL1_FA64_IMP 0x1 -#define ID_AA64SMFR0_EL1_I16I64_IMP 0xf -#define ID_AA64SMFR0_EL1_F64F64_IMP 0x1 -#define ID_AA64SMFR0_EL1_I8I32_IMP 0xf -#define ID_AA64SMFR0_EL1_F16F32_IMP 0x1 -#define ID_AA64SMFR0_EL1_B16F32_IMP 0x1 -#define ID_AA64SMFR0_EL1_F32F32_IMP 0x1 -/* id_aa64mmfr0 */ #define ID_AA64MMFR0_ECV_SHIFT 60#define ID_AA64MMFR0_FGT_SHIFT 56
arch/arm64/tools/sysreg +37 -0
@@ -46,6 +46,43 @@ # feature that introduces them (eg, FEAT_LS64_ACCDATA introduces enumeration # item ACCDATA) though it may be more taseful to do something else. +Sysreg ID_AA64SMFR0_EL1 3 0 0 4 5 +Enum 63 FA64 + 0b0 NI + 0b1 IMP +EndEnum +Res0 62:60 +Field 59:56 SMEver +Enum 55:52 I16I64 + 0b0000 NI + 0b1111 IMP +EndEnum +Res0 51:49 +Enum 48 F64F64 + 0b0 NI + 0b1 IMP +EndEnum +Res0 47:40 +Enum 39:36 I8I32 + 0b0000 NI + 0b1111 IMP +EndEnum +Enum 35 F16F32 + 0b0 NI + 0b1 IMP +EndEnum +Enum 34 B16F32 + 0b0 NI + 0b1 IMP +EndEnum +Res0 33 +Enum 32 F32F32 + 0b0 NI + 0b1 IMP +EndEnum +Res0 31:0 +EndSysreg + Sysreg ID_AA64ISAR0_EL1 3 0 0 6 0 Enum 63:60 RNDR 0b0000 NI
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 26/26 arm64/sysreg: Convert ID_AA64ZFR0_EL1 to automatic generation
In reply to Mark BrownConvert ID_AA64ZFR0_EL1 to automatic register generation as per DDI0487H.a, no functional changes.
--- arch/arm64/include/asm/sysreg.h | 23 ----------------- arch/arm64/tools/sysreg | 46 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 23 deletions(-)
arch/arm64/include/asm/sysreg.h +0 -23
@@ -192,7 +192,6 @@#define SYS_ID_AA64PFR0_EL1 sys_reg(3, 0, 0, 4, 0)#define SYS_ID_AA64PFR1_EL1 sys_reg(3, 0, 0, 4, 1) -#define SYS_ID_AA64ZFR0_EL1 sys_reg(3, 0, 0, 4, 4)#define SYS_ID_AA64DFR0_EL1 sys_reg(3, 0, 0, 5, 0)#define SYS_ID_AA64DFR1_EL1 sys_reg(3, 0, 0, 5, 1)
@@ -737,28 +736,6 @@#define ID_AA64PFR1_MTE 0x2#define ID_AA64PFR1_MTE_ASYMM 0x3 -/* id_aa64zfr0 */ -#define ID_AA64ZFR0_EL1_F64MM_SHIFT 56 -#define ID_AA64ZFR0_EL1_F32MM_SHIFT 52 -#define ID_AA64ZFR0_EL1_I8MM_SHIFT 44 -#define ID_AA64ZFR0_EL1_SM4_SHIFT 40 -#define ID_AA64ZFR0_EL1_SHA3_SHIFT 32 -#define ID_AA64ZFR0_EL1_BF16_SHIFT 20 -#define ID_AA64ZFR0_EL1_BitPerm_SHIFT 16 -#define ID_AA64ZFR0_EL1_AES_SHIFT 4 -#define ID_AA64ZFR0_EL1_SVEver_SHIFT 0 - -#define ID_AA64ZFR0_EL1_F64MM_IMP 0x1 -#define ID_AA64ZFR0_EL1_F32MM_IMP 0x1 -#define ID_AA64ZFR0_EL1_I8MM_IMP 0x1 -#define ID_AA64ZFR0_EL1_BF16_IMP 0x1 -#define ID_AA64ZFR0_EL1_SM4_IMP 0x1 -#define ID_AA64ZFR0_EL1_SHA3_IMP 0x1 -#define ID_AA64ZFR0_EL1_BitPerm_IMP 0x1 -#define ID_AA64ZFR0_EL1_AES_IMP 0x1 -#define ID_AA64ZFR0_EL1_AES_PMULL128 0x2 -#define ID_AA64ZFR0_EL1_SVEver_SVE2 0x1 -/* id_aa64mmfr0 */ #define ID_AA64MMFR0_ECV_SHIFT 60#define ID_AA64MMFR0_FGT_SHIFT 56
arch/arm64/tools/sysreg +46 -0
52 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
Mark Rutland
reviewerRe: [PATCH v4 01/26] arm64/cpuinfo: Restore define for AIVIVT cache type
In reply to Mark BrownQuoted 10 lines · Mark Brown
In
155433cb365ee466("arm64: cache: Remove support for ASID-tagged VIVT I-caches") we removed all the support fir AIVIVT cache types and renamed all references to the field to say "unknown" since support for AIVIVT caches was removed from the architecture. Since the correspoding removal from the architecture was done by documenting this value as reserved but still listing the original meaning and naming in order to facilitiate automatic generation of the headers for the system registers rename the kernel internal defines back to AIVIVT. The decoded value displayed to userspace is left as "RESERVED/UNKNOWN" so there is no user visible impact.
I'm not too keen on this, becuase architecturally AIVIVT does not exist in ARMv8, and the real bug here is that the ARM ARM still calls this AIVIVT rather than saying it's reserved.
Quoted 11 lines
Signed-off-by Mark Brown <[email protected]>--- arch/arm64/include/asm/cache.h | 2 +- arch/arm64/kernel/cpuinfo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)arch/arm64/include/asm/cache.h +0
-0
arch/arm64/include/asm/cache.h line 30
Quoted 7 lines
arch/arm64/include/asm/cache.h +1
-1@@ -25,7 +25,7 @@#define CTR_L1IP (ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK)#define ICACHE_POLICY_VPIPT 0 -#define ICACHE_POLICY_RESERVED 1 +#define ICACHE_POLICY_AIVIVT 1#define ICACHE_POLICY_VIPT 2#define ICACHE_POLICY_PIPT 3
How about we just delete ICACHE_POLICY_RESERVED entirely...
arch/arm64/kernel/cpuinfo.c static struct cpuinfo_arm64 boot_cpu_data; · line 41
Quoted 13 lines
arch/arm64/kernel/cpuinfo.c +1
-1@@ -35,7 +35,7 @@ static struct cpuinfo_arm64 boot_cpu_data;static const char *icache_policy_str[] = { [ICACHE_POLICY_VPIPT ] ="VPIPT" , - [ICACHE_POLICY_RESERVED ] ="RESERVED/UNKNOWN" , + [ICACHE_POLICY_AIVIVT ] ="RESERVED/UNKNOWN" , [ICACHE_POLICY_VIPT ] ="VIPT" , [ICACHE_POLICY_PIPT ] ="PIPT" , };
... then make this:
static inline const char *icache_policy_str(int l1ip)
{
switch (l1ip) {
case ICACHE_POLICY_VPIPT:
return "VPIPT"
case ICACHE_POLICY_VIPT:
return "VIPT"
case ICACHE_POLICY_PIPT:
return "PIPT";
default:
return "RESERVED/UNKNOWN";
}
}arch/arm64/kernel/cpuinfo.c static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info) · line 351
Quoted 7 lines
arch/arm64/kernel/cpuinfo.c +1
-1@@ -347,7 +347,7 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)case ICACHE_POLICY_VPIPT :set_bit (ICACHEF_VPIPT , &__icache_flags);break ; -case ICACHE_POLICY_RESERVED : +case ICACHE_POLICY_AIVIVT :case ICACHE_POLICY_VIPT :
... and make this:
case ICACHE_POLICY_PIPT:
default:
Quoted 4 lines
arch/arm64/kernel/cpuinfo.c +0
-0/* Assume aliasing */ set_bit (ICACHEF_ALIASING , &__icache_flags);Signature · 1 line
2.30.2
... then in subsequent patches we don't need to define a bogus ICACHE_POLICY_AIVIVT value in the scripted headers.
Thanks,
Mark.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Rutland
reviewerRe: [PATCH v4 02/26] arm64/sysreg: Add LINKER_SCRIPT guards for sysreg.h
In reply to Mark BrownQuoted 5 lines · Mark Brown
Linker scripts are preprocessed with
__ASSEMBLY__defined which works well for most things but not for assembler macros. In preparation for allowingsysreg.hto be included in linker files add someLINKER_SCRIPTguard defines around assembler macros in headers so the headers are safe for inclusion in linker scripts.
Where does that need to happen?
I couldn't spot a direct include; does that happen as a transitive dependency later in the series?
Mark.
Quoted 49 lines
Signed-off-by Mark Brown <[email protected]>--- arch/arm64/include/asm/gpr-num.h | 3 +++ arch/arm64/include/asm/sysreg.h | 2 ++ 2 files changed, 5 insertions(+)arch/arm64/include/asm/gpr-num.h +3
-0@@ -4,12 +4,15 @@#ifdef __ASSEMBLY__ +#ifndef LINKER_SCRIPT + .irp num,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 .equ .L__gpr_num_x\num, \num .equ .L__gpr_num_w\num, \num .endr .equ .L__gpr_num_xzr,31 .equ .L__gpr_num_wzr,31 +#endif /* !LINKER_SCRIPT */ #else /* __ASSEMBLY__ */arch/arm64/include/asm/sysreg.h +2
-0@@ -1219,6 +1219,7 @@#ifdef __ASSEMBLY__ +#ifndef LINKER_SCRIPT .macro mrs_s, rt, sreg __emit_inst(0xd5200000|(\sreg)|(.L__gpr_num_\rt)) .endm@@ -1226,6 +1227,7 @@ .macro msr_s, sreg, rt __emit_inst(0xd5000000|(\sreg)|(.L__gpr_num_\rt)) .endm +#endif /* !LINKER_SCRIPT */ #else Signature · 1 line
2.30.2
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v4 02/26] arm64/sysreg: Add LINKER_SCRIPT guards for sysreg.h
Quoted 11 lines · Mark Rutland
Quoted 5 lines · Mark Brown
Linker scripts are preprocessed with
__ASSEMBLY__defined which works well for most things but not for assembler macros. In preparation for allowingsysreg.hto be included in linker files add someLINKER_SCRIPTguard defines around assembler macros in headers so the headers are safe for inclusion in linker scripts.Where does that need to happen?
I couldn't spot a direct include; does that happen as a transitive dependency later in the series?
Yes, it's pulled in as a result of one of the patches in the series. IIRC it's cache.h that's currently included in the linker scripts.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v4 01/26] arm64/cpuinfo: Restore define for AIVIVT cache type
In reply to Mark RutlandQuoted 9 lines · Mark Rutland
Quoted 4 lines · Mark Brown
In
155433cb365ee466("arm64: cache: Remove support for ASID-tagged VIVT I-caches") we removed all the support fir AIVIVT cache types and renamed all references to the field to say "unknown" since support for AIVIVT caches was removed from the architecture. Since the correspoding removalI'm not too keen on this, becuase architecturally AIVIVT does not exist in ARMv8, and the real bug here is that the ARM ARM still calls this AIVIVT rather than saying it's reserved.
Yes, it's rather difficult to divine the intent of the architecture here
- I was erring on the side of the name having been left there for *some* reason, though equally it could just be done that way to ensure nobody confuses things by trying to allocate what looks like a previously reserved value in future.
Quoted 4 lines
arch/arm64/include/asm/cache.h line 28
Quoted 2 lines
arch/arm64/include/asm/cache.h +1
-1-#define ICACHE_POLICY_RESERVED 1 +#define ICACHE_POLICY_AIVIVT 1How about we just delete
ICACHE_POLICY_RESERVEDentirely...
Sure.
Quoted 2 lines
... then in subsequent patches we don't need to define a bogus
ICACHE_POLICY_AIVIVTvalue in the scripted headers.
I think if we don't have the value be the same as it is in the architecture we're going to have the next person who happens to look at this go and try to define the missing value again. I suppose we can add a comment in the text file...
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Rutland
reviewerRe: [PATCH v4 02/26] arm64/sysreg: Add LINKER_SCRIPT guards for sysreg.h
In reply to Mark BrownQuoted 8 lines · Mark Brown
Quoted 6 lines · Mark Rutland
Quoted 5 lines · Mark Brown
Linker scripts are preprocessed with
__ASSEMBLY__defined which works well for most things but not for assembler macros. In preparation for allowingsysreg.hto be included in linker files add someLINKER_SCRIPTguard defines around assembler macros in headers so the headers are safe for inclusion in linker scripts.
Quoted 7 lines
Quoted 4 lines
Where does that need to happen?
I couldn't spot a direct include; does that happen as a transitive dependency later in the series?
Yes, it's pulled in as a result of one of the patches in the series. IIRC it's
cache.hthat's currently included in the linker scripts.
Ok; could we please mention something like that explciitly in the commit message, e.g.
In subsequent patches sysreg.h and gpr-num.h will be included from other headers which can be included from linker scripts (e.g. via cache.h), and contain assember macro directives that don't work in linker scripts (e.g. .macro and .irp).
To avoid needing LINKER_SCRIPT guards in every file which could have a transitive dependency, add those directly to sysreg.h and gpr-num.h.
... just so that it's clear that's a transitive dependency, and difficult to refactor in other ways to avoid.
Thanks,
Mark.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Rutland
reviewerRe: [PATCH v4 01/26] arm64/cpuinfo: Restore define for AIVIVT cache type
In reply to Mark BrownQuoted 11 lines · Mark Brown
Quoted 9 lines · Mark Rutland
Quoted 4 lines · Mark Brown
In
155433cb365ee466("arm64: cache: Remove support for ASID-tagged VIVT I-caches") we removed all the support fir AIVIVT cache types and renamed all references to the field to say "unknown" since support for AIVIVT caches was removed from the architecture. Since the correspoding removalI'm not too keen on this, becuase architecturally AIVIVT does not exist in ARMv8, and the real bug here is that the ARM ARM still calls this AIVIVT rather than saying it's reserved.
Quoted 5 lines
Yes, it's rather difficult to divine the intent of the architecture here
- I was erring on the side of the name having been left there for *some* reason, though equally it could just be done that way to ensure nobody confuses things by trying to allocate what looks like a previously reserved value in future.
Sure; I completely agree this is not at all clear, and as above I'd argue this is a bug (or at least a deficiency of clarity) in the ARM ARM.
Quoted 7 lines
Quoted 4 lines
arch/arm64/include/asm/cache.h line 28
Quoted 2 lines
arch/arm64/include/asm/cache.h +1
-1-#define ICACHE_POLICY_RESERVED 1 +#define ICACHE_POLICY_AIVIVT 1How about we just delete
ICACHE_POLICY_RESERVEDentirely...Sure.
Quoted 7 lines
Quoted 2 lines
... then in subsequent patches we don't need to define a bogus
ICACHE_POLICY_AIVIVTvalue in the scripted headers.I think if we don't have the value be the same as it is in the architecture we're going to have the next person who happens to look at this go and try to define the missing value again. I suppose we can add a comment in the text file...
FWIW, I'm perfectly happy with a comment along the lines of:
# AIVIVT is deprecated and the encoding is reserved from ARMv8.0
... at the right place in the sysreg definitions file.
Thanks,
Mark
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v4 01/26] arm64/cpuinfo: Restore define for AIVIVT cache type
Quoted 7 lines · Mark Rutland
Quoted 4 lines · Mark Brown
I think if we don't have the value be the same as it is in the architecture we're going to have the next person who happens to look at this go and try to define the missing value again. I suppose we can add a comment in the text file...
Quoted 5 lines
FWIW, I'm perfectly happy with a comment along the lines of:
# AIVIVT is deprecated and the encoding is reserved from ARMv8.0
... at the right place in the sysreg definitions file.
The actual wording in the v5 that I sent yesterday is:
# This is named as AIVIVT in the ARM but documented as reserved
0b01 RESERVED
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Rutland
reviewerRe: [PATCH v4 01/26] arm64/cpuinfo: Restore define for AIVIVT cache type
Quoted 10 lines · Mark Brown
Quoted 8 lines · Mark Rutland
Quoted 4 lines · Mark Brown
I think if we don't have the value be the same as it is in the architecture we're going to have the next person who happens to look at this go and try to define the missing value again. I suppose we can add a comment in the text file...
FWIW, I'm perfectly happy with a comment along the lines of:
Quoted 8 lines
Quoted 3 lines
# AIVIVT is deprecated and the encoding is reserved from ARMv8.0
... at the right place in the sysreg definitions file.
The actual wording in the v5 that I sent yesterday is:
# This is named as AIVIVT in the ARM but documented as reserved
0b01 RESERVED
Ah, sorry; I had missed v5 when filtering my review queue. FWIW that's fine by me!
Thanks,
Mark.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel