summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/alternative-macros.h
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2021-06-18 17:11:22 +0200
committerWill Deacon <will@kernel.org>2021-06-21 12:58:03 +0200
commit69bb0585ebb0c48c93fc55fc27afbfc06adef2fd (patch)
tree7afd47d8cd20c9dae154f78fd57093182f8eeacd /arch/arm64/include/asm/alternative-macros.h
parentarm64: insn: move AARCH64_INSN_SIZE into <asm/insn.h> (diff)
downloadlinux-69bb0585ebb0c48c93fc55fc27afbfc06adef2fd.tar.xz
linux-69bb0585ebb0c48c93fc55fc27afbfc06adef2fd.zip
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 <asm/insn.h>. The problem is that with LTO, we patch READ_ONCE(), and <asm/rwonce.h> includes <asm/insn.h>, creating a circular include chain: <linux/build_bug.h> <linux/compiler.h> <asm/rwonce.h> <asm/alternative-macros.h> <asm/insn.h> <linux/build-bug.h> ... and so when <asm/insn.h> includes <linux/build_bug.h>, 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 <asm/alternative.h> in <asm/insn.h>, which should no longer be necessary (and doesn't make sense when insn.h is consumed by userspace). Reported-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20210621080830.GA37068@C02TD0UTHF1T.local Fixes: 3e00e39d9dad ("arm64: insn: move AARCH64_INSN_SIZE into <asm/insn.h>") Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/alternative-macros.h')
-rw-r--r--arch/arm64/include/asm/alternative-macros.h2
1 files changed, 1 insertions, 1 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 <asm/cpucaps.h>
-#include <asm/insn.h>
+#include <asm/insn-def.h>
#define ARM64_CB_PATCH ARM64_NCAPS