From patchwork Wed Jul 29 21:51:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 11691771 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 E4C5A722 for ; Wed, 29 Jul 2020 21:54:18 +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 B8A342082E for ; Wed, 29 Jul 2020 21:54:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3I/auVR9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="ciUZh/ty" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8A342082E 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:Mime-Version:Message-Id:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=o4xF+GrwKvnkOO9k7IEL5OJRq4bsUbZqvNL4gIo56Co=; b=3I/auVR92GWhoeZOp4iSDewFAa i0v8qm5mrKJpavO4loyOVtCsIFdnpO8QrR3AudrTBpHiPNo/ttcg4ktYF7oEMF8eoxYCuFcuhY4ez t4BVWnT83ijKtEjJINKLR4HsQJsO9DC+qK/aBdscNVj00MAhiZ4fqiJszXRgOVZiUPpaDKz32Ip1X 7BNtZ2QLBKuFwtlotje2aLTCdvK50Jojti2+mpGz9Iyuwp816hBUEmulmPDVO2l69u6aA+X09EqlE D06Q2/g81Enbr3C2sV6nHFp6hIuzc25B5/M8U8i/A4f5GwiMII0+y+R7vBGLqWrRcJ0TyQwpUxozI x0JU1DDA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0tzZ-00059v-IM; Wed, 29 Jul 2020 21:52:05 +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 1k0tzW-00052X-Sk for linux-arm-kernel@lists.infradead.org; Wed, 29 Jul 2020 21:52:03 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id b127so13802039ybh.21 for ; Wed, 29 Jul 2020 14:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=XqcTC2vuCfQSKcre8J8WDJG0kMjtcm07zH5Lw6F6DXE=; b=ciUZh/tyeIpxCmoN49V9pS1Pb3wFhICO4qpRrMW4s7CpOO2y4afzwi7mI7svGpNzL7 TIPXQXit4KOcXK/NFMZknWpABt8PAtcxRHiL93WeER/9d9MWAdYXkZKKHrRJtigDilrQ CBL3Vyp4C6ssPu8jj+8QfGdw89fxA5PR1SHMxkeBnfVC8qjsZtwyL+3FLo6utNvFjt48 7mD5qP2SRDSnmFNVeyLizSsKqxQm9sTn6HWB8f/Hf5W2/pTLZm8pVTPDzYqhM9vu/ee1 pbHyM622DIC2ZrAc/Y0AgYfFTlZtQJrM0crebAe+ESjSMcrZiVnEEpjnQrN6FEIHDAj5 Q3Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=XqcTC2vuCfQSKcre8J8WDJG0kMjtcm07zH5Lw6F6DXE=; b=QAEoJPPB3s6ddEoqr5S3q8fO2yVbrAa3PTq49rwbheSF4EL+s8Xz2zNFdIuYW33zAz AUbTPYM4lWqf11oOcdPxlWZkozThVsOiPnaeRrNdCyrOEfcuIWZY16NyAbOEDT3OGXcQ yiJyK1ad+m9pvSrHzZiyWxiLoJvwLJkSf4EvmA1c59BG721REXjBug5PUQ2XoxKG6wyr 5tglu9HrcBXyMHa0DuGJdSBdBwdCuoVa6gTZzIAD7nsqF34EYj2LJWzjyJE7b0fdnet1 8WQ8H9bbgQF5q7PBF5WEGeCP3SVu4a4FjNqZpSEvyMn7zjLMnNu++QlJxAtPDxSfDHK4 vGIQ== X-Gm-Message-State: AOAM533rsITxWQdh0y/xyRERJwlPmxjTwOWEYrAP1gASf6MFQpLSpVSb FfKU4Q7cDJ4ZL0MlaNPbrb8o7jE27cK6SD9mE/k= X-Google-Smtp-Source: ABdhPJyMfJOTToVvOJpGfO0ho8OnKO0EPuPzbcMB2MHnlEC4slmPojpIMwvkFTM/tGsMoMggcjg7ygEppHiQECY2j5Y= X-Received: by 2002:a25:a107:: with SMTP id z7mr719351ybh.310.1596059517661; Wed, 29 Jul 2020 14:51:57 -0700 (PDT) Date: Wed, 29 Jul 2020 14:51:52 -0700 Message-Id: <20200729215152.662225-1-samitolvanen@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.163.g6104cc2f0b6-goog Subject: [PATCH] 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-20200729_175202_940557_CDC34F91 X-CRM114-Status: GOOD ( 14.06 ) 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 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 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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, stable@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 Cc: # 4.14+ Signed-off-by: Sami Tolvanen --- arch/arm64/include/asm/alternative.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 6ba1b005ffc388c2aeaddae20da29e4810dea298 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) \