mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 09:13:37 +00:00
arm64: kernel: Add cpufeature 'enable' callback
This patch adds an 'enable()' callback to cpu capability/feature detection, allowing features that require some setup or configuration to get this opportunity once the feature has been detected. Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
parent
870828e57b
commit
1c0763037f
2 changed files with 7 additions and 0 deletions
|
|
@ -34,6 +34,7 @@ struct arm64_cpu_capabilities {
|
||||||
const char *desc;
|
const char *desc;
|
||||||
u16 capability;
|
u16 capability;
|
||||||
bool (*matches)(const struct arm64_cpu_capabilities *);
|
bool (*matches)(const struct arm64_cpu_capabilities *);
|
||||||
|
void (*enable)(void);
|
||||||
union {
|
union {
|
||||||
struct { /* To be used for erratum handling only */
|
struct { /* To be used for erratum handling only */
|
||||||
u32 midr_model;
|
u32 midr_model;
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,12 @@ void check_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
|
||||||
pr_info("%s %s\n", info, caps[i].desc);
|
pr_info("%s %s\n", info, caps[i].desc);
|
||||||
cpus_set_cap(caps[i].capability);
|
cpus_set_cap(caps[i].capability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* second pass allows enable() to consider interacting capabilities */
|
||||||
|
for (i = 0; caps[i].desc; i++) {
|
||||||
|
if (cpus_have_cap(caps[i].capability) && caps[i].enable)
|
||||||
|
caps[i].enable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void check_local_cpu_features(void)
|
void check_local_cpu_features(void)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue