]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
arm64/cpuinfo: Define HWCAP name arrays per their actual bit definitions
authorAnshuman Khandual <anshuman.khandual@arm.com>
Wed, 9 Sep 2020 05:48:55 +0000 (11:18 +0530)
committerWill Deacon <will@kernel.org>
Fri, 11 Sep 2020 15:29:44 +0000 (16:29 +0100)
commit4e56de82d4ec9d98ffdc9e0387d8fdecbf496226
tree2ccadcb95d155cd6eba10b621a3aa351cbae5fc5
parentf75aef392f869018f78cfedf3c320a6b3fcfda6b
arm64/cpuinfo: Define HWCAP name arrays per their actual bit definitions

HWCAP name arrays (hwcap_str, compat_hwcap_str, compat_hwcap2_str) that are
scanned for /proc/cpuinfo are detached from their bit definitions making it
vulnerable and difficult to correlate. It is also bit problematic because
during /proc/cpuinfo dump these arrays get traversed sequentially assuming
they reflect and match actual HWCAP bit sequence, to test various features
for a given CPU. This redefines name arrays per their HWCAP bit definitions
. It also warns after detecting any feature which is not expected on arm64.

Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/1599630535-29337-1-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/hwcap.h
arch/arm64/kernel/cpuinfo.c