Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1454634ybg; Wed, 29 Jul 2020 14:54:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwILClg/eNpkaDuXaN3vIvNoNpiuDDrbtiMgM021RyFKlozWnHf1h5XKpPpWikSTr2FWB+8 X-Received: by 2002:aa7:d45a:: with SMTP id q26mr288214edr.95.1596059691586; Wed, 29 Jul 2020 14:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596059691; cv=none; d=google.com; s=arc-20160816; b=JmKbMjw94+bTo5aPzdbXqgeyznnarXNtXfPVA2I5Egwp6uWMuROrAK2YyZ/Jv46Ou5 v9ux0Ip7WckC+PKc4eegqWny8Xa1kmkc7d0iQr4JRtr6QWBI0j3v5ebFnWMhU8Ch4Oxf RZvAMlLGmkGNyHoEUGC3p4j8nTzxH5eGC6u/1UfnSjTFoLKfYH4254uOm2ivu2uRoFP2 9e5cwZH95j9JqTjYlwjTBd9+KZCQyQHig/fEKwJES9m0SumeM5o1oC1YJiUaOy3aNEjj mL4neZM8G+d4a4mCMgjMSTLJXafPF1LUtfLYHsc1eGbzgAfmVXtjH3R628D8Mxw76gzd h1kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=XqcTC2vuCfQSKcre8J8WDJG0kMjtcm07zH5Lw6F6DXE=; b=HiXQrrXVJFkAPcCD0HZXxW3vLs7Sx5+1oGKe2GGe+vbsfHNETEILMJ/B+dCjkaD+iv 0oIyMYU+rQte2+89kDlNgM7G5UrZSrB5n7wWjNvxjBZuJTG5D27cp3myr0tx505sBXYA v77TtAKvVgrzzTbkcbp2tDu8qEetYYBYP121ahcQEAIPAFDIP6zPL1RRCzm4OqRSR6U8 P52+Wsn0uBpmuj3wPWAOXw9xNOSmEOXvHKIRy7WnmN0JFkIi0hUPfsNohx1ZwnRd3oa+ FLuwgXCqXNP1hcVp6r4IDuZDKD8m3EiP9+KyhInAIzBuq8r2+IrFUD8czCxstrPbyidv o3wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="ciUZh/ty"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bk22si1828381ejb.657.2020.07.29.14.54.26; Wed, 29 Jul 2020 14:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="ciUZh/ty"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726876AbgG2Vv7 (ORCPT + 99 others); Wed, 29 Jul 2020 17:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbgG2Vv6 (ORCPT ); Wed, 29 Jul 2020 17:51:58 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D8AC061794 for ; Wed, 29 Jul 2020 14:51:58 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id o8so8108819ybg.16 for ; Wed, 29 Jul 2020 14:51:58 -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=dsiu7w/RYv2ItKlfFzAJ5tgqe8qkCoVX0SiEP9wQ8VK5gtBTM//8FeHtsiFGwAFV5B 2Y6ZKjOJ9AbMuLgl+4LujObk0e7zbx6Hj6Ed5fWBRlXwHrToqJga3HwMhXfWvCDdETME rvlYGM/v8/r0zyE9mOOPJhjH0l4tWFrdMdptsS4quSwh7dAsBvRjLMlGAiASEGJ1SrQ+ TlHFa0p1FkoYBhz0CpHCLsviFGBouTMQsOiaR5BxueD5wypEpw9vsa6+bjnApGqWcxcs Hx1As3LjnD5oRicDr8LV+i8n2KcLulBX4sU3rhKjIDAP0Fg6/DmWosUFK86eajrdfIlf iSQQ== X-Gm-Message-State: AOAM5313BoZ4sy8/2Ex/XIXj/FKaD3AoBZozoyTfxAQOk0yZsu94kGdB uFQigkFFlQYvU5mpuiYFM5hxkhz34HmyiSNdb28= 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 Cc: Nick Desaulniers , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Sami Tolvanen , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) 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) \ base-commit: 6ba1b005ffc388c2aeaddae20da29e4810dea298 -- 2.28.0.163.g6104cc2f0b6-goog