Skip to content

Commit 9e45365

Browse files
jgoulyctmarinas
authored andcommitted
arm64: add ID_AA64ISAR2_EL1 sys register
This is a new ID register, introduced in 8.7. Signed-off-by: Joey Gouly <[email protected]> Cc: Will Deacon <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: James Morse <[email protected]> Cc: Alexandru Elisei <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: Reiji Watanabe <[email protected]> Acked-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 5c13f04 commit 9e45365

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

arch/arm64/include/asm/cpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ struct cpuinfo_arm64 {
5151
u64 reg_id_aa64dfr1;
5252
u64 reg_id_aa64isar0;
5353
u64 reg_id_aa64isar1;
54+
u64 reg_id_aa64isar2;
5455
u64 reg_id_aa64mmfr0;
5556
u64 reg_id_aa64mmfr1;
5657
u64 reg_id_aa64mmfr2;

arch/arm64/include/asm/sysreg.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182

183183
#define SYS_ID_AA64ISAR0_EL1 sys_reg(3, 0, 0, 6, 0)
184184
#define SYS_ID_AA64ISAR1_EL1 sys_reg(3, 0, 0, 6, 1)
185+
#define SYS_ID_AA64ISAR2_EL1 sys_reg(3, 0, 0, 6, 2)
185186

186187
#define SYS_ID_AA64MMFR0_EL1 sys_reg(3, 0, 0, 7, 0)
187188
#define SYS_ID_AA64MMFR1_EL1 sys_reg(3, 0, 0, 7, 1)
@@ -771,6 +772,20 @@
771772
#define ID_AA64ISAR1_GPI_NI 0x0
772773
#define ID_AA64ISAR1_GPI_IMP_DEF 0x1
773774

775+
/* id_aa64isar2 */
776+
#define ID_AA64ISAR2_RPRES_SHIFT 4
777+
#define ID_AA64ISAR2_WFXT_SHIFT 0
778+
779+
#define ID_AA64ISAR2_RPRES_8BIT 0x0
780+
#define ID_AA64ISAR2_RPRES_12BIT 0x1
781+
/*
782+
* Value 0x1 has been removed from the architecture, and is
783+
* reserved, but has not yet been removed from the ARM ARM
784+
* as of ARM DDI 0487G.b.
785+
*/
786+
#define ID_AA64ISAR2_WFXT_NI 0x0
787+
#define ID_AA64ISAR2_WFXT_SUPPORTED 0x2
788+
774789
/* id_aa64pfr0 */
775790
#define ID_AA64PFR0_CSV3_SHIFT 60
776791
#define ID_AA64PFR0_CSV2_SHIFT 56

arch/arm64/kernel/cpufeature.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ static const struct arm64_ftr_bits ftr_id_aa64isar1[] = {
225225
ARM64_FTR_END,
226226
};
227227

228+
static const struct arm64_ftr_bits ftr_id_aa64isar2[] = {
229+
ARM64_FTR_END,
230+
};
231+
228232
static const struct arm64_ftr_bits ftr_id_aa64pfr0[] = {
229233
ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_CSV3_SHIFT, 4, 0),
230234
ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64PFR0_CSV2_SHIFT, 4, 0),
@@ -638,6 +642,7 @@ static const struct __ftr_reg_entry {
638642
ARM64_FTR_REG(SYS_ID_AA64ISAR0_EL1, ftr_id_aa64isar0),
639643
ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ISAR1_EL1, ftr_id_aa64isar1,
640644
&id_aa64isar1_override),
645+
ARM64_FTR_REG(SYS_ID_AA64ISAR2_EL1, ftr_id_aa64isar2),
641646

642647
/* Op1 = 0, CRn = 0, CRm = 7 */
643648
ARM64_FTR_REG(SYS_ID_AA64MMFR0_EL1, ftr_id_aa64mmfr0),
@@ -934,6 +939,7 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info)
934939
init_cpu_ftr_reg(SYS_ID_AA64DFR1_EL1, info->reg_id_aa64dfr1);
935940
init_cpu_ftr_reg(SYS_ID_AA64ISAR0_EL1, info->reg_id_aa64isar0);
936941
init_cpu_ftr_reg(SYS_ID_AA64ISAR1_EL1, info->reg_id_aa64isar1);
942+
init_cpu_ftr_reg(SYS_ID_AA64ISAR2_EL1, info->reg_id_aa64isar2);
937943
init_cpu_ftr_reg(SYS_ID_AA64MMFR0_EL1, info->reg_id_aa64mmfr0);
938944
init_cpu_ftr_reg(SYS_ID_AA64MMFR1_EL1, info->reg_id_aa64mmfr1);
939945
init_cpu_ftr_reg(SYS_ID_AA64MMFR2_EL1, info->reg_id_aa64mmfr2);
@@ -1152,6 +1158,8 @@ void update_cpu_features(int cpu,
11521158
info->reg_id_aa64isar0, boot->reg_id_aa64isar0);
11531159
taint |= check_update_ftr_reg(SYS_ID_AA64ISAR1_EL1, cpu,
11541160
info->reg_id_aa64isar1, boot->reg_id_aa64isar1);
1161+
taint |= check_update_ftr_reg(SYS_ID_AA64ISAR2_EL1, cpu,
1162+
info->reg_id_aa64isar2, boot->reg_id_aa64isar2);
11551163

11561164
/*
11571165
* Differing PARange support is fine as long as all peripherals and
@@ -1273,6 +1281,7 @@ u64 __read_sysreg_by_encoding(u32 sys_id)
12731281
read_sysreg_case(SYS_ID_AA64MMFR2_EL1);
12741282
read_sysreg_case(SYS_ID_AA64ISAR0_EL1);
12751283
read_sysreg_case(SYS_ID_AA64ISAR1_EL1);
1284+
read_sysreg_case(SYS_ID_AA64ISAR2_EL1);
12761285

12771286
read_sysreg_case(SYS_CNTFRQ_EL0);
12781287
read_sysreg_case(SYS_CTR_EL0);

arch/arm64/kernel/cpuinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
392392
info->reg_id_aa64dfr1 = read_cpuid(ID_AA64DFR1_EL1);
393393
info->reg_id_aa64isar0 = read_cpuid(ID_AA64ISAR0_EL1);
394394
info->reg_id_aa64isar1 = read_cpuid(ID_AA64ISAR1_EL1);
395+
info->reg_id_aa64isar2 = read_cpuid(ID_AA64ISAR2_EL1);
395396
info->reg_id_aa64mmfr0 = read_cpuid(ID_AA64MMFR0_EL1);
396397
info->reg_id_aa64mmfr1 = read_cpuid(ID_AA64MMFR1_EL1);
397398
info->reg_id_aa64mmfr2 = read_cpuid(ID_AA64MMFR2_EL1);

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
15251525
/* CRm=6 */
15261526
ID_SANITISED(ID_AA64ISAR0_EL1),
15271527
ID_SANITISED(ID_AA64ISAR1_EL1),
1528-
ID_UNALLOCATED(6,2),
1528+
ID_SANITISED(ID_AA64ISAR2_EL1),
15291529
ID_UNALLOCATED(6,3),
15301530
ID_UNALLOCATED(6,4),
15311531
ID_UNALLOCATED(6,5),

0 commit comments

Comments
 (0)