]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: cpufeature: Warn if we attempt to read a zero width field
authorMark Brown <broonie@kernel.org>
Mon, 7 Mar 2022 18:08:59 +0000 (18:08 +0000)
committerWill Deacon <will@kernel.org>
Mon, 7 Mar 2022 21:40:52 +0000 (21:40 +0000)
commit71ae7a09546316788112e319bcfc482d99596264
treea958791bf1f12cf21b72ac0ffe877bc4f2034b4a
parent6a98b9e3c63f00b06b428004bb2fff3df1f9dec9
arm64: cpufeature: Warn if we attempt to read a zero width field

Add a WARN_ON_ONCE() when extracting a field if no width is specified. This
should never happen outside of development since it will be triggered with
or without the feature so long as the relevant ID register is present.  If
the warning triggers hope that the field was the standard 4 bits wide and
soldier on.

Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220307180900.3045812-1-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/cpufeature.h