From mboxrd@z Thu Jan 1 00:00:00 1970 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=-25.6 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL 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 02ABCC433E0 for ; Thu, 30 Jul 2020 15:37:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFB712082E for ; Thu, 30 Jul 2020 15:37:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IUuZ4yIP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729816AbgG3PhI (ORCPT ); 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-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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 55C24C433DF for ; Thu, 30 Jul 2020 15:41:22 +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 22E402082E for ; Thu, 30 Jul 2020 15:41:22 +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 22E402082E 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=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-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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.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 --- 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel