arm64/cpufeature: Remove 4 bit assumption in ARM64_FEATURE_MASK()
authorMark Brown <broonie@kernel.org>
Tue, 27 Dec 2022 13:00:39 +0000 (13:00 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 12 Jan 2023 16:04:34 +0000 (16:04 +0000)
commite978eaca4beefb789874864c0ed99603531c5425
tree987dd97a25453fd7ef48052c27ee7c862ea2c27d
parent8c6e105558628b63292ae770198f11a1d5535660
arm64/cpufeature: Remove 4 bit assumption in ARM64_FEATURE_MASK()

The ARM64_FEATURE_MASK(), used extensively by KVM, assumes that all ID
register fields are 4 bits wide but this is not the case any more, for
example there are several 1 bit fields in ID_AA64SMFR0_EL1. Fortunately
we now have generated constants for all the ID mask registers which can
be used instead. Rather than create churn from updating existing users
update the macro to reference the generated constants and replace the
comment with a note advising against adding new users.

There are also users of ARM64_FEATURE_FIELD_BITS in the pKVM code which
will need to be fixed separately, since no relevant feature is planned to
be exposed to protected guests in the immediate future there is no
immediate issue with them assuming fields are 4 bits wide.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20221222-arm64-arm64-feature-mask-v1-1-c34c1e177f90@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/sysreg.h