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 (17):
arm64/cpuinfo: Decode AIVIVT L1 cache policy
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: 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: Generate defines for CTR_EL0
arm64/sysreg: Generate definitions for DCZID_EL0 arm64/sysreg: Generate definitions for GMID
arm64/sysreg: Convert ID_AA64ISAR1_EL1 to automatic generation arm64/sysreg: Convert ID_AA64ISAR2_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/gpr-num.h | 3 + arch/arm64/include/asm/sysreg.h | 79 +-------- arch/arm64/kernel/alternative.c | 2 +- arch/arm64/kernel/cpu_errata.c | 2 +- arch/arm64/kernel/cpufeature.c | 150 +++++++++--------- 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 | 147 +++++++++++++++++ ramdisk.img | 1 + 17 files changed, 292 insertions(+), 221 deletions(-) create mode 120000 ramdisk.img
base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/17 arm64/cpuinfo: Decode AIVIVT L1 cache policy
Since the code was originally written the architecture has documented a level 1 instruction cache policy AIVIVT (ASID-tagged, Virtual Index, Virtual Tag) for the previously reserved CTR_EL0.L1Ip value 0b01. Update the define and the string printed at boot reporting the cache type to AIVIVT.
--- 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 ] ="AIVIVT" , [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
Mark Rutland
reviewerRe: [PATCH v1 01/17] arm64/cpuinfo: Decode AIVIVT L1 cache policy
Quoted 5 lines · Mark Brown
Since the code was originally written the architecture has documented a level 1 instruction cache policy AIVIVT (ASID-tagged, Virtual Index, Virtual Tag) for the previously reserved CTR_EL0.L1Ip value 0b01. Update the define and the string printed at boot reporting the cache type to AIVIVT.
That's not quite right; AIVIVT was removed from ARMv8 in 2017, and we deliberately removed support from the kernel. See commit:
155433cb365ee466 ("arm64: cache: Remove support for ASID-tagged VIVT I-caches")
... and in ARM DDI 0487H.a see page D13-5336 where we say:
| L1Ip, bits [15:14] | ... | 0b01 ASID-tagged Virtual Index, Virtual Tag (AIVIVT). | ... | The value 0b01 is reserved in Armv8.
... so this is arguably a bug in the ARM ARM.
Thanks,
Mark.
Quoted 45 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 +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 3arch/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 ] ="AIVIVT" , [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 · 1 line
2.30.2
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v1 01/17] arm64/cpuinfo: Decode AIVIVT L1 cache policy
Quoted 11 lines · Mark Rutland
On Mon, Jun 06, 2022 at 09:12:38PM +0100, Mark Brown wrote:
... and in ARM DDI 0487H.a see page D13-5336 where we say:
| L1Ip, bits [15:14] | ... | 0b01 ASID-tagged Virtual Index, Virtual Tag (AIVIVT). | ... | The value 0b01 is reserved in Armv8.... so this is arguably a bug in the ARM ARM.
Yes, that seems like a bug in the ARM given that we now have v9 (and even without that it's easy to read that as v8.0 rather than v8.* TBH).
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/17 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 3/17 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
Re: [PATCH v1 03/17] arm64/sysreg: Add SYS_FIELD_GET() helper
Quoted 5 lines · Mark Brown
Add a
SYS_FIELD_GET()helper to matchSYS_FIELD_PREP(), providing a simplified interface toFIELD_GET()when using the generated defines with standardized naming.Signed-off-by Mark Brown <[email protected]>
Mark.
Quoted 21 lines
--- 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 · 1 line
2.30.2
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 4/17 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 ] ="AIVIVT" , - [ICACHE_POLICY_VIPT ] ="VIPT" , - [ICACHE_POLICY_PIPT ] ="PIPT" , + [CTR_EL0_L1Ip_VPIPT] ="VPIPT" , + [CTR_EL0_L1Ip_AIVIVT] ="AIVIVT" , + [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 5/17 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 6/17 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 7/17 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
@@ -2325,7 +2325,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, }, {
@@ -2336,7 +2336,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, }, {
@@ -2347,7 +2347,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, }, {
@@ -2363,7 +2363,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, }, {
@@ -2374,7 +2374,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, }, {
@@ -2385,7 +2385,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, }, {
@@ -2570,15 +2570,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) }, {}, };
@@ -2586,15 +2586,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 8/17 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 9/17 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, };
@@ -2524,10 +2524,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, }, {}, };
@@ -2662,7 +2662,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 10/17 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 11/17 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 12/17 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 ++-- ramdisk.img | 1 + 9 files changed, 46 insertions(+), 45 deletions(-) create mode 120000 ramdisk.img
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 , };
@@ -2334,9 +2334,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, }, {
@@ -2372,9 +2372,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, }, {
@@ -2524,10 +2524,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, }, {}, };
@@ -2573,8 +2573,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,
@@ -2589,8 +2589,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,
@@ -2661,8 +2661,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_FA64_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_FA64, 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 */
ramdisk.img new file +1 -0
@@ -0,0 +1 @@ +/tmp/rootfs.cpio
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 13/17 arm64/sysreg: Generate defines for CTR_EL0
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 14/17 arm64/sysreg: Generate definitions for DCZID_EL0
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 15/17 arm64/sysreg: Generate definitions for GMID
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 16/17 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 17/17 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,6 +193,39 @@ 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 0b0001 IMP EndEnum EndSysreg
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel