Skip to content

Commit 152accf

Browse files
Anshuman Khandualwilldeacon
authored andcommitted
arm64/cpufeature: Introduce ID_MMFR5 CPU register
This adds basic building blocks required for ID_MMFR5 CPU register which provides information about the implemented memory model and memory management support in AArch32 state. This is added per ARM DDI 0487F.a specification. Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Mark Rutland <[email protected]> Cc: James Morse <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Suggested-by: Will Deacon <[email protected]> Signed-off-by: Anshuman Khandual <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent dd35ec0 commit 152accf

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

arch/arm64/include/asm/cpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct cpuinfo_arm64 {
4545
u32 reg_id_mmfr1;
4646
u32 reg_id_mmfr2;
4747
u32 reg_id_mmfr3;
48+
u32 reg_id_mmfr5;
4849
u32 reg_id_pfr0;
4950
u32 reg_id_pfr1;
5051
u32 reg_id_pfr2;

arch/arm64/include/asm/sysreg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
#define SYS_ID_MMFR2_EL1 sys_reg(3, 0, 0, 1, 6)
148148
#define SYS_ID_MMFR3_EL1 sys_reg(3, 0, 0, 1, 7)
149149
#define SYS_ID_MMFR4_EL1 sys_reg(3, 0, 0, 2, 6)
150+
#define SYS_ID_MMFR5_EL1 sys_reg(3, 0, 0, 3, 6)
150151

151152
#define SYS_ID_ISAR0_EL1 sys_reg(3, 0, 0, 2, 0)
152153
#define SYS_ID_ISAR1_EL1 sys_reg(3, 0, 0, 2, 1)
@@ -793,6 +794,8 @@
793794
#define ID_ISAR6_DP_SHIFT 4
794795
#define ID_ISAR6_JSCVT_SHIFT 0
795796

797+
#define ID_MMFR5_ETS_SHIFT 0
798+
796799
#define ID_PFR2_SSBS_SHIFT 4
797800
#define ID_PFR2_CSV3_SHIFT 0
798801

arch/arm64/kernel/cpufeature.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,11 @@ static const struct arm64_ftr_bits ftr_id_isar4[] = {
408408
ARM64_FTR_END,
409409
};
410410

411+
static const struct arm64_ftr_bits ftr_id_mmfr5[] = {
412+
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR5_ETS_SHIFT, 4, 0),
413+
ARM64_FTR_END,
414+
};
415+
411416
static const struct arm64_ftr_bits ftr_id_isar6[] = {
412417
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_I8MM_SHIFT, 4, 0),
413418
ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_ISAR6_BF16_SHIFT, 4, 0),
@@ -533,6 +538,7 @@ static const struct __ftr_reg_entry {
533538
ARM64_FTR_REG(SYS_MVFR2_EL1, ftr_mvfr2),
534539
ARM64_FTR_REG(SYS_ID_PFR2_EL1, ftr_id_pfr2),
535540
ARM64_FTR_REG(SYS_ID_DFR1_EL1, ftr_id_dfr1),
541+
ARM64_FTR_REG(SYS_ID_MMFR5_EL1, ftr_id_mmfr5),
536542

537543
/* Op1 = 0, CRn = 0, CRm = 4 */
538544
ARM64_FTR_REG(SYS_ID_AA64PFR0_EL1, ftr_id_aa64pfr0),
@@ -738,6 +744,7 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info)
738744
init_cpu_ftr_reg(SYS_ID_MMFR1_EL1, info->reg_id_mmfr1);
739745
init_cpu_ftr_reg(SYS_ID_MMFR2_EL1, info->reg_id_mmfr2);
740746
init_cpu_ftr_reg(SYS_ID_MMFR3_EL1, info->reg_id_mmfr3);
747+
init_cpu_ftr_reg(SYS_ID_MMFR5_EL1, info->reg_id_mmfr5);
741748
init_cpu_ftr_reg(SYS_ID_PFR0_EL1, info->reg_id_pfr0);
742749
init_cpu_ftr_reg(SYS_ID_PFR1_EL1, info->reg_id_pfr1);
743750
init_cpu_ftr_reg(SYS_ID_PFR2_EL1, info->reg_id_pfr2);
@@ -872,6 +879,8 @@ static int update_32bit_cpu_features(int cpu, struct cpuinfo_arm64 *info,
872879
info->reg_id_mmfr2, boot->reg_id_mmfr2);
873880
taint |= check_update_ftr_reg(SYS_ID_MMFR3_EL1, cpu,
874881
info->reg_id_mmfr3, boot->reg_id_mmfr3);
882+
taint |= check_update_ftr_reg(SYS_ID_MMFR5_EL1, cpu,
883+
info->reg_id_mmfr5, boot->reg_id_mmfr5);
875884
taint |= check_update_ftr_reg(SYS_ID_PFR0_EL1, cpu,
876885
info->reg_id_pfr0, boot->reg_id_pfr0);
877886
taint |= check_update_ftr_reg(SYS_ID_PFR1_EL1, cpu,
@@ -1012,6 +1021,7 @@ static u64 __read_sysreg_by_encoding(u32 sys_id)
10121021
read_sysreg_case(SYS_ID_MMFR1_EL1);
10131022
read_sysreg_case(SYS_ID_MMFR2_EL1);
10141023
read_sysreg_case(SYS_ID_MMFR3_EL1);
1024+
read_sysreg_case(SYS_ID_MMFR5_EL1);
10151025
read_sysreg_case(SYS_ID_ISAR0_EL1);
10161026
read_sysreg_case(SYS_ID_ISAR1_EL1);
10171027
read_sysreg_case(SYS_ID_ISAR2_EL1);

arch/arm64/kernel/cpuinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
374374
info->reg_id_mmfr1 = read_cpuid(ID_MMFR1_EL1);
375375
info->reg_id_mmfr2 = read_cpuid(ID_MMFR2_EL1);
376376
info->reg_id_mmfr3 = read_cpuid(ID_MMFR3_EL1);
377+
info->reg_id_mmfr5 = read_cpuid(ID_MMFR5_EL1);
377378
info->reg_id_pfr0 = read_cpuid(ID_PFR0_EL1);
378379
info->reg_id_pfr1 = read_cpuid(ID_PFR1_EL1);
379380
info->reg_id_pfr2 = read_cpuid(ID_PFR2_EL1);

arch/arm64/kvm/sys_regs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
14581458
ID_UNALLOCATED(3,3),
14591459
ID_SANITISED(ID_PFR2_EL1),
14601460
ID_HIDDEN(ID_DFR1_EL1),
1461-
ID_UNALLOCATED(3,6),
1461+
ID_SANITISED(ID_MMFR5_EL1),
14621462
ID_UNALLOCATED(3,7),
14631463

14641464
/* AArch64 ID registers */

0 commit comments

Comments
 (0)