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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 2BD08C433B4 for ; Wed, 14 Apr 2021 17:49:14 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 803BC6113B for ; Wed, 14 Apr 2021 17:49:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 803BC6113B 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nfD1Zy855y9uKHVW7w0f6s95F6kw/1+XlJFYTrEHp14=; b=EIG43kT2bUnbCmgCqai3+JZov 3tTzFaAoKMJZi1nRgFsSHTWXsLMfjpRtXL52fGO8ReLC1ZpQedSiReXc+y5dQjSHvkmxrwjspZWsM NdZaqIgVownlWGOfG2B7UE20hg5UDp1jaghG5+SVc0lBtwSgB2GpOrrBizRX7aVd5gMu08kx9F7Cw r1gWJlXyk6+OFbd/cLX5JqFeSYdDxUFUc3MCqPU/oyYWxl4eHpP8bM8bVbYPpXcYTT45IDkJT4SHY 7uSTPgyKWNDcp/M66vmP6gkluKoKEVii9Okqwckn4G1nctCJ+ER1sAt5gGBg1KlTuby30MjZnidsv tUrN9oD/A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWjbb-00DJed-W8; Wed, 14 Apr 2021 17:47:15 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWjbY-00DJdo-EE for linux-arm-kernel@desiato.infradead.org; Wed, 14 Apr 2021 17:47:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=q97lT2gtlL/ZYrFbpq2z+qcIs3qeeq4P5EG52TEAcdM=; b=JJQsKOgIaKUlZDjvPGVHruHOuj zt9dJu7kVN6VvRQDJi/kd6EaSeFA+ITxxYIL8KcY3hPF4HO8gWv3uEpccJtrVN87o/oap085osiU7 KQneh5g9s6Y9BLKlKJOgvnzxRH0qSSQ13UomEGXPThG1Fp8lKaFE/u33reGuPkJYL3JqJyUChwq6J T6K8jKV0xxhiCu0Rw5HS/irzcTwKfnc6CmfHhXa8xHQcX8hdLj/4Ctw/BvDGdTD6qPk4LruIZ5r0p rv1feFCLC3Cf3hXXMVqlqQ3y7bFVzKuATnljawOppj5zFXc0GfRRn8NL1jfn2t5opLSprYPITXdKd QUDL+hyg==; Received: from mail-ua1-x92e.google.com ([2607:f8b0:4864:20::92e]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWjbV-007zKW-Is for linux-arm-kernel@lists.infradead.org; Wed, 14 Apr 2021 17:47:07 +0000 Received: by mail-ua1-x92e.google.com with SMTP id c2so6679980uaj.3 for ; Wed, 14 Apr 2021 10:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q97lT2gtlL/ZYrFbpq2z+qcIs3qeeq4P5EG52TEAcdM=; b=FASsM6Mqt/GGPdEfPxH0BeAUtBP2LBxWtovEIAxVgZPiKATwrM0upW/rmS2tgAPLGW tLDmP5USwnjCv+CG2k3l3djEKlvlTFqF89cW7lv20RbUF5NJQt2Eh702Ba0Le1xYFzFS YSIe+HmENCrzrHUhgcRPg5vpyCxBOhlEiEk4Vgc3QyM0PDsKBaiPbZL84aqlMsYjXuqx LBLoMT9lOX6TOf6eJskvSa3NdvMLVfR3fvxW+OeSjFGoPVjO1k27txBuXoToxTm5srBh luyDjDc3beB2HX7FJm5KgFVtgMZQ3V1yKxHfr5c/vqsXlDKkTtN8XhReO6rveIvpVgaJ jGHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q97lT2gtlL/ZYrFbpq2z+qcIs3qeeq4P5EG52TEAcdM=; b=YBeKLvdbj2WPpgBQGJ4kqlSq5J6GfPOVS1+Ue5Odfpki4y5/atWXXcd8QCZEjxAtcR RnPkYF+04PS2qTEPped9JQGnotPu9g3lP/eadZsgvpW1UpfsnIa6zpTxh9h8f0c138LK I6NIS/GEGZNKDHE2JwUMtAFgdIEx1xnNdsuACWLWixfMKOeweCn1Ppds7OedI8Fo1AXY GCbXtXM57A7PKw6Yp9Lf/p+BJMzEbgxV4/YQksEc9ls7e26VYuQ4Vi9hs1ZK5r+6mSvC N0Wa4Uh3Q1yjeqYQptQPaGfgu7ozMMMZaDyaIWBe6EnIvgDWF0Qt3A+k0pYn8Lvdm2Bq P9Tg== X-Gm-Message-State: AOAM533rkashjRiqh103rzyqUdRWYypP/gYTBjTF3AiglTLsy7sCnr2K vne3aypLB07hdC/xNAJFcLF09NgCwIZUBkY4+U8HMw== X-Google-Smtp-Source: ABdhPJxOFhS7WC1rn9NAh8rEqbOu1jy+k//lbPl6ERVT8Ju5qO+Yh7E4m942OCFjR9GUQT4EjgwshKNKLwszoxpvB44= X-Received: by 2002:a9f:3728:: with SMTP id z37mr27839924uad.89.1618422420730; Wed, 14 Apr 2021 10:47:00 -0700 (PDT) MIME-Version: 1.0 References: <20210414000803.662534-1-nathan@kernel.org> In-Reply-To: <20210414000803.662534-1-nathan@kernel.org> From: Sami Tolvanen Date: Wed, 14 Apr 2021 10:46:49 -0700 Message-ID: Subject: Re: [PATCH] arm64: alternatives: Move length validation in alternative_{insn, endif} To: Nathan Chancellor Cc: Catalin Marinas , Will Deacon , Nick Desaulniers , Jian Cai , linux-arm-kernel , LKML , clang-built-linux , "# 3.4.x" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210414_104705_644194_B84B0634 X-CRM114-Status: GOOD ( 23.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Hi Nathan, On Tue, Apr 13, 2021 at 5:09 PM Nathan Chancellor wrote: > > 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. > > Cc: stable@vger.kernel.org > Fixes: f7b93d42945c ("arm64/alternatives: use subsections for replacement sequences") > Link: https://github.com/ClangBuiltLinux/linux/issues/1347 > Signed-off-by: Nathan Chancellor > --- > > Apologies if my explanation or terminology is off, I am only now getting > more familiar with assembly. > > arch/arm64/include/asm/alternative-macros.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/include/asm/alternative-macros.h b/arch/arm64/include/asm/alternative-macros.h > index 5df500dcc627..8a078fc662ac 100644 > --- 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 > > /* Thank you for fixing these! The patch looks correct to me, next-20210413 builds with LLVM_IAS=1 after I applied it, and defconfig built with both Clang and gcc boots normally. Please feel free to add: Reviewed-by: Sami Tolvanen Tested-by: Sami Tolvanen Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel