]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
arm64: arm64_ftr_reg->name may not be a human-readable string
authorReiji Watanabe <reijiw@google.com>
Mon, 1 Nov 2021 04:54:21 +0000 (21:54 -0700)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:37 +0000 (09:48 +0100)
commit1a4f2abca16d23fe9446a6b9c39693e0a921f74e
treebbe9c8a70d21a267f5025ff1a0d5c5ae18117d3d
parent5d67bb5adf96f8fe8811a9d4a13380f666766f8c
arm64: arm64_ftr_reg->name may not be a human-readable string

BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit 9dc232a8ab18bb20f1dcb03c8e049e3607f3ed15 ]

The id argument of ARM64_FTR_REG_OVERRIDE() is used for two purposes:
one as the system register encoding (used for the sys_id field of
__ftr_reg_entry), and the other as the register name (stringified
and used for the name field of arm64_ftr_reg), which is debug
information. The id argument is supposed to be a macro that
indicates an encoding of the register (eg. SYS_ID_AA64PFR0_EL1, etc).

ARM64_FTR_REG(), which also has the same id argument,
uses ARM64_FTR_REG_OVERRIDE() and passes the id to the macro.
Since the id argument is completely macro-expanded before it is
substituted into a macro body of ARM64_FTR_REG_OVERRIDE(),
the stringified id in the body of ARM64_FTR_REG_OVERRIDE is not
a human-readable register name, but a string of numeric bitwise
operations.

Fix this so that human-readable register names are available as
debug information.

Fixes: 8f266a5d878a ("arm64: cpufeature: Add global feature override facility")
Signed-off-by: Reiji Watanabe <reijiw@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211101045421.2215822-1-reijiw@google.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/arm64/kernel/cpufeature.c