Skip to content

Commit eab43e8

Browse files
Suzuki K Poulosewildea01
authored andcommitted
arm64: cpufeature: Cleanup feature bit tables
This patch does the following clean ups : 1) All undescribed fields of a register are now treated as 'strict' with a safe value of 0. Hence we could leave an empty table for describing registers which are RAZ. 2) ID_AA64DFR1_EL1 is RAZ and should use the table for RAZ register. 3) ftr_generic32 is used to represent a register with a 32bit feature value. Rename this to ftr_singl32 to make it more obvious. Since we don't have a 64bit singe feature register, kill ftr_generic. Based on a patch by Mark Rutland. Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Reviewed-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 564279f commit eab43e8

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,13 @@ static const struct arm64_ftr_bits ftr_generic_32bits[] = {
252252
ARM64_FTR_END,
253253
};
254254

255-
static const struct arm64_ftr_bits ftr_generic[] = {
256-
ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 0, 64, 0),
257-
ARM64_FTR_END,
258-
};
259-
260-
static const struct arm64_ftr_bits ftr_generic32[] = {
255+
/* Table for a single 32bit feature value */
256+
static const struct arm64_ftr_bits ftr_single32[] = {
261257
ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 0, 32, 0),
262258
ARM64_FTR_END,
263259
};
264260

265-
static const struct arm64_ftr_bits ftr_aa64raz[] = {
266-
ARM64_FTR_BITS(FTR_STRICT, FTR_EXACT, 0, 64, 0),
261+
static const struct arm64_ftr_bits ftr_raz[] = {
267262
ARM64_FTR_END,
268263
};
269264

@@ -304,15 +299,15 @@ static const struct __ftr_reg_entry {
304299

305300
/* Op1 = 0, CRn = 0, CRm = 4 */
306301
ARM64_FTR_REG(SYS_ID_AA64PFR0_EL1, ftr_id_aa64pfr0),
307-
ARM64_FTR_REG(SYS_ID_AA64PFR1_EL1, ftr_aa64raz),
302+
ARM64_FTR_REG(SYS_ID_AA64PFR1_EL1, ftr_raz),
308303

309304
/* Op1 = 0, CRn = 0, CRm = 5 */
310305
ARM64_FTR_REG(SYS_ID_AA64DFR0_EL1, ftr_id_aa64dfr0),
311-
ARM64_FTR_REG(SYS_ID_AA64DFR1_EL1, ftr_generic),
306+
ARM64_FTR_REG(SYS_ID_AA64DFR1_EL1, ftr_raz),
312307

313308
/* Op1 = 0, CRn = 0, CRm = 6 */
314309
ARM64_FTR_REG(SYS_ID_AA64ISAR0_EL1, ftr_id_aa64isar0),
315-
ARM64_FTR_REG(SYS_ID_AA64ISAR1_EL1, ftr_aa64raz),
310+
ARM64_FTR_REG(SYS_ID_AA64ISAR1_EL1, ftr_raz),
316311

317312
/* Op1 = 0, CRn = 0, CRm = 7 */
318313
ARM64_FTR_REG(SYS_ID_AA64MMFR0_EL1, ftr_id_aa64mmfr0),
@@ -324,7 +319,7 @@ static const struct __ftr_reg_entry {
324319
ARM64_FTR_REG(SYS_DCZID_EL0, ftr_dczid),
325320

326321
/* Op1 = 3, CRn = 14, CRm = 0 */
327-
ARM64_FTR_REG(SYS_CNTFRQ_EL0, ftr_generic32),
322+
ARM64_FTR_REG(SYS_CNTFRQ_EL0, ftr_single32),
328323
};
329324

330325
static int search_cmp_ftr_reg(const void *id, const void *regp)

0 commit comments

Comments
 (0)