Skip to content

Commit 21642da

Browse files
brooniewilldeacon
authored andcommitted
arm64/cpufeature: Consistently use symbolic constants for min_field_value
A number of the cpufeatures use raw numbers for the minimum field values specified rather than symbolic constants. In preparation for the use of helper macros replace all these with the appropriate constants. No change in the generated binary. Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 876e3c8 commit 21642da

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
22172217
.field_pos = ID_AA64PFR0_EL1_GIC_SHIFT,
22182218
.field_width = 4,
22192219
.sign = FTR_UNSIGNED,
2220-
.min_field_value = 1,
2220+
.min_field_value = ID_AA64PFR0_EL1_GIC_IMP,
22212221
},
22222222
{
22232223
.desc = "Enhanced Counter Virtualization",
@@ -2228,7 +2228,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
22282228
.field_pos = ID_AA64MMFR0_EL1_ECV_SHIFT,
22292229
.field_width = 4,
22302230
.sign = FTR_UNSIGNED,
2231-
.min_field_value = 1,
2231+
.min_field_value = ID_AA64MMFR0_EL1_ECV_IMP,
22322232
},
22332233
#ifdef CONFIG_ARM64_PAN
22342234
{
@@ -2240,7 +2240,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
22402240
.field_pos = ID_AA64MMFR1_EL1_PAN_SHIFT,
22412241
.field_width = 4,
22422242
.sign = FTR_UNSIGNED,
2243-
.min_field_value = 1,
2243+
.min_field_value = ID_AA64MMFR1_EL1_PAN_IMP,
22442244
.cpu_enable = cpu_enable_pan,
22452245
},
22462246
#endif /* CONFIG_ARM64_PAN */
@@ -2254,7 +2254,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
22542254
.field_pos = ID_AA64MMFR1_EL1_PAN_SHIFT,
22552255
.field_width = 4,
22562256
.sign = FTR_UNSIGNED,
2257-
.min_field_value = 3,
2257+
.min_field_value = ID_AA64MMFR1_EL1_PAN_PAN3,
22582258
},
22592259
#endif /* CONFIG_ARM64_EPAN */
22602260
#ifdef CONFIG_ARM64_LSE_ATOMICS
@@ -2267,7 +2267,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
22672267
.field_pos = ID_AA64ISAR0_EL1_ATOMIC_SHIFT,
22682268
.field_width = 4,
22692269
.sign = FTR_UNSIGNED,
2270-
.min_field_value = 2,
2270+
.min_field_value = ID_AA64ISAR0_EL1_ATOMIC_IMP,
22712271
},
22722272
#endif /* CONFIG_ARM64_LSE_ATOMICS */
22732273
{
@@ -2335,7 +2335,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
23352335
.sys_reg = SYS_ID_AA64PFR0_EL1,
23362336
.field_pos = ID_AA64PFR0_EL1_CSV3_SHIFT,
23372337
.field_width = 4,
2338-
.min_field_value = 1,
2338+
.min_field_value = ID_AA64PFR0_EL1_CSV3_IMP,
23392339
.matches = unmap_kernel_at_el0,
23402340
.cpu_enable = kpti_install_ng_mappings,
23412341
},
@@ -2355,7 +2355,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
23552355
.sys_reg = SYS_ID_AA64ISAR1_EL1,
23562356
.field_pos = ID_AA64ISAR1_EL1_DPB_SHIFT,
23572357
.field_width = 4,
2358-
.min_field_value = 1,
2358+
.min_field_value = ID_AA64ISAR1_EL1_DPB_IMP,
23592359
},
23602360
{
23612361
.desc = "Data cache clean to Point of Deep Persistence",
@@ -2366,7 +2366,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
23662366
.sign = FTR_UNSIGNED,
23672367
.field_pos = ID_AA64ISAR1_EL1_DPB_SHIFT,
23682368
.field_width = 4,
2369-
.min_field_value = 2,
2369+
.min_field_value = ID_AA64ISAR1_EL1_DPB_DPB2,
23702370
},
23712371
#endif
23722372
#ifdef CONFIG_ARM64_SVE
@@ -2437,7 +2437,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
24372437
.sign = FTR_UNSIGNED,
24382438
.field_pos = ID_AA64MMFR2_EL1_FWB_SHIFT,
24392439
.field_width = 4,
2440-
.min_field_value = 1,
2440+
.min_field_value = ID_AA64MMFR2_EL1_FWB_IMP,
24412441
.matches = has_cpuid_feature,
24422442
},
24432443
{
@@ -2448,7 +2448,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
24482448
.sign = FTR_UNSIGNED,
24492449
.field_pos = ID_AA64MMFR2_EL1_TTL_SHIFT,
24502450
.field_width = 4,
2451-
.min_field_value = 1,
2451+
.min_field_value = ID_AA64MMFR2_EL1_TTL_IMP,
24522452
.matches = has_cpuid_feature,
24532453
},
24542454
{
@@ -2478,7 +2478,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
24782478
.sign = FTR_UNSIGNED,
24792479
.field_pos = ID_AA64MMFR1_EL1_HAFDBS_SHIFT,
24802480
.field_width = 4,
2481-
.min_field_value = 2,
2481+
.min_field_value = ID_AA64MMFR1_EL1_HAFDBS_DBM,
24822482
.matches = has_hw_dbm,
24832483
.cpu_enable = cpu_enable_hw_dbm,
24842484
},
@@ -2491,7 +2491,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
24912491
.sys_reg = SYS_ID_AA64ISAR0_EL1,
24922492
.field_pos = ID_AA64ISAR0_EL1_CRC32_SHIFT,
24932493
.field_width = 4,
2494-
.min_field_value = 1,
2494+
.min_field_value = ID_AA64ISAR0_EL1_CRC32_IMP,
24952495
},
24962496
{
24972497
.desc = "Speculative Store Bypassing Safe (SSBS)",
@@ -2514,7 +2514,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
25142514
.sign = FTR_UNSIGNED,
25152515
.field_pos = ID_AA64MMFR2_EL1_CnP_SHIFT,
25162516
.field_width = 4,
2517-
.min_field_value = 1,
2517+
.min_field_value = ID_AA64MMFR2_EL1_CnP_IMP,
25182518
.cpu_enable = cpu_enable_cnp,
25192519
},
25202520
#endif
@@ -2527,7 +2527,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
25272527
.field_pos = ID_AA64ISAR1_EL1_SB_SHIFT,
25282528
.field_width = 4,
25292529
.sign = FTR_UNSIGNED,
2530-
.min_field_value = 1,
2530+
.min_field_value = ID_AA64ISAR1_EL1_SB_IMP,
25312531
},
25322532
#ifdef CONFIG_ARM64_PTR_AUTH
25332533
{
@@ -2636,7 +2636,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
26362636
.field_width = 4,
26372637
.field_pos = ID_AA64MMFR2_EL1_E0PD_SHIFT,
26382638
.matches = has_cpuid_feature,
2639-
.min_field_value = 1,
2639+
.min_field_value = ID_AA64MMFR2_EL1_E0PD_IMP,
26402640
.cpu_enable = cpu_enable_e0pd,
26412641
},
26422642
#endif
@@ -2649,7 +2649,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
26492649
.field_pos = ID_AA64ISAR0_EL1_RNDR_SHIFT,
26502650
.field_width = 4,
26512651
.sign = FTR_UNSIGNED,
2652-
.min_field_value = 1,
2652+
.min_field_value = ID_AA64ISAR0_EL1_RNDR_IMP,
26532653
},
26542654
#ifdef CONFIG_ARM64_BTI
26552655
{
@@ -2703,7 +2703,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
27032703
.field_pos = ID_AA64ISAR1_EL1_LRCPC_SHIFT,
27042704
.field_width = 4,
27052705
.matches = has_cpuid_feature,
2706-
.min_field_value = 1,
2706+
.min_field_value = ID_AA64ISAR1_EL1_LRCPC_IMP,
27072707
},
27082708
#ifdef CONFIG_ARM64_SME
27092709
{

0 commit comments

Comments
 (0)