From patchwork Thu Jul 30 15:37:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 11693313 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9503014B7 for ; Thu, 30 Jul 2020 15:41:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 6B7432082E for ; Thu, 30 Jul 2020 15:41:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="V/lGT0Tl"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="IUuZ4yIP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B7432082E 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id: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=ziPhA+N6NANJwgg0IAGvG8x9Eaie6RUI90fyPeoEJxQ=; b=V/lGT0Tl0fxVAUSWNmmI+TS+3 ZC83QtP1i3bRPeF+foQA8dBcUoV93Moao4V3f/dtSa7VP32P0JGCZUfl4/DYa8eDq1oVEmzdCK8OO EdY/M7AC3SFv5ZjfTz/jI8Fcbtnk+5Pvd5IAFoS9OHdzeYFo3oYmkJ8lDBmtQuXu8jmZNIDZjesL9 9+przomiB/IxEQMEipSPVn71W+QAhQA8JTQIrMjRIfwxQd38FTl9ghMxYsKXqMRQvrfHtZoZ8olxo JxrQfDCM/5MuI3NQ+cES+Bdu0imRtPv2LXyDzKI6Rq7D3wykqpaXI52DfSZGeqU/FqNO+L2RlnFlu oDVpBJ+PQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1Ae7-00042r-5K; Thu, 30 Jul 2020 15:39:03 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1AcI-0002uy-My for linux-arm-kernel@lists.infradead.org; Thu, 30 Jul 2020 15:37:11 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id l15so844903ybq.7 for ; Thu, 30 Jul 2020 08:37:08 -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=IxpQl+U4Cci+VujQeEVAy+X3aO84K4nWxe4WSDjauTc=; b=IUuZ4yIPiNNKD7wzRr7z//0o/R3OjV7yHYGXQWvGy2iAQ4BWK9M1eVKaxEhD403+KF M3ALR70+4KVyqznMOqnXQ8yMz9bDv2IF4FSy123jSwWcMJR1hqBK3ZpJVbtEMxKJR4yz GnoQLLpEYsQX0DGTZ7DBIRXk2bmdxalvVu2gziRivHLe4cdoDRRoKNz8N+Oil7ikHLKT TFsGtcOAG3aAHcLsZnYmMrq2GNSkj2Xx2hGy0fOIxWulD6SgV3nWv+KyZph5ieTAfCLL JlLrmEWHVaqDbaepEr+nEd0U4rH6dcVN/4oAQ7kGiCc+PoV7X/09SduIWIEb+XazTiqu tYmQ== 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=IxpQl+U4Cci+VujQeEVAy+X3aO84K4nWxe4WSDjauTc=; b=SsI49mVq1Ce6FWthE50J6vZYWhlnzkYPQuQMwDTpVb8QXMUoBdy2IeD8hsBYmDwWZW Fla+A0NUkrcsLvV7QpQ4ajnhrXraLT8DFQRiTrIBIteVp6c/Urk7PBZZyg9nrV1y8d1K X7Pgn2gnBO00Fb/w1RrhAfSgRsqyEMM90yoc+x965czE5EsgFx1/GroIGhJ2Ht1qUZVG JuvbBW8jjtbI2LOiwgFp0PN9CcuQu0F4KrGsaxE0JVsOE3qVBQ1HgsFMtYzLYSLBwuts WVdEV3wPAZLX1BQOHskwWfJ0Y3p0NOIPUSHgQMqkdy6W4t1PrF1mT8jyqlMN4uDR1WM2 2wZg== X-Gm-Message-State: AOAM533ESFpLdxIYoyySCh21KtIdyWDbVpaotXWd9UtB+LsseewicjDo 3+jT99SK8VQJFPCSyVW01MO26hYafJVQRHEFwtg= X-Google-Smtp-Source: ABdhPJzcj+/fyYup62Pb5vBi5uJFCfbTGtxNScJYQNvFrcTXPq8Z0QUD4AnWOU0P6pOttuZ1A2TSbvaltVZkQHUu5WA= X-Received: by 2002:a25:d785:: with SMTP id o127mr5444399ybg.378.1596123426342; Thu, 30 Jul 2020 08:37:06 -0700 (PDT) Date: Thu, 30 Jul 2020 08:37:01 -0700 In-Reply-To: <20200729215152.662225-1-samitolvanen@google.com> Message-Id: <20200730153701.3892953-1-samitolvanen@google.com> Mime-Version: 1.0 References: <20200729215152.662225-1-samitolvanen@google.com> X-Mailer: git-send-email 2.28.0.163.g6104cc2f0b6-goog Subject: [PATCH v2] arm64/alternatives: move length validation inside the subsection From: Sami Tolvanen To: Catalin Marinas , Will Deacon , Ard Biesheuvel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200730_113710_807785_226F4EBC X-CRM114-Status: GOOD ( 14.63 ) X-Spam-Score: -7.7 (-------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-7.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:b4a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_MED DKIMwl.org - Medium sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kees Cook , Nick Desaulniers , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Sami Tolvanen , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Commit f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") breaks LLVM's integrated assembler, because due to its one-pass design, it cannot compute instruction sequence lengths before the layout for the subsection has been finalized. This change fixes the build by moving the .org directives inside the subsection, so they are processed after the subsection layout is known. Link: https://github.com/ClangBuiltLinux/linux/issues/1078 Fixes: f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") Signed-off-by: Sami Tolvanen Acked-by: Catalin Marinas --- v1 -> v2: - Added the missing Fixes tag and dropped CC: stable@. --- arch/arm64/include/asm/alternative.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 83bdc7275e6206f560d247be856bceba3e1ed8f2 diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h index 12f0eb56a1cc..619db9b4c9d5 100644 --- a/arch/arm64/include/asm/alternative.h +++ b/arch/arm64/include/asm/alternative.h @@ -77,9 +77,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } "663:\n\t" \ newinstr "\n" \ "664:\n\t" \ - ".previous\n\t" \ ".org . - (664b-663b) + (662b-661b)\n\t" \ - ".org . - (662b-661b) + (664b-663b)\n" \ + ".org . - (662b-661b) + (664b-663b)\n\t" \ + ".previous\n" \ ".endif\n" #define __ALTERNATIVE_CFG_CB(oldinstr, feature, cfg_enabled, cb) \