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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38807C433B4 for ; Thu, 20 May 2021 13:02:27 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 09C2A61184 for ; Thu, 20 May 2021 13:02:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09C2A61184 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZlsnI11/UQ/G2KlXdHX3LO8D92KLpi33++BPQd77aVw=; b=kM2S7zqCrDuQ86L5CZwUAonmsI HKAo41BiAsBlL9OA7y4iDIOeaX6Y13Vk9fHWVwpwYKo1i2XKOoWpikTwGUpHx5UjdU/zdhNBdoHZJ u4bAzwhDEMPfRRu/fpIJg0+k+DCA40MlpawmB+SJTReOfeTFr3Vh9nZ9XD9HJ9WGDDUT6s/+XsVEn tUNlyGipem0MqWjtny/vuY5L+0Ofj4TYnUTu8S8N7pJqI6Rcl/YWR1Gra8OrheMfaTWf4Gy0YIBir 9HSuBwMtQsb7nFZCNoTgiLg53rHgMwhjRp3IQM7xFQvGXUZeFDlKtcrvvxE5L3/fUMYVhnnPngzyd F+R6Urhg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljiHs-0014cH-Su; Thu, 20 May 2021 13:00:29 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljiFG-0013C7-HY for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 12:57:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=uxYdwAOrF6q/GrVYrUwtUtQkhV9YTHNnOwtavNY+dIQ=; b=frxex7ggsroNbR0PCFKyt3Q5d5 ++UaA11Bqwuz9OCWWcH/I5+fkpk0MGTVz8aOPqaOsuKaqXd10ESKRFRoZGE4MKyLEwkm0HZEavNbt DupJqPp6pM133U269vcs1AAxGghQIg0T33a1IHmiPBw72d3rJt8ph7VXbJmYjzla7Fd5JWkIYYOVB FiuGxfo7LGDwbcrTv5ZHe3J62KVdZZrE2bHaqNa/hF6ckPi7a312QRXNNFxu1TdSc/sCRIKI08T7h EV+mhwJjaKuG5DISa/iKVAPtuqaZfs1L6BMUvAkFe8NkpIZAIxjEh4Emy8fo0YV00VzP5f1jfpLF8 sZauVPuQ==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljiFD-00GLZa-1h for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 12:57:45 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CC1CA1480; Thu, 20 May 2021 05:57:40 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.7.235]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A079B3F73B; Thu, 20 May 2021 05:57:38 -0700 (PDT) Date: Thu, 20 May 2021 13:57:35 +0100 From: Mark Rutland To: Fuad Tabba Cc: linux-arm-kernel@lists.infradead.org, will@kernel.org, catalin.marinas@arm.com, maz@kernel.org, ardb@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, robin.murphy@arm.com Subject: Re: [PATCH v3 04/18] arm64: assembler: user_alt label optional Message-ID: <20210520125735.GF17233@C02TD0UTHF1T.local> References: <20210520124406.2731873-1-tabba@google.com> <20210520124406.2731873-5-tabba@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210520124406.2731873-5-tabba@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_055743_154963_573EA24B X-CRM114-Status: GOOD ( 18.43 ) 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 Thu, May 20, 2021 at 01:43:52PM +0100, Fuad Tabba wrote: > Make the label for the extable entry in user_alt optional, only > generating an extable entry if provided. > > This is needed later in the series, to avoid instruction > duplication in the assembly code. > > While at it, clean up the label used to be globally unique using > \@ as for other macros. Nice; thanks for cleaning up the labels too! > > Signed-off-by: Fuad Tabba > --- > arch/arm64/include/asm/alternative-macros.h | 9 ++++++--- > arch/arm64/mm/cache.S | 2 +- > 2 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/include/asm/alternative-macros.h b/arch/arm64/include/asm/alternative-macros.h > index 8a078fc662ac..01ef954c9b2d 100644 > --- a/arch/arm64/include/asm/alternative-macros.h > +++ b/arch/arm64/include/asm/alternative-macros.h > @@ -197,9 +197,12 @@ alternative_endif > #define _ALTERNATIVE_CFG(insn1, insn2, cap, cfg, ...) \ > alternative_insn insn1, insn2, cap, IS_ENABLED(cfg) > > -.macro user_alt, label, oldinstr, newinstr, cond > -9999: alternative_insn "\oldinstr", "\newinstr", \cond > - _asm_extable 9999b, \label > +.macro user_alt, oldinstr, newinstr, cond, label > +.Lextable_\@: > + alternative_insn "\oldinstr", "\newinstr", \cond > + .ifnc \label, > + _asm_extable .Lextable_\@, \label > + .endif > .endm We can use _cond_extable here to simplify this to: | .macro user_alt, oldinstr, newinstr, cond, label | .Lextable_\@: | alternative_insn "\oldinstr", "\newinstr", \cond | _cond_extable .Lextable_\@, \label | .endm However, since we only use user_alt in __flush_icache_range / __flush_cache_user_range, I reckon it would be simpler overall to have those use alternative_insn and _cond_extable directly. Then that would align with the style of the *_by_line macros, and we could delete user_alt. Either way, this looks good, so: Acked-by: Mark Rutland > > #endif /* __ASSEMBLY__ */ > diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S > index 2d881f34dd9d..5ff8dfa86975 100644 > --- a/arch/arm64/mm/cache.S > +++ b/arch/arm64/mm/cache.S > @@ -47,7 +47,7 @@ alternative_else_nop_endif > sub x3, x2, #1 > bic x4, x0, x3 > 1: > -user_alt 9f, "dc cvau, x4", "dc civac, x4", ARM64_WORKAROUND_CLEAN_CACHE > +user_alt "dc cvau, x4", "dc civac, x4", ARM64_WORKAROUND_CLEAN_CACHE, 9f > add x4, x4, x2 > cmp x4, x1 > b.lo 1b > -- > 2.31.1.751.gd2f1c929bd-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel