Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2510163pxb; Mon, 19 Apr 2021 07:25:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDThYFAW6osIFQVG7AGSm335qC9XNJJBvkrvKDtE8LZVowMJJOLVJIIic2E0+ijol9FtAQ X-Received: by 2002:a05:6402:1d3b:: with SMTP id dh27mr6488129edb.220.1618842300528; Mon, 19 Apr 2021 07:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618842300; cv=none; d=google.com; s=arc-20160816; b=FDWvj3UWoTl52AUN9qztQ2NEqJ2js5viIgLmVlCmf9/Wc1E2xFuGKRp1NSAnWOeB1K xQT0wvoe8KRIFo032KWJ1xmkRPy2/hXtP0i65Msx7pEEamkIQeuyw3nScNJzUwkb65Tm QX05NBhArAm9/XEFo74Ivd0GwFkaparmr1KnsNIvZWsDu6CColA1TIa5YzeK61O3QOZ1 Ne0qYpqbOZkMoWzdO3lnyiU9yEpLVafqPZwO7+Izv1bqfaHNmiDHIN4vLMZVUb6++hmi Glkbne6bmjIs220MJI8x4q9HMMaDAVdgYogyW4aRBRRpVd/XXxxIvf7H+Zkczbi3teAF cj/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4Qact07DF36tHG4R89ewnMuURPLo+mzBH9mw5nYvfP0=; b=JXyJsD/3iOuOiI6FV0efkWENkxhDZOANCF8Ix+v6HkSd3SaO8md72RrOfmPNs5ERhc oNFwXJWM+PnwDIiRoL8HIYA+0JT7O77hsGVKn6aqiP0RmTRK6kkpOEBhk3pDCP5UogPI EKZtytGNg/5LTtSQcQFBIrSqXtppREsjV0GuGZsOoLIREGSHwZTL5JExx+bNjToabm// jHbmnNkwuuPs2mp8n+mx1oSXou3YWZCTjfrVZX3Aw5Qg1ltyWqNT5qjvA64QQyAcZnwE 8keKj7HM0bUbhk+TUrJpLnt7YegYU7AxES0QrCEQ7OySjasdNMMTqoyyyyGbQ9vx0rCX cNaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="2P/23kS9"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si12502468edc.302.2021.04.19.07.24.37; Mon, 19 Apr 2021 07:25:00 -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=@linuxfoundation.org header.s=korg header.b="2P/23kS9"; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240324AbhDSNNn (ORCPT + 99 others); Mon, 19 Apr 2021 09:13:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:47510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239740AbhDSNLe (ORCPT ); Mon, 19 Apr 2021 09:11:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DBA53613AE; Mon, 19 Apr 2021 13:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618837863; bh=e/YWmjbMjgAaQhEyfU+nUYH5L4j/9kJBl0oTCgCdDr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2P/23kS9JZDhEX8nTnQgX32ASzK+JDV13Y7ePxd6ko2DukXgkXvYm4y/3/yP5c4Sl u2xKsaZjqM7Z6NJr+8agsgll/UlY5NMcTbVjZW36JRNl3xg3H7oHLVgxxRvx3/hu++ S/H48xiW+r3yRPwPT3f8nc9J9NyW31SdNmdxoZJA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Sami Tolvanen , Nick Desaulniers , Catalin Marinas Subject: [PATCH 5.11 064/122] arm64: alternatives: Move length validation in alternative_{insn, endif} Date: Mon, 19 Apr 2021 15:05:44 +0200 Message-Id: <20210419130532.356543037@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130530.166331793@linuxfoundation.org> References: <20210419130530.166331793@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor commit 22315a2296f4c251fa92aec45fbbae37e9301b6c upstream. After commit 2decad92f473 ("arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is set atomically"), LLVM's integrated assembler fails to build entry.S: :5:7: error: expected assembly-time absolute expression .org . - (664b-663b) + (662b-661b) ^ :6:7: error: expected assembly-time absolute expression .org . - (662b-661b) + (664b-663b) ^ The root cause is LLVM's assembler has a one-pass design, meaning it cannot figure out these instruction lengths when the .org directive is outside of the subsection that they are in, which was changed by the .arch_extension directive added in the above commit. Apply the same fix from commit 966a0acce2fc ("arm64/alternatives: move length validation inside the subsection") to the alternative_endif macro, shuffling the .org directives so that the length validation happen will always happen in the same subsections. alternative_insn has not shown any issue yet but it appears that it could have the same issue in the future so just preemptively change it. Fixes: f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") Cc: # 5.8.x Link: https://github.com/ClangBuiltLinux/linux/issues/1347 Signed-off-by: Nathan Chancellor Reviewed-by: Sami Tolvanen Tested-by: Sami Tolvanen Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Link: https://lore.kernel.org/r/20210414000803.662534-1-nathan@kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/alternative-macros.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/arch/arm64/include/asm/alternative-macros.h +++ b/arch/arm64/include/asm/alternative-macros.h @@ -97,9 +97,9 @@ .popsection .subsection 1 663: \insn2 -664: .previous - .org . - (664b-663b) + (662b-661b) +664: .org . - (664b-663b) + (662b-661b) .org . - (662b-661b) + (664b-663b) + .previous .endif .endm @@ -169,11 +169,11 @@ */ .macro alternative_endif 664: + .org . - (664b-663b) + (662b-661b) + .org . - (662b-661b) + (664b-663b) .if .Lasm_alt_mode==0 .previous .endif - .org . - (664b-663b) + (662b-661b) - .org . - (662b-661b) + (664b-663b) .endm /*