Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2030518ybg; Thu, 30 Jul 2020 08:39:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY7/EAhEQ9U5kwXf2zlgED8GvZA1w0kAg4C0Xa5ikRnF57ViC4cq7MKY7ZFHX7PSF7yuul X-Received: by 2002:a17:906:27d7:: with SMTP id k23mr3115605ejc.74.1596123595159; Thu, 30 Jul 2020 08:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596123595; cv=none; d=google.com; s=arc-20160816; b=JHOv2/s3ZCRN+96NA/kRACPCz+7xzjsXsSqgjo+Gm7bBsNrzvnsm3jE6WfnJ+zJDEh R+tKU1d4IZWUYgQ3EKDvS11n5VIz8gCD8FLeggGiUWxGertsF5Okq7g7EPu9Ia7mEAS2 sNeeSFL8H+qxyucA0ob1+RnHvqxQYW+Ndfc8fn0Zvimx7roLMTaR0dUC6DYVWWtN8g/x OpiU/H895R/iY2QTnYxZnfGkHCM9+a25L5yCTNjRHz1GT15Fo/L9Khbw2kEmaEtMdJss jiwplZ3U2lZD6fhGbsmbE3L5wLsfR7Kn02wFRM/Iz3vnAVKkhEGny6picTCW3C50JSne kAUA== 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:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=IxpQl+U4Cci+VujQeEVAy+X3aO84K4nWxe4WSDjauTc=; b=EPC0Ev+mIjry4EeyP+WGYkY54hWb6zIC2L3FDugBAGPEeL3ZXgv42XtjzcTqJHE2IJ 89iQOTCL9/b6UBIoa3eeddim5U+IP231ERM0QnJoG68vcZTi0yYly/4WX7gk7wkg5nsU Lmj1STIp4/O3Rz32ap4HaC5izkoVM8JA8YSBVwvWJK9Mb8ocQd6quetLKbJiYXmNWPm/ YBCGNXPZHGfhIebusU/4sI9OrGSEGB4Cr1CX6q81zps9Mt+z9gwq85I5w4z5VUfgeNNO Lrx7Msh/vFjXb2C8/aHYuoVEhTUsy9F02y9PrsjM8TmSUzwQ22feTEPmEE1xsE2BfA1a Worg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IUuZ4yIP; 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 t15si3500388edy.289.2020.07.30.08.39.33; Thu, 30 Jul 2020 08:39:55 -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=IUuZ4yIP; 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 S1729797AbgG3PhI (ORCPT + 99 others); Thu, 30 Jul 2020 11:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729484AbgG3PhH (ORCPT ); Thu, 30 Jul 2020 11:37:07 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7391C061574 for ; Thu, 30 Jul 2020 08:37:07 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id b127so16846707ybh.21 for ; Thu, 30 Jul 2020 08:37:07 -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=CJrFwyv4OTZfzxf2cS6dfVZENcnh1qYQGEdTWSqbyuJPlSoTVtL4dmOVi0E8YapGx0 ZjqgLFrZIWqpwSUZGeIGDATmeevAfa8tDzlxJrIkgI3n1BV7otbh+AkysU7fD48bRJsq jjzJ0eqJqHANeJyijiB/JkzwF3PMUKfRiiuDV5KeHYAQUJUzDph+MN9h/oHeAUKW/aFY iWK5oemD5CJhc5tNOpTquvkMQ8Wm7aMZZh3Cv/WVurlRLQfhUfIjzzDM+4ytryGUA/hl N5JNYRjr4a29pDPw4R2GxsWgJN4EOCoz/YdVsb6frie2H8dWNHd0CL0poTJ8KVVYIOPI yA4w== X-Gm-Message-State: AOAM533fad2/oRtOkpbiA3q8PyuAnXlkl5zUEeDNhQjXkx18Na2nkXSo YJG36yb5Z7ZLfpBAapyjajCoL0Hbq5Oo1bKpYNo= 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 Cc: Nick Desaulniers , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Sami Tolvanen 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 Fixes: f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") Signed-off-by: Sami Tolvanen --- 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(-) 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: 83bdc7275e6206f560d247be856bceba3e1ed8f2 -- 2.28.0.163.g6104cc2f0b6-goog