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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5995C433EF for ; Wed, 9 Mar 2022 17:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VVuh4Hc0XSaSXM4KZI4ya0HLrm6uDcRKttbuwpqlaCo=; b=XeTVVDt8C8oGHQ tNIbjRTULAG2AETIRLcCYhMGjjK6d51B6yox3xDV5sYEWCHhFYIrJtoYg1o07gT9rJZ3fVHnNMdds 6/MF63blnT9u0vm9tjRVYazaEYhXXiuYwtATpTEC5mgLhzsm3AMLmLo9eboSu0HhVhH9ixH1KlDW7 /g8kzWxOVF/yjPtOESk/WcrSxQne55S0PVESIMltuUQBT++YVmOk9JdXVEWZTFmm6KxWs7JcyBz8h 67Hv8JJl5BybHC/A9UH2R9yQBGaz7/QF2kCqEjSSpU8bO0c98shjBXJA2SA3zQxJWfc8OFSKHysxj TC49/cPy5KB8sAwDgkgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRzzG-009lrP-NQ; Wed, 09 Mar 2022 17:20:34 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRzy9-009lSw-JZ for linux-arm-kernel@lists.infradead.org; Wed, 09 Mar 2022 17:19:27 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 765FB1691; Wed, 9 Mar 2022 09:19:24 -0800 (PST) Received: from [10.57.41.254] (unknown [10.57.41.254]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5A7B93F7F5; Wed, 9 Mar 2022 09:19:23 -0800 (PST) Message-ID: <894ef565-187e-c7dc-94ec-8e9cc7abe9a3@arm.com> Date: Wed, 9 Mar 2022 17:19:18 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] arm64: Paper over ARM_SMCCC_ARCH_WORKAROUND_3 Clang issue Content-Language: en-GB To: Marc Zyngier , linux-arm-kernel@lists.infradead.org Cc: kernel-team@android.com, James Morse , Nick Desaulniers , Will Deacon , Catalin Marinas References: <20220309155716.3988480-1-maz@kernel.org> From: Robin Murphy In-Reply-To: <20220309155716.3988480-1-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220309_091925_771974_9DA073B9 X-CRM114-Status: GOOD ( 17.10 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022-03-09 15:57, Marc Zyngier wrote: > Compiling the arm64 kernel with the BHB workarounds and Clang+LTO > results in a bunch of: > > :4:2: error: invalid fixup for movz/movk instruction > mov w0, #ARM_SMCCC_ARCH_WORKAROUND_3 > > when compiling arch/arm64/kernel/entry.S, and makes no sense at all. > > As it turns out, moving a single include line around makes the > problem disappear. Why, you'd ask? Well, I don't have the faintest > idea, and I'm running out of patience. So make of that what you want. Alternatively, this is a perfectly valid cleanup, reducing the scope of a header inclusion to the C prototype that actually needs it, thus reducing header bloat for assembly files that don't. Which happens to also have a pleasant side-effect in avoiding an inexplicable LTO nonsense :D Even just in terms of that cleanup, Reviewed-by: Robin Murphy FWIW, my gut feeling is that LTO has somehow blurred the lines between different expansions of _AC() in ARM_SMCCC_ARCH_WORKAROUND_3 that it remembers from other compilation units that it's busy munging together, and confused itself. Robin. > Cc: James Morse > Cc: Nick Desaulniers > Cc: Will Deacon > Cc: Catalin Marinas > Signed-off-by: Marc Zyngier > --- > include/linux/arm-smccc.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h > index 220c8c60e021..0a341dd9ff61 100644 > --- a/include/linux/arm-smccc.h > +++ b/include/linux/arm-smccc.h > @@ -5,7 +5,6 @@ > #ifndef __LINUX_ARM_SMCCC_H > #define __LINUX_ARM_SMCCC_H > > -#include > #include > > /* > @@ -193,6 +192,7 @@ > > #ifndef __ASSEMBLY__ > > +#include > #include > #include > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel