Skip to content

Commit 328d35b

Browse files
committed
Merge branch 'for-next/cpufeature' into for-next/core
* for-next/cpufeature: arm64: cputype: Add cputype definition for HIP12 arm64: Expose AIDR_EL1 via sysfs arm64/cpufeature: Add missing id_aa64mmfr4 feature reg update
2 parents 9bd2e7c + 226ff35 commit 328d35b

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

Documentation/ABI/testing/sysfs-devices-system-cpu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ What: /sys/devices/system/cpu/cpuX/regs/
485485
/sys/devices/system/cpu/cpuX/regs/identification/
486486
/sys/devices/system/cpu/cpuX/regs/identification/midr_el1
487487
/sys/devices/system/cpu/cpuX/regs/identification/revidr_el1
488+
/sys/devices/system/cpu/cpuX/regs/identification/aidr_el1
488489
/sys/devices/system/cpu/cpuX/regs/identification/smidr_el1
489490
Date: June 2016
490491
Contact: Linux ARM Kernel Mailing list <linux-arm-kernel@lists.infradead.org>

Documentation/arch/arm64/cpu-feature-registers.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ there are some issues with their usage.
7272
process could be migrated to another CPU by the time it uses the
7373
register value, unless the CPU affinity is set. Hence, there is no
7474
guarantee that the value reflects the processor that it is
75-
currently executing on. The REVIDR is not exposed due to this
76-
constraint, as REVIDR makes sense only in conjunction with the
77-
MIDR. Alternately, MIDR_EL1 and REVIDR_EL1 are exposed via sysfs
78-
at::
75+
currently executing on. REVIDR and AIDR are not exposed due to this
76+
constraint, as these registers only make sense in conjunction with
77+
the MIDR. Alternately, MIDR_EL1, REVIDR_EL1, and AIDR_EL1 are exposed
78+
via sysfs at::
7979

8080
/sys/devices/system/cpu/cpu$ID/regs/identification/
81-
\- midr
82-
\- revidr
81+
\- midr_el1
82+
\- revidr_el1
83+
\- aidr_el1
8384

8485
3. Implementation
8586
--------------------

arch/arm64/include/asm/cpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct cpuinfo_arm64 {
4444
u64 reg_dczid;
4545
u64 reg_midr;
4646
u64 reg_revidr;
47+
u64 reg_aidr;
4748
u64 reg_gmid;
4849
u64 reg_smidr;
4950
u64 reg_mpamidr;

arch/arm64/include/asm/cputype.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133

134134
#define HISI_CPU_PART_TSV110 0xD01
135135
#define HISI_CPU_PART_HIP09 0xD02
136+
#define HISI_CPU_PART_HIP12 0xD06
136137

137138
#define APPLE_CPU_PART_M1_ICESTORM 0x022
138139
#define APPLE_CPU_PART_M1_FIRESTORM 0x023
@@ -220,6 +221,7 @@
220221
#define MIDR_FUJITSU_A64FX MIDR_CPU_MODEL(ARM_CPU_IMP_FUJITSU, FUJITSU_CPU_PART_A64FX)
221222
#define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110)
222223
#define MIDR_HISI_HIP09 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP09)
224+
#define MIDR_HISI_HIP12 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_HIP12)
223225
#define MIDR_APPLE_M1_ICESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM)
224226
#define MIDR_APPLE_M1_FIRESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM)
225227
#define MIDR_APPLE_M1_ICESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_PRO)

arch/arm64/kernel/cpufeature.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,8 @@ void update_cpu_features(int cpu,
14031403
info->reg_id_aa64mmfr2, boot->reg_id_aa64mmfr2);
14041404
taint |= check_update_ftr_reg(SYS_ID_AA64MMFR3_EL1, cpu,
14051405
info->reg_id_aa64mmfr3, boot->reg_id_aa64mmfr3);
1406+
taint |= check_update_ftr_reg(SYS_ID_AA64MMFR4_EL1, cpu,
1407+
info->reg_id_aa64mmfr4, boot->reg_id_aa64mmfr4);
14061408

14071409
taint |= check_update_ftr_reg(SYS_ID_AA64PFR0_EL1, cpu,
14081410
info->reg_id_aa64pfr0, boot->reg_id_aa64pfr0);

arch/arm64/kernel/cpuinfo.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,13 @@ static const struct kobj_type cpuregs_kobj_type = {
328328

329329
CPUREGS_ATTR_RO(midr_el1, midr);
330330
CPUREGS_ATTR_RO(revidr_el1, revidr);
331+
CPUREGS_ATTR_RO(aidr_el1, aidr);
331332
CPUREGS_ATTR_RO(smidr_el1, smidr);
332333

333334
static struct attribute *cpuregs_id_attrs[] = {
334335
&cpuregs_attr_midr_el1.attr,
335336
&cpuregs_attr_revidr_el1.attr,
337+
&cpuregs_attr_aidr_el1.attr,
336338
NULL
337339
};
338340

@@ -469,6 +471,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
469471
info->reg_dczid = read_cpuid(DCZID_EL0);
470472
info->reg_midr = read_cpuid_id();
471473
info->reg_revidr = read_cpuid(REVIDR_EL1);
474+
info->reg_aidr = read_cpuid(AIDR_EL1);
472475

473476
info->reg_id_aa64dfr0 = read_cpuid(ID_AA64DFR0_EL1);
474477
info->reg_id_aa64dfr1 = read_cpuid(ID_AA64DFR1_EL1);

0 commit comments

Comments
 (0)