Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cfi: Flip headers

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>

authored by

Peter Zijlstra and committed by
Alexei Starovoitov
43821596 1467affd

+14 -5
+2 -1
arch/riscv/include/asm/cfi.h
··· 7 7 * 8 8 * Copyright (C) 2023 Google LLC 9 9 */ 10 + #include <linux/bug.h> 10 11 11 - #include <linux/cfi.h> 12 + struct pt_regs; 12 13 13 14 #ifdef CONFIG_CFI_CLANG 14 15 enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
+1 -1
arch/riscv/kernel/cfi.c
··· 4 4 * 5 5 * Copyright (C) 2023 Google LLC 6 6 */ 7 - #include <asm/cfi.h> 7 + #include <linux/cfi.h> 8 8 #include <asm/insn.h> 9 9 10 10 /*
+2 -1
arch/x86/include/asm/cfi.h
··· 7 7 * 8 8 * Copyright (C) 2022 Google LLC 9 9 */ 10 + #include <linux/bug.h> 10 11 11 - #include <linux/cfi.h> 12 + struct pt_regs; 12 13 13 14 #ifdef CONFIG_CFI_CLANG 14 15 enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
+2 -2
arch/x86/kernel/cfi.c
··· 4 4 * 5 5 * Copyright (C) 2022 Google LLC 6 6 */ 7 - #include <asm/cfi.h> 7 + #include <linux/string.h> 8 + #include <linux/cfi.h> 8 9 #include <asm/insn.h> 9 10 #include <asm/insn-eval.h> 10 - #include <linux/string.h> 11 11 12 12 /* 13 13 * Returns the target address and the expected type when regs->ip points
+1
include/asm-generic/Kbuild
··· 11 11 mandatory-y += bug.h 12 12 mandatory-y += bugs.h 13 13 mandatory-y += cacheflush.h 14 + mandatory-y += cfi.h 14 15 mandatory-y += checksum.h 15 16 mandatory-y += compat.h 16 17 mandatory-y += current.h
+5
include/asm-generic/cfi.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __ASM_GENERIC_CFI_H 3 + #define __ASM_GENERIC_CFI_H 4 + 5 + #endif /* __ASM_GENERIC_CFI_H */
+1
include/linux/cfi.h
··· 9 9 10 10 #include <linux/bug.h> 11 11 #include <linux/module.h> 12 + #include <asm/cfi.h> 12 13 13 14 #ifdef CONFIG_CFI_CLANG 14 15 enum bug_trap_type report_cfi_failure(struct pt_regs *regs, unsigned long addr,