[PATCH v2 03/13] arm64: cpufeature: Correctly display signed override values

Suzuki K Poulose suzuki.poulose at arm.com
Wed Nov 22 01:16:44 PST 2023


On 20/11/2023 12:37, Marc Zyngier wrote:
> When a field gets overriden, the kernel indicates the result of
> the override in dmesg. This works well with unsigned fields, but
> results in a pretty ugly output when the field is signed.
> 
> Truncate the field to its width before displaying it.
> 
> Reviewed-by: Oliver Upton <oliver.upton at linux.dev>
> Signed-off-by: Marc Zyngier <maz at kernel.org>

Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>


> ---
>   arch/arm64/kernel/cpufeature.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index e52d2c2b757f..767a6f288755 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -950,7 +950,8 @@ static void init_cpu_ftr_reg(u32 sys_reg, u64 new)
>   				pr_warn("%s[%d:%d]: %s to %llx\n",
>   					reg->name,
>   					ftrp->shift + ftrp->width - 1,
> -					ftrp->shift, str, tmp);
> +					ftrp->shift, str,
> +					tmp & (BIT(ftrp->width) - 1));
>   		} else if ((ftr_mask & reg->override->val) == ftr_mask) {
>   			reg->override->val &= ~ftr_mask;
>   			pr_warn("%s[%d:%d]: impossible override, ignored\n",




More information about the linux-arm-kernel mailing list