[PATCH v4 02/10] arm64: cpufeatures: Correctly handle signed values
Catalin Marinas
catalin.marinas at arm.com
Thu Feb 8 04:13:54 PST 2024
On Mon, Jan 22, 2024 at 06:13:36PM +0000, Marc Zyngier wrote:
> Although we've had signed values for some features such as PMUv3
> and FP, the code that handles the comparaison with some limit
> has a couple of annoying issues:
>
> - the min_field_value is always unsigned, meaning that we cannot
> easily compare it with a negative value
>
> - it is not possible to have a range of values, let alone a range
> of negative values
>
> Fix this by:
>
> - adding an upper limit to the comparison, defaulting to all bits
> being set to the maximum positive value
>
> - ensuring that the signess of the min and max values are taken into
> account
>
> A ARM64_CPUID_FIELDS_NEG() macro is provided for signed features, but
> nothing is using it yet.
>
> Signed-off-by: Marc Zyngier <maz at kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>
More information about the linux-arm-kernel
mailing list