]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Use static keys for CPU features
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 5 Sep 2016 17:25:48 +0000 (18:25 +0100)
committerWill Deacon <will.deacon@arm.com>
Wed, 7 Sep 2016 08:41:42 +0000 (09:41 +0100)
commitd9c453ecda9817db775ed0505ccd1de1ccd6f50b
treef271f509acaba940a50d978a14713585f34b8667
parent7b5e8751c8c30110fdecd7a526863aa129e908c5
arm64: Use static keys for CPU features

This patch adds static keys transparently for all the cpu_hwcaps
features by implementing an array of default-false static keys and
enabling them when detected. The cpus_have_cap() check uses the static
keys if the feature being checked is a constant, otherwise the compiler
generates the bitmap test.

Because of the early call to static_branch_enable() via
check_local_cpu_errata() -> update_cpu_capabilities(), the jump labels
are initialised in cpuinfo_store_boot_cpu().

Cc: Will Deacon <will.deacon@arm.com>
Cc: Suzuki K. Poulose <Suzuki.Poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/cpufeature.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/smp.c