cfi: Flip headers
authorPeter Zijlstra <peterz@infradead.org>
Fri, 15 Dec 2023 09:12:17 +0000 (10:12 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 16 Dec 2023 00:25:55 +0000 (16:25 -0800)
Normal include order is that linux/foo.h should include asm/foo.h, CFI has it
the wrong way around.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20231215092707.231038174@infradead.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/riscv/include/asm/cfi.h
arch/riscv/kernel/cfi.c
arch/x86/include/asm/cfi.h
arch/x86/kernel/cfi.c
include/asm-generic/Kbuild
include/asm-generic/cfi.h [new file with mode: 0644]
include/linux/cfi.h

index 56bf9d69d5e38c0e185d6b392410b76bd3044ef5..8f7a6225704499a9b32ffb40c1ade6fca9d03c0c 100644 (file)
@@ -7,8 +7,9 @@
  *
  * Copyright (C) 2023 Google LLC
  */
+#include <linux/bug.h>
 
-#include <linux/cfi.h>
+struct pt_regs;
 
 #ifdef CONFIG_CFI_CLANG
 enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
index 820158d7a29130d9f42742019683f8c5034949ec..6ec9dbd7292eecad5d27787904ba890a37b1426f 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2023 Google LLC
  */
-#include <asm/cfi.h>
+#include <linux/cfi.h>
 #include <asm/insn.h>
 
 /*
index 58dacd90daefc4308d98407b7ac0bf02b717126d..2a494643089d465c28829486c87c7d181f7ff621 100644 (file)
@@ -7,8 +7,9 @@
  *
  * Copyright (C) 2022 Google LLC
  */
+#include <linux/bug.h>
 
-#include <linux/cfi.h>
+struct pt_regs;
 
 #ifdef CONFIG_CFI_CLANG
 enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
index 8674a5c0c031d3dd3c0a2708ff39369efb52ff7e..e6bf78fac1462209be7f7115dc3f588bdd3a9c12 100644 (file)
@@ -4,10 +4,10 @@
  *
  * Copyright (C) 2022 Google LLC
  */
-#include <asm/cfi.h>
+#include <linux/string.h>
+#include <linux/cfi.h>
 #include <asm/insn.h>
 #include <asm/insn-eval.h>
-#include <linux/string.h>
 
 /*
  * Returns the target address and the expected type when regs->ip points
index def242528b1db4559b7ae4d8a748917918bcb7a8..d436bee4d129dd8f0369a5554f116aa3ff2c4a7f 100644 (file)
@@ -11,6 +11,7 @@ mandatory-y += bitops.h
 mandatory-y += bug.h
 mandatory-y += bugs.h
 mandatory-y += cacheflush.h
+mandatory-y += cfi.h
 mandatory-y += checksum.h
 mandatory-y += compat.h
 mandatory-y += current.h
diff --git a/include/asm-generic/cfi.h b/include/asm-generic/cfi.h
new file mode 100644 (file)
index 0000000..41fac35
--- /dev/null
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ASM_GENERIC_CFI_H
+#define __ASM_GENERIC_CFI_H
+
+#endif /* __ASM_GENERIC_CFI_H */
index 3552ec82b72561e433047b7cd0f65dae37978026..2309d74e77e68ab09e41e1e4ad7a285d4382af6c 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <linux/bug.h>
 #include <linux/module.h>
+#include <asm/cfi.h>
 
 #ifdef CONFIG_CFI_CLANG
 enum bug_trap_type report_cfi_failure(struct pt_regs *regs, unsigned long addr,