Skip to content

Commit d42bf63

Browse files
Marc Zyngieroupton
authored andcommitted
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 <[email protected]> Reviewed-by: Suzuki K Poulose <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent d9a0659 commit d42bf63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,8 @@ static void init_cpu_ftr_reg(u32 sys_reg, u64 new)
949949
pr_warn("%s[%d:%d]: %s to %llx\n",
950950
reg->name,
951951
ftrp->shift + ftrp->width - 1,
952-
ftrp->shift, str, tmp);
952+
ftrp->shift, str,
953+
tmp & (BIT(ftrp->width) - 1));
953954
} else if ((ftr_mask & reg->override->val) == ftr_mask) {
954955
reg->override->val &= ~ftr_mask;
955956
pr_warn("%s[%d:%d]: impossible override, ignored\n",

0 commit comments

Comments
 (0)