Skip to content

Commit 1c8ae42

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: cpufeature: use cpucap naming
To more clearly align the various users of the cpucap enumeration, this patch changes the cpufeature code to use the term `cpucap` in favour of `cpu_hwcap`. This more clearly aligns with other users of the cpucaps, and avoids confusion with the ELF hwcaps. There should be no functional change as a result of this patch; this is purely a renaming exercise. Signed-off-by: Mark Rutland <[email protected]> Reviewed-by: Mark Brown <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 5235c7e commit 1c8ae42

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ unsigned int compat_elf_hwcap2 __read_mostly;
107107

108108
DECLARE_BITMAP(system_cpucaps, ARM64_NCAPS);
109109
EXPORT_SYMBOL(system_cpucaps);
110-
static struct arm64_cpu_capabilities const __ro_after_init *cpu_hwcaps_ptrs[ARM64_NCAPS];
110+
static struct arm64_cpu_capabilities const __ro_after_init *cpucap_ptrs[ARM64_NCAPS];
111111

112112
DECLARE_BITMAP(boot_cpucaps, ARM64_NCAPS);
113113

@@ -954,24 +954,24 @@ extern const struct arm64_cpu_capabilities arm64_errata[];
954954
static const struct arm64_cpu_capabilities arm64_features[];
955955

956956
static void __init
957-
init_cpu_hwcaps_indirect_list_from_array(const struct arm64_cpu_capabilities *caps)
957+
init_cpucap_indirect_list_from_array(const struct arm64_cpu_capabilities *caps)
958958
{
959959
for (; caps->matches; caps++) {
960960
if (WARN(caps->capability >= ARM64_NCAPS,
961961
"Invalid capability %d\n", caps->capability))
962962
continue;
963-
if (WARN(cpu_hwcaps_ptrs[caps->capability],
963+
if (WARN(cpucap_ptrs[caps->capability],
964964
"Duplicate entry for capability %d\n",
965965
caps->capability))
966966
continue;
967-
cpu_hwcaps_ptrs[caps->capability] = caps;
967+
cpucap_ptrs[caps->capability] = caps;
968968
}
969969
}
970970

971-
static void __init init_cpu_hwcaps_indirect_list(void)
971+
static void __init init_cpucap_indirect_list(void)
972972
{
973-
init_cpu_hwcaps_indirect_list_from_array(arm64_features);
974-
init_cpu_hwcaps_indirect_list_from_array(arm64_errata);
973+
init_cpucap_indirect_list_from_array(arm64_features);
974+
init_cpucap_indirect_list_from_array(arm64_errata);
975975
}
976976

977977
static void __init setup_boot_cpu_capabilities(void);
@@ -1049,10 +1049,10 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info)
10491049
init_cpu_ftr_reg(SYS_GMID_EL1, info->reg_gmid);
10501050

10511051
/*
1052-
* Initialize the indirect array of CPU hwcaps capabilities pointers
1053-
* before we handle the boot CPU below.
1052+
* Initialize the indirect array of CPU capabilities pointers before we
1053+
* handle the boot CPU below.
10541054
*/
1055-
init_cpu_hwcaps_indirect_list();
1055+
init_cpucap_indirect_list();
10561056

10571057
/*
10581058
* Detect and enable early CPU capabilities based on the boot CPU,
@@ -2048,9 +2048,9 @@ static bool has_address_auth_cpucap(const struct arm64_cpu_capabilities *entry,
20482048
static bool has_address_auth_metacap(const struct arm64_cpu_capabilities *entry,
20492049
int scope)
20502050
{
2051-
bool api = has_address_auth_cpucap(cpu_hwcaps_ptrs[ARM64_HAS_ADDRESS_AUTH_IMP_DEF], scope);
2052-
bool apa = has_address_auth_cpucap(cpu_hwcaps_ptrs[ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA5], scope);
2053-
bool apa3 = has_address_auth_cpucap(cpu_hwcaps_ptrs[ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA3], scope);
2051+
bool api = has_address_auth_cpucap(cpucap_ptrs[ARM64_HAS_ADDRESS_AUTH_IMP_DEF], scope);
2052+
bool apa = has_address_auth_cpucap(cpucap_ptrs[ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA5], scope);
2053+
bool apa3 = has_address_auth_cpucap(cpucap_ptrs[ARM64_HAS_ADDRESS_AUTH_ARCH_QARMA3], scope);
20542054

20552055
return apa || apa3 || api;
20562056
}
@@ -2895,7 +2895,7 @@ static void update_cpu_capabilities(u16 scope_mask)
28952895

28962896
scope_mask &= ARM64_CPUCAP_SCOPE_MASK;
28972897
for (i = 0; i < ARM64_NCAPS; i++) {
2898-
caps = cpu_hwcaps_ptrs[i];
2898+
caps = cpucap_ptrs[i];
28992899
if (!caps || !(caps->type & scope_mask) ||
29002900
cpus_have_cap(caps->capability) ||
29012901
!caps->matches(caps, cpucap_default_scope(caps)))
@@ -2920,7 +2920,7 @@ static int cpu_enable_non_boot_scope_capabilities(void *__unused)
29202920
u16 non_boot_scope = SCOPE_ALL & ~SCOPE_BOOT_CPU;
29212921

29222922
for_each_available_cap(i) {
2923-
const struct arm64_cpu_capabilities *cap = cpu_hwcaps_ptrs[i];
2923+
const struct arm64_cpu_capabilities *cap = cpucap_ptrs[i];
29242924

29252925
if (WARN_ON(!cap))
29262926
continue;
@@ -2950,7 +2950,7 @@ static void __init enable_cpu_capabilities(u16 scope_mask)
29502950
for (i = 0; i < ARM64_NCAPS; i++) {
29512951
unsigned int num;
29522952

2953-
caps = cpu_hwcaps_ptrs[i];
2953+
caps = cpucap_ptrs[i];
29542954
if (!caps || !(caps->type & scope_mask))
29552955
continue;
29562956
num = caps->capability;
@@ -2995,7 +2995,7 @@ static void verify_local_cpu_caps(u16 scope_mask)
29952995
scope_mask &= ARM64_CPUCAP_SCOPE_MASK;
29962996

29972997
for (i = 0; i < ARM64_NCAPS; i++) {
2998-
caps = cpu_hwcaps_ptrs[i];
2998+
caps = cpucap_ptrs[i];
29992999
if (!caps || !(caps->type & scope_mask))
30003000
continue;
30013001

@@ -3194,7 +3194,7 @@ static void __init setup_boot_cpu_capabilities(void)
31943194
bool this_cpu_has_cap(unsigned int n)
31953195
{
31963196
if (!WARN_ON(preemptible()) && n < ARM64_NCAPS) {
3197-
const struct arm64_cpu_capabilities *cap = cpu_hwcaps_ptrs[n];
3197+
const struct arm64_cpu_capabilities *cap = cpucap_ptrs[n];
31983198

31993199
if (cap)
32003200
return cap->matches(cap, SCOPE_LOCAL_CPU);
@@ -3213,7 +3213,7 @@ EXPORT_SYMBOL_GPL(this_cpu_has_cap);
32133213
static bool __maybe_unused __system_matches_cap(unsigned int n)
32143214
{
32153215
if (n < ARM64_NCAPS) {
3216-
const struct arm64_cpu_capabilities *cap = cpu_hwcaps_ptrs[n];
3216+
const struct arm64_cpu_capabilities *cap = cpucap_ptrs[n];
32173217

32183218
if (cap)
32193219
return cap->matches(cap, SCOPE_SYSTEM);

0 commit comments

Comments
 (0)