summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2024-01-22 18:13:37 +0000
committerOliver Upton <oliver.upton@linux.dev>2024-02-08 15:12:44 +0000
commitd42bf63fd4db20e1a7a414c2ebe257a81c8c7d6e (patch)
tree51643fb3ef427dbc9a29ad1aadc869f552705e6a /arch/arm64/kernel
parentd9a065914dccce0bbd967cdef1ec21b4de545daf (diff)
downloadlinux-stable-d42bf63fd4db20e1a7a414c2ebe257a81c8c7d6e.tar.gz
linux-stable-d42bf63fd4db20e1a7a414c2ebe257a81c8c7d6e.tar.bz2
linux-stable-d42bf63fd4db20e1a7a414c2ebe257a81c8c7d6e.zip
arm64: cpufeature: Correctly display signed override values
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@linux.dev> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/20240122181344.258974-4-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r--arch/arm64/kernel/cpufeature.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 92b1546f2622..bae5d0655262 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -949,7 +949,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",