From patchwork Thu May 20 12:43:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12270185 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=-17.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, USER_AGENT_GIT 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 EAF7FC433B4 for ; Thu, 20 May 2021 12:47:05 +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 7266561001 for ; Thu, 20 May 2021 12:47:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7266561001 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:From:Subject:References:Mime-Version: Message-Id:In-Reply-To:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x3QzVR8GIfV1xtDOQVY1ZxRzts9GV9ko2VUtCfa5dFg=; b=kUsszlJ5mPYahi Nj3mknxNV1HVWWo4zSK3SjaAj37a9sFRFihqNVR3F+kW1+8/br0oTLMSigNTekkAReWEwnm6rgg0Y McpML4UtUazQorTuvCbMpG343M21ADfWQZD44QJvvr6VHvJ5WXa5s+84TXFHJ4fvSjNSZ2/eN5ugF 5OwbRziN6lQw0VINGP0D7AvxlTiWMM6slXa4HnrUbD+rJW6BBeiUSHrwif+cFNizaZcHRsXd6R3pD N4158HGjKDQktNKVgWkSRL3rms7L+q+YkFTzo+szH/SslwojArACecxhQllGBxezSmruJf9Rlwiib tEitIGw+J1TYdU5+8GDQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lji3a-000ucB-3Z; Thu, 20 May 2021 12:45:43 +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 1lji2H-000tyo-FL for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 12:44:22 +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:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fiOfESK8uNKrmxRFnQd8OuF11vrmOMEdK04yXlOW+Vk=; b=H619mAyBPZda2yMhJufqhLbCXR DQowsziYA5yfHsWwngj729Lsmzz6AsqRPQUantGwxAExXzRsMeQGRpg2fFSW7b7xI/3dGOsVePl5l XqAbDc6mxE7VUbCd2OFX1QpejbAsv9sBnOXkj771xaF68NWt1dpoxC/hlo4Ww+hiiSs3nU+mnYx9D xGd3s6L3Sk8DDNvHMEEdLoBKP6VZ2rwk13CNETt/AfivLhuhp3hRk+CDqSNw2Ers7OgztX/TCIFda F6nUP3JxbC6yGIRr6rZ6nNtvPMu1UlYmHA1gDO54f+9JfgF1VAzmV/CZI8Ma4bLnLsUtJ6wUMrpro etlFYRNQ==; Received: from mail-qt1-x849.google.com ([2607:f8b0:4864:20::849]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lji2F-00GKco-0i for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 12:44:20 +0000 Received: by mail-qt1-x849.google.com with SMTP id d7-20020ac811870000b02901e65f85117bso12160535qtj.18 for ; Thu, 20 May 2021 05:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=fiOfESK8uNKrmxRFnQd8OuF11vrmOMEdK04yXlOW+Vk=; b=h/DugLhKCzSHMxiupT9gr/VKpN7SaM+S75lj4uvD5X7aH4rYMzKeJYIO5by4989Xlq fpqhjIbayGnCUVIbbWPfXOApMJF+2V+C+YTDsqjlZ6UOp9K7pu9iBLXJKzKaHphDEDUt E9Vmp+Glwh5It54akach7EAs1645zPcDof4Iq1QhmVrK44udTdKSXkWsad1204Nwu++W RnO/0LHdbeOb18QQHZQ8Qwk+VvfoTAFlMH0V8A1pKgD/rCVZuCoqW6D782Lmqo8W9hsL 7v/tjpOJzPjA1eDMR+lkm+dF7NrSWM/OBoUyh4n757nnkgvTZtGO19AUQ0H7xIdPlXYI QD5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=fiOfESK8uNKrmxRFnQd8OuF11vrmOMEdK04yXlOW+Vk=; b=TsOEowQ4gPhSvCG6FJbAKvaGRSYnIKOQWMWkPBQ0NlcLIpMvrMfy4wgbGMQkyF20Ei SipzJcXA+1BY0tbLBPHMm2zqYx9s8fbftOQmvx+SPycVA1dIjiSxnV1i4zgDG2lgHPNE 1kKsZQagdGNvj/lHwlB68i/mF59U89nTYhI7j8tBSKPbqWLkb6Dq7XcDCNpEf35KSqua z3fPpym/o+pLocHJmgoBlq5RYHUK8NofKT9ylocCpFuO5xOn6IjvXiBLjdgzoE1B02pH 9crQ2S7JWlArqEX2Aa7FL3sVGI8ZkQI1UAJY3gewawMgjN0SbJZyGlqHw0pyaGDf0VRl GBrA== X-Gm-Message-State: AOAM532CMT1ohMMqtAvSPfOgRRUBp10u4Y/QatmcBkSpPy4icJh2DrVY xbZ+Lwy7wSRXrv4OS5AsTBKanle4bmeSDWtXoxckAHZ1x0elsyooIS6G9m0X6JxaJGJjL9UQFCq gMhDyrqlgNx61kWxK+cJp6yqKjteZnWDS64gmnyVTEvg7hKsNhXwZy9emJ3h67sO2rfsmzkbuHj RiuA== X-Google-Smtp-Source: ABdhPJxT7DWTU1WS3W3nRaXIE1BrP9QhC7u2TSoQ5EX3+7XV1khSYGcAh7f/usNLopG3IGCvemFTw3Y7Fw== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:ad4:5ca2:: with SMTP id q2mr5421089qvh.49.1621514656695; Thu, 20 May 2021 05:44:16 -0700 (PDT) Date: Thu, 20 May 2021 13:43:52 +0100 In-Reply-To: <20210520124406.2731873-1-tabba@google.com> Message-Id: <20210520124406.2731873-5-tabba@google.com> Mime-Version: 1.0 References: <20210520124406.2731873-1-tabba@google.com> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog Subject: [PATCH v3 04/18] arm64: assembler: user_alt label optional From: Fuad Tabba To: linux-arm-kernel@lists.infradead.org Cc: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, maz@kernel.org, ardb@kernel.org, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, robin.murphy@arm.com, tabba@google.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_054419_077978_AF6C9D7B X-CRM114-Status: GOOD ( 12.14 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Signed-off-by: Fuad Tabba Acked-by: Mark Rutland --- 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 #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