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_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 66E65C433B4 for ; Fri, 21 May 2021 11:49:38 +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 DC85A6138C for ; Fri, 21 May 2021 11:49:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC85A6138C Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p5oI8/3Z1E9sS1Mlu6Ou80/IaIR8lVXXTHf3xGxOMFU=; b=NJrz2798IfsKwey7z96VVWhQSa vXkmqBA3z0q3hhH2Z0kWjidVVyexMxaATel+EOGLf4vlDDN4ssWyGlrgAwBSRwVVTucwjzDFIRGNf FBvW+B2WrCd4aWynKOq7JnCD6YUOVa1xq6BdWesn3Ce3hJbLlmsG6lC73An3aFf9umdS7+x0owQX7 p4QAEh2unKx8V1mOlz1YgBcH9xgFTVpx7xMTp8KS2em9Czs78o6KroTAhE1FGfQUjdDm0t2FvdWMw V/ber7E3Drig+WXQswhTMRtiu3/GEph3N6MwIoPxrJJ8ClZ6v22oWfCKqIhtODK6DCfD1q72HKWUx Wpe34VlA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk3cI-005Cs8-E1; Fri, 21 May 2021 11:46:59 +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 1lk3cG-005Crn-7U for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 11:46:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mpqc0LAKE1qO5TloNmjspNTdbMh8PzpRcyuxz75STug=; b=OaL285VGVQLyCkpJYJrdBHvgZ9 ib9XIV0kFTtHL/FzjWq4pSkYMS6byN3F4v7y4a8jtGBlFMICxpPlTE8h5Dvx/ej3fS9bfsmJuyXpj cXxICwZYGdDiKfaV4Kqrh+YqrpUHmpdXCplcu9fuFuQAMICX32tyUBXlVyGl4wz7am3L02QFKKQsJ tVy0n/qPk5VeCqHLNDf2sqZs9sPMZDhANrhTddRXFik5UjGNsOUOsWKxEKu4I0NSKN/QG9vnKS4H9 ztyhrp7QcEzUIeGLl0wJ1OkGeX3zL2WJzSKcMh5QXXNGVYJh6VO7pwRWnI3iPvoiwni1lQRht5Jg1 aXjT4DZg==; Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lk3cD-00H4k5-Am for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 11:46:54 +0000 Received: by mail-oi1-x22d.google.com with SMTP id h9so19421480oih.4 for ; Fri, 21 May 2021 04:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mpqc0LAKE1qO5TloNmjspNTdbMh8PzpRcyuxz75STug=; b=myTb6zYQwU/+nAdbFNMsh8LNaY8oV+Ji8L5wDdmF3MR0OgFtw/gQJlSWz2d0CXenI4 ysDOcGwAeeW3clrHLb94HPXIWrwiPvPtuYwkRY0sN4neAeYEHnJWwJdESYdgpafJ0f/4 TZv+jkT2f8qpr1ktC8Fp1S0QAV8vDJDU80lY9V++6EAiWEWA0IhJQOHbIcdc8P1DPD9a BduxTAnA93rgE0CIL5h9bK/0kEPqsXz11AxuIpGOP8s1nofP8qX1dKw9Zmdtz/hpmMCJ fQfcIL7tmUzyc6ZuaIfnbd88DSsiLDx54UH2KpsUFM9rRf/SnEEX+8Dg3O+6/qNS/+wg BjgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mpqc0LAKE1qO5TloNmjspNTdbMh8PzpRcyuxz75STug=; b=XNHMveaSuFqNtGckytXeUe/RW4bzU6Gu0ESHWfS6IY3cnGXXCgjEPd7vdrJR5BfBYC stcw0tjlQuOabIuAYTE8ONFIkWg3krO3JU7r68k98dCD6Dt2nksfOXzFUYDDOBi22R/l 2W+O1SSm/BfGk5Ka+RKDx4OjCoNG8LYqmtVSPsTjfkbUufG5bFvBRLIFirtE7j2qz02D zfnP8l5qP3QYzXq0tacw9uUHfrCgIgxi5bw6Y3aV/SfGnVArylmo4UKdjRsMQq1/UHga JRrfOiFOzkLYUAPCqp030TjuyWsxaOIYGo/V8dRvpoeWf18gMuey+6IFrscoZh59lw/q DORA== X-Gm-Message-State: AOAM532SLnKL9VTpi/rGdSZfWDrMSeBIQZXWu3TIZQ4OgpXvMeMdKM6o vzvTZp1NZurU7k/dy7IpK5Xs3SqfxMr7zTNfxYAdZg== X-Google-Smtp-Source: ABdhPJzFneORTiCbHGisCBmhVwr8AblhsByjciI0pBXH8XbGdObDPuqnb1A55s6+Xky/EDlxWLYdEPpApq8VQyhSe9w= X-Received: by 2002:a05:6808:6d6:: with SMTP id m22mr1851955oih.90.1621597610735; Fri, 21 May 2021 04:46:50 -0700 (PDT) MIME-Version: 1.0 References: <20210520124406.2731873-1-tabba@google.com> <20210520124406.2731873-5-tabba@google.com> <20210520125735.GF17233@C02TD0UTHF1T.local> In-Reply-To: <20210520125735.GF17233@C02TD0UTHF1T.local> From: Fuad Tabba Date: Fri, 21 May 2021 12:46:14 +0100 Message-ID: Subject: Re: [PATCH v3 04/18] arm64: assembler: user_alt label optional To: Mark Rutland Cc: "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , Will Deacon , Catalin Marinas , Marc Zyngier , Ard Biesheuvel , James Morse , Alexandru Elisei , Suzuki K Poulose , Robin Murphy X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_044653_409797_7E7DFF65 X-CRM114-Status: GOOD ( 26.57 ) 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 Hi Mark, On Thu, May 20, 2021 at 1:57 PM Mark Rutland wrote: > > 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. Thanks for this, and for the comments on the other patches in this series. I'll rebase this series on rc3 when it comes out, apply your suggestions, and send it out. Cheers, /fuad > > 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