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=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 7FC61C49361 for ; Fri, 18 Jun 2021 15:21:01 +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 4F0D7613F0 for ; Fri, 18 Jun 2021 15:21:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F0D7613F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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=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=bckoezKa1MJicXfplkdAYXR4fsU7eYIdYJ52Qu7m1gU=; b=x2dx8OA5ioXzDc mdKTRPxheSLRmrZb9g/mu4GTSW6gIxskeHolBC70iVqBJL5Ce3X3Z1H/wknnmoXyrKsE1Q+rxGiaR qdwb9JQ/8aE5HiXWHHfJPBNc35DzM4J07hVM3LEfSBiJf6j3m+H8GhFQPtBgvXyHGcpyZYb9zla1m cXLNyfVp2nbJQvDtPkW6O9r0qq1mzEDl0Nd3ND2TqhlBZ/SavVnuTVNNzciJqspYQcR+StDKGQjgp +ph4Mt3guvzfIvHNbVXNHS4a2kIDQmNXOAlrrZv6HBtUchVyhKgZkpn5M9IyouQS+/g8R6bL+tdRR e8RziIWlh6xRx/HDz5OQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1luGGm-00EfuV-Nd; Fri, 18 Jun 2021 15:18:56 +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 1luGGc-00Efpd-3I for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 15:18:48 +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 7E15113A1; Fri, 18 Jun 2021 08:18:39 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.10.206]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 240E03F694; Fri, 18 Jun 2021 08:18:37 -0700 (PDT) Date: Fri, 18 Jun 2021 16:18:35 +0100 From: Mark Rutland To: Nathan Chancellor , will@kernel.org Cc: 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: <20210618151835.GC8318@C02TD0UTHF1T.local> References: <20210609102301.17332-1-mark.rutland@arm.com> <20210609102301.17332-3-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_081846_286147_21609E40 X-CRM114-Status: GOOD ( 24.57 ) 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 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. 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 +---- 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