Skip to content

Commit 8e3747b

Browse files
Anshuman Khandualwilldeacon
authored andcommitted
arm64: Introduce ID_ISAR6 CPU register
This adds basic building blocks required for ID_ISAR6 CPU register which identifies support for various instruction implementation on AArch32 state. Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: James Morse <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: Mark Rutland <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Marc Zyngier <[email protected]> Signed-off-by: Anshuman Khandual <[email protected]> [will: Ensure SPECRES is treated the same as on A64] Signed-off-by: Will Deacon <[email protected]>
1 parent d4209d8 commit 8e3747b

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

arch/arm64/include/asm/cpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct cpuinfo_arm64 {
3939
u32 reg_id_isar3;
4040
u32 reg_id_isar4;
4141
u32 reg_id_isar5;
42+
u32 reg_id_isar6;
4243
u32 reg_id_mmfr0;
4344
u32 reg_id_mmfr1;
4445
u32 reg_id_mmfr2;

arch/arm64/include/asm/sysreg.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
#define SYS_ID_ISAR4_EL1 sys_reg(3, 0, 0, 2, 4)
147147
#define SYS_ID_ISAR5_EL1 sys_reg(3, 0, 0, 2, 5)
148148
#define SYS_ID_MMFR4_EL1 sys_reg(3, 0, 0, 2, 6)
149+
#define SYS_ID_ISAR6_EL1 sys_reg(3, 0, 0, 2, 7)
149150

150151
#define SYS_MVFR0_EL1 sys_reg(3, 0, 0, 3, 0)
151152
#define SYS_MVFR1_EL1 sys_reg(3, 0, 0, 3, 1)
@@ -691,6 +692,14 @@
691692
#define ID_ISAR5_AES_SHIFT 4
692693
#define ID_ISAR5_SEVL_SHIFT 0
693694

695+
#define ID_ISAR6_I8MM_SHIFT 24
696+
#define ID_ISAR6_BF16_SHIFT 20
697+
#define ID_ISAR6_SPECRES_SHIFT 16
698+
#define ID_ISAR6_SB_SHIFT 12
699+
#define ID_ISAR6_FHM_SHIFT 8
700+
#define ID_ISAR6_DP_SHIFT 4
701+
#define ID_ISAR6_JSCVT_SHIFT 0
702+
694703
#define MVFR0_FPROUND_SHIFT 28
695704
#define MVFR0_FPSHVEC_SHIFT 24
696705
#define MVFR0_FPSQRT_SHIFT 20

arch/arm64/kernel/cpufeature.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,17 @@ static const struct arm64_ftr_bits ftr_id_mmfr4[] = {
325325
ARM64_FTR_END,
326326
};
327327

328+
static const struct arm64_ftr_bits ftr_id_isar6[] = {
329+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_I8MM_SHIFT, 4, 0),
330+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_BF16_SHIFT, 4, 0),
331+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_SPECRES_SHIFT, 4, 0),
332+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_SB_SHIFT, 4, 0),
333+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_FHM_SHIFT, 4, 0),
334+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_DP_SHIFT, 4, 0),
335+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_JSCVT_SHIFT, 4, 0),
336+
ARM64_FTR_END,
337+
};
338+
328339
static const struct arm64_ftr_bits ftr_id_pfr0[] = {
329340
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 12, 4, 0), /* State3 */
330341
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 8, 4, 0), /* State2 */
@@ -408,6 +419,7 @@ static const struct __ftr_reg_entry {
408419
ARM64_FTR_REG(SYS_ID_ISAR4_EL1, ftr_generic_32bits),
409420
ARM64_FTR_REG(SYS_ID_ISAR5_EL1, ftr_id_isar5),
410421
ARM64_FTR_REG(SYS_ID_MMFR4_EL1, ftr_id_mmfr4),
422+
ARM64_FTR_REG(SYS_ID_ISAR6_EL1, ftr_id_isar6),
411423

412424
/* Op1 = 0, CRn = 0, CRm = 3 */
413425
ARM64_FTR_REG(SYS_MVFR0_EL1, ftr_generic_32bits),
@@ -612,6 +624,7 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info)
612624
init_cpu_ftr_reg(SYS_ID_ISAR3_EL1, info->reg_id_isar3);
613625
init_cpu_ftr_reg(SYS_ID_ISAR4_EL1, info->reg_id_isar4);
614626
init_cpu_ftr_reg(SYS_ID_ISAR5_EL1, info->reg_id_isar5);
627+
init_cpu_ftr_reg(SYS_ID_ISAR6_EL1, info->reg_id_isar6);
615628
init_cpu_ftr_reg(SYS_ID_MMFR0_EL1, info->reg_id_mmfr0);
616629
init_cpu_ftr_reg(SYS_ID_MMFR1_EL1, info->reg_id_mmfr1);
617630
init_cpu_ftr_reg(SYS_ID_MMFR2_EL1, info->reg_id_mmfr2);
@@ -765,6 +778,8 @@ void update_cpu_features(int cpu,
765778
info->reg_id_isar4, boot->reg_id_isar4);
766779
taint |= check_update_ftr_reg(SYS_ID_ISAR5_EL1, cpu,
767780
info->reg_id_isar5, boot->reg_id_isar5);
781+
taint |= check_update_ftr_reg(SYS_ID_ISAR6_EL1, cpu,
782+
info->reg_id_isar6, boot->reg_id_isar6);
768783

769784
/*
770785
* Regardless of the value of the AuxReg field, the AIFSR, ADFSR, and
@@ -843,6 +858,7 @@ static u64 __read_sysreg_by_encoding(u32 sys_id)
843858
read_sysreg_case(SYS_ID_ISAR3_EL1);
844859
read_sysreg_case(SYS_ID_ISAR4_EL1);
845860
read_sysreg_case(SYS_ID_ISAR5_EL1);
861+
read_sysreg_case(SYS_ID_ISAR6_EL1);
846862
read_sysreg_case(SYS_MVFR0_EL1);
847863
read_sysreg_case(SYS_MVFR1_EL1);
848864
read_sysreg_case(SYS_MVFR2_EL1);

arch/arm64/kernel/cpuinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
367367
info->reg_id_isar3 = read_cpuid(ID_ISAR3_EL1);
368368
info->reg_id_isar4 = read_cpuid(ID_ISAR4_EL1);
369369
info->reg_id_isar5 = read_cpuid(ID_ISAR5_EL1);
370+
info->reg_id_isar6 = read_cpuid(ID_ISAR6_EL1);
370371
info->reg_id_mmfr0 = read_cpuid(ID_MMFR0_EL1);
371372
info->reg_id_mmfr1 = read_cpuid(ID_MMFR1_EL1);
372373
info->reg_id_mmfr2 = read_cpuid(ID_MMFR2_EL1);

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
14241424
ID_SANITISED(ID_ISAR4_EL1),
14251425
ID_SANITISED(ID_ISAR5_EL1),
14261426
ID_SANITISED(ID_MMFR4_EL1),
1427-
ID_UNALLOCATED(2,7),
1427+
ID_SANITISED(ID_ISAR6_EL1),
14281428

14291429
/* CRm=3 */
14301430
ID_SANITISED(MVFR0_EL1),

0 commit comments

Comments
 (0)