[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250205180116.88644-1-haiyuewa@163.com>
Date: Thu, 6 Feb 2025 02:00:42 +0800
From: Haiyue Wang <haiyuewa@....com>
To: x86@...nel.org,
linux-trace-kernel@...r.kernel.org
Cc: samitolvanen@...gle.com,
Haiyue Wang <haiyuewa@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
linux-kernel@...r.kernel.org (open list:FUNCTION HOOKS (FTRACE))
Subject: [PATCH v1] ftrace: Fix compile error when CONFIG_GENDWARFKSYMS is enabled
When switching from CONFIG_GENKSYMS to CONFIG_GENDWARFKSYMS enabled, the
build is failed:
AS arch/x86/entry/entry.o
In file included from ./arch/x86/include/asm/asm-prototypes.h:2,
from <stdin>:3:
./arch/x86/include/asm/ftrace.h: In function ‘arch_ftrace_get_symaddr’:
./arch/x86/include/asm/ftrace.h:46:21: error: implicit declaration of function ‘get_kernel_nofault’ [-Werror=implicit-function-declaration]
46 | if (get_kernel_nofault(instr, (u32 *)(fentry_ip - ENDBR_INSN_SIZE)))
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
File "asm-prototypes.h" is added to entry.S by 'scripts/Makefile.build',
adding the missed declaration header file can also fix the error:
getasmexports = \
{ echo "\#include <linux/kernel.h>" ; \
echo "\#include <linux/string.h>" ; \
+ echo "\#include <linux/uaccess.h>"; \
echo "\#include <asm/asm-prototypes.h>" ; \
$(call getexportsymbols,EXPORT_SYMBOL(\1);) ; }
Fixes: 2bc56fdae1ba ("ftrace: Add ftrace_get_symaddr to convert fentry_ip to symaddr")
Signed-off-by: Haiyue Wang <haiyuewa@....com>
---
arch/x86/include/asm/ftrace.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index f9cb4d07df58..063ce70837bb 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -34,6 +34,10 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
return addr;
}
+#ifdef CONFIG_X86_KERNEL_IBT
+#include <linux/uaccess.h>
+#endif
+
static inline unsigned long arch_ftrace_get_symaddr(unsigned long fentry_ip)
{
#ifdef CONFIG_X86_KERNEL_IBT
--
2.48.1
Powered by blists - more mailing lists