1 From 693713cbdb3a4bda5a8a678c31f06560bbb14657 Mon Sep 17 00:00:00 2001
2 From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
3 Date: Sat, 11 May 2019 08:32:40 -0400
4 Subject: x86: Hide the int3_emulate_call/jmp functions from UML
6 From: Steven Rostedt (VMware) <rostedt@goodmis.org>
8 commit 693713cbdb3a4bda5a8a678c31f06560bbb14657 upstream.
10 User Mode Linux does not have access to the ip or sp fields of the pt_regs,
11 and accessing them causes UML to fail to build. Hide the int3_emulate_jmp()
12 and int3_emulate_call() instructions from UML, as it doesn't need them
15 Reported-by: kbuild test robot <lkp@intel.com>
16 Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 arch/x86/include/asm/text-patching.h | 4 +++-
21 1 file changed, 3 insertions(+), 1 deletion(-)
23 --- a/arch/x86/include/asm/text-patching.h
24 +++ b/arch/x86/include/asm/text-patching.h
25 @@ -39,6 +39,7 @@ extern int poke_int3_handler(struct pt_r
26 extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler);
27 extern int after_bootmem;
29 +#ifndef CONFIG_UML_X86
30 static inline void int3_emulate_jmp(struct pt_regs *regs, unsigned long ip)
33 @@ -65,6 +66,7 @@ static inline void int3_emulate_call(str
34 int3_emulate_push(regs, regs->ip - INT3_INSN_SIZE + CALL_INSN_SIZE);
35 int3_emulate_jmp(regs, func);
38 +#endif /* CONFIG_X86_64 */
39 +#endif /* !CONFIG_UML_X86 */
41 #endif /* _ASM_X86_TEXT_PATCHING_H */