Patch "arm64: arm64_ftr_reg->name may not be a human-readable string" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    arm64: arm64_ftr_reg->name may not be a human-readable string

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm64-arm64_ftr_reg-name-may-not-be-a-human-readable.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5e49ee1da1ca3bb37ecf7d48055bf07b43fbc5a4
Author: Reiji Watanabe <reijiw@xxxxxxxxxx>
Date:   Sun Oct 31 21:54:21 2021 -0700

    arm64: arm64_ftr_reg->name may not be a human-readable string
    
    [ 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@xxxxxxxxxx>
    Reviewed-by: Oliver Upton <oupton@xxxxxxxxxx>
    Acked-by: Marc Zyngier <maz@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20211101045421.2215822-1-reijiw@xxxxxxxxxx
    Signed-off-by: Will Deacon <will@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 6ec7036ef7e18..7553c98f379fc 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -573,15 +573,19 @@ static const struct arm64_ftr_bits ftr_raz[] = {
 	ARM64_FTR_END,
 };
 
-#define ARM64_FTR_REG_OVERRIDE(id, table, ovr) {		\
+#define __ARM64_FTR_REG_OVERRIDE(id_str, id, table, ovr) {	\
 		.sys_id = id,					\
 		.reg = 	&(struct arm64_ftr_reg){		\
-			.name = #id,				\
+			.name = id_str,				\
 			.override = (ovr),			\
 			.ftr_bits = &((table)[0]),		\
 	}}
 
-#define ARM64_FTR_REG(id, table) ARM64_FTR_REG_OVERRIDE(id, table, &no_override)
+#define ARM64_FTR_REG_OVERRIDE(id, table, ovr)	\
+	__ARM64_FTR_REG_OVERRIDE(#id, id, table, ovr)
+
+#define ARM64_FTR_REG(id, table)		\
+	__ARM64_FTR_REG_OVERRIDE(#id, id, table, &no_override)
 
 struct arm64_ftr_override __ro_after_init id_aa64mmfr1_override;
 struct arm64_ftr_override __ro_after_init id_aa64pfr1_override;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux