From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99E33C433F5 for ; Mon, 1 Nov 2021 10:26:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 641F060F70 for ; Mon, 1 Nov 2021 10:26:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 641F060F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9KDTqT9JKRLiOwqsGb/M0UnVjwfa1NwFMdNVbkGOzRo=; b=wDBDCIZIKL/9+1 NmSKM7Uw5B1YAdhLdUxn4x/bbFHfWlWvKjrDgQKn69vE6avPQqbBbO5mII6pYaAnewGSeqPeBnhem 5Geh/22lKk8J0dnq/K5jVTRZLMcMivFQSltr0CkWv+G2hEwWevtTDWoyK3qOqUWF8qfHWGm2qh2fW hltzs5N0soBFm8zMIGcXdxtiUd57r4YJ/rjN6dn1eeOzOKiy97jVMU22vSTe2/839WCurIXckTS3a vo8SA2TIbA1fnc2KO63+mMxAx+au4hZzpq7hWNyb82PquQH/mOL/bvHH1ZIQIA5cfNrDfZm2xGEXF bok6trdjTVVPIXUBH7ow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhUV1-00Fw1M-Kx; Mon, 01 Nov 2021 10:25:07 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhUUy-00Fw0s-1i for linux-arm-kernel@lists.infradead.org; Mon, 01 Nov 2021 10:25:05 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41EB360FC4; Mon, 1 Nov 2021 10:25:03 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mhUUv-002qKJ-AD; Mon, 01 Nov 2021 10:25:01 +0000 Date: Mon, 01 Nov 2021 10:25:00 +0000 Message-ID: <87a6io9nr7.wl-maz@kernel.org> From: Marc Zyngier To: Reiji Watanabe Cc: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Oliver Upton , Jing Zhang , Raghavendra Rao Anata Subject: Re: [PATCH] arm64: arm64_ftr_reg->name may not be a human-readable string In-Reply-To: <20211101045421.2215822-1-reijiw@google.com> References: <20211101045421.2215822-1-reijiw@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: reijiw@google.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, pshier@google.com, ricarkol@google.com, oupton@google.com, jingzhangos@google.com, rananta@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211101_032504_174343_2A8D31F5 X-CRM114-Status: GOOD ( 26.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 01 Nov 2021 04:54:21 +0000, Reiji Watanabe wrote: > > 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 > --- > arch/arm64/kernel/cpufeature.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 6ec7036ef7e1..7553c98f379f 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; Seems reasonable to me. Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel