]> git.ipfire.org Git - thirdparty/linux.git/commit
arm64: cpufeature: Add helper to test for CPU feature overrides
authorArd Biesheuvel <ardb@kernel.org>
Wed, 14 Feb 2024 12:28:56 +0000 (13:28 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 16 Feb 2024 12:42:30 +0000 (12:42 +0000)
commit35876f35f4821c92fb1bbff7eec5780dba4fffdb
tree13689f67fec71496ab83293eeb3056c0b73f791f
parent8a6e40e1f68e9fc44497db88e0c0f21bb513c551
arm64: cpufeature: Add helper to test for CPU feature overrides

Add some helpers to extract and apply feature overrides to the bare
idreg values. This involves inspecting the value and mask of the
specific field that we are interested in, given that an override
value/mask pair might be invalid for one field but valid for another.

Then, wire up the new helper for the hVHE test - note that we can drop
the sysreg test here, as the override will be invalid when trying to
enable hVHE on non-VHE capable hardware.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240214122845.2033971-55-ardb+git@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/cpufeature.h
arch/arm64/kernel/cpufeature.c