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=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 1CA8FC48BDF for ; Fri, 18 Jun 2021 16:55:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DF323610C7 for ; Fri, 18 Jun 2021 16:54:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF323610C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CPz0ErNDocZOZxu79qe1KlYCm5seIYRYve5D/AElmW0=; b=gVj0jLMl/C3qPZ rPAj/yDuk1rSVH5dT8RzXy0VGKSCP61z3e+aDx/aP9tGgrX/2CJjRU4wlI0krlh13YYnYMJUixzDo iv5q6ddQQGtzSLVgTTue6ZXjl8jHMOLnyWz06oMi005rTyQzI/aQR9SrC/iO9eG82AS+iFjqTlyeJ elaag6qc1MFG/LBJyqg+MmRFFa98a4L4Xhdb314qJsdkXqG/vvx0FC/lBoUkQIs1UiRehaepOQme5 Rc/nUQO7Dp4vg2oMyErj4skLwvNtpzyhyLkdxs5ockkFSpSNHUSW2+ZZMsWWAPTkTX6HjK1Ky4GGB DRQYBQ82eNyuN2MQRr5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luHkS-00F1G5-G0; Fri, 18 Jun 2021 16:53:40 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1luHkN-00F1FN-Rj for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 16:53:37 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6893A610C7; Fri, 18 Jun 2021 16:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624035215; bh=ggNwq3G0XN9zlHuaHjOnl88VXia85562buTtBXqJ4D8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=u5BxcQ+yi6XThpwVv13oxUMqzJrMp0WpI+yStj6ERSr/MexQJ0Nwdx+Yeyr5oss8A 6YOP21lBkZqR3mM3g79j1lVU2A8NRuCmGG8d52YNN4VtMXm8QLZZUizq0RxVKUbPxm 6MLXhjy3Zw4/NYq8kD+u8QouKVukF/y6+Dk3MEmAa0955cWWQ1S6b6iH2cZKzpgHGl vYXyuMaB9dR06oKNQGUWxG0mIdnHLnLUtBPdKYiQxE93UPd10iNYEBUgdF5r54LiOQ yY8E8WkKWfpkqs4sW+1ZnysIs8BtKa0QEs9tOe4tWd5GXnl6ici/nof9lIKcCfXscb iKL4hdmQJsDBg== Date: Fri, 18 Jun 2021 09:53:31 -0700 From: Nathan Chancellor To: Mark Rutland Cc: will@kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , clang-built-linux@googlegroups.com Subject: Re: [PATCH 2/2] arm64: insn: move AARCH64_INSN_SIZE into Message-ID: References: <20210609102301.17332-1-mark.rutland@arm.com> <20210609102301.17332-3-mark.rutland@arm.com> <20210618151835.GC8318@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210618151835.GC8318@C02TD0UTHF1T.local> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_095335_975997_4921709F X-CRM114-Status: GOOD ( 37.26 ) 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 On Fri, Jun 18, 2021 at 04:18:35PM +0100, Mark Rutland wrote: > On Thu, Jun 17, 2021 at 06:25:27PM -0700, Nathan Chancellor wrote: > > Hi Mark, > > Hi Nathan, > > > On Wed, Jun 09, 2021 at 11:23:01AM +0100, Mark Rutland wrote: > > > For histroical reasons, we define AARCH64_INSN_SIZE in > > > , but it would make more sense to do so in > > > . Let's move it into , and add the necessary > > > include directives for this. > > > I bisected a CONFIG_LTO_CLANG_THIN=y build failure that our CI reported > > to this patch: > > > > https://builds.tuxbuild.com/1u4Fpx2FQkkgkyPxWtq0Ke4YFCQ/build.log > > Thanks for reporting this; the lopg is really helpful! > > > I have not had a whole ton of time to look into this (dealing with a > > million fires it seems :^) but it is not immediately obvious to me why > > this fails because include/linux/build_bug.h is included within > > arch/arm64/include/asm/insn.h. > > The problem is that with LTO, we patch READ_ONCE(), and > includes , creating a circular include chain: > > > > > > > > > ... and so when includes , none of the > BUILD_BUG* definitions have happened yet. Aha, that would certainly explain it. I figured something like this would be the root cause but figuring out header dependencies is not my cup of tea. > Will, are you happy to take the fixup patch below, or would you prefer > to drop this patch for now? > > Thanks, > Mark. > > ---->8---- > >From 0acc3d92302f54475d938f55749805adf74faec1 Mon Sep 17 00:00:00 2001 > From: Mark Rutland > Date: Fri, 18 Jun 2021 16:11:22 +0100 > Subject: [PATCH] arm64: insn: avoid circular include dependency > > Nathan reports that when building with CONFIG_LTO_CLANG_THIN=y, the > build fails due to BUILD_BUG_ON() not being defined before its uss in > . > > The problem is that with LTO, we patch READ_ONCE(), and > includes , creating a circular include chain: > > > > > > > > > ... and so when includes , none of the > BUILD_BUG* definitions have happened yet. > > To avoid this, let's move AARCH64_INSN_SIZE into a header without any > dependencies, such that it can always be safely included. At the same > time, avoid including in , which should > no longer be necessary (and doesn't make sense when insn.h is consumed > by userspace). > > Reported-by: Nathan Chancellor > Signed-off-by: Mark Rutland > Cc: Catalin Marinas > Cc: Will Deacon > --- > arch/arm64/include/asm/alternative-macros.h | 2 +- > arch/arm64/include/asm/insn.h | 5 +---- Looks like arch/arm64/include/asm/insn-def.h is missing from this patch? If I add one with just the two deleted lines plus a header guard, the build passes. Tested-by: Nathan Chancellor Thank you for the quick fix! Cheers, Nathan > 2 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/arch/arm64/include/asm/alternative-macros.h b/arch/arm64/include/asm/alternative-macros.h > index 703fbf310b79..eba3173a2a2c 100644 > --- a/arch/arm64/include/asm/alternative-macros.h > +++ b/arch/arm64/include/asm/alternative-macros.h > @@ -3,7 +3,7 @@ > #define __ASM_ALTERNATIVE_MACROS_H > > #include > -#include > +#include > > #define ARM64_CB_PATCH ARM64_NCAPS > > diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h > index 1430b4973039..6b776c8667b2 100644 > --- a/arch/arm64/include/asm/insn.h > +++ b/arch/arm64/include/asm/insn.h > @@ -10,10 +10,7 @@ > #include > #include > > -#include > - > -/* A64 instructions are always 32 bits. */ > -#define AARCH64_INSN_SIZE 4 > +#include > > #ifndef __ASSEMBLY__ > /* > -- > 2.11.0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel