]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cfi: add C CFI type macro
authorMark Rutland <mark.rutland@arm.com>
Fri, 1 Aug 2025 00:10:06 +0000 (00:10 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 1 Aug 2025 01:23:53 +0000 (18:23 -0700)
commit5ccaeedb489b41ce6cb857d0de488992746be282
tree99ccf08a22fd076dd0d43188a31c81c8452e39be
parent13cb75730b7a8b2dc8fe32874e159b2c7b75efde
cfi: add C CFI type macro

Currently x86 and riscv open-code 4 instances of the same logic to
define a u32 variable with the KCFI typeid of a given function.

Replace the duplicate logic with a common macro.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Co-developed-by: Maxwell Bland <mbland@motorola.com>
Signed-off-by: Maxwell Bland <mbland@motorola.com>
Co-developed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Dao Huang <huangdao1@oppo.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20250801001004.1859976-6-samitolvanen@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
arch/riscv/kernel/cfi.c
arch/x86/kernel/alternative.c
include/linux/cfi_types.h