x86: Hide the int3_emulate_call/jmp functions from UML
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Sat, 11 May 2019 12:32:40 +0000 (08:32 -0400)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 27 May 2019 10:48:26 +0000 (12:48 +0200)
commit 693713cbdb3a4bda5a8a678c31f06560bbb14657 upstream.

User Mode Linux does not have access to the ip or sp fields of the pt_regs,
and accessing them causes UML to fail to build. Hide the int3_emulate_jmp()
and int3_emulate_call() instructions from UML, as it doesn't need them
anyway.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
arch/x86/include/asm/text-patching.h

index ab3b9887e1402b0bc337a8cb5b69d9401c97d599..12dd61dc3c79f11dba0b5e49256fbebbb1aecc69 100644 (file)
@@ -38,6 +38,7 @@ extern void *text_poke(void *addr, const void *opcode, size_t len);
 extern int poke_int3_handler(struct pt_regs *regs);
 extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler);
 
+#ifndef CONFIG_UML_X86
 static inline void int3_emulate_jmp(struct pt_regs *regs, unsigned long ip)
 {
        regs->ip = ip;
@@ -64,6 +65,7 @@ static inline void int3_emulate_call(struct pt_regs *regs, unsigned long func)
        int3_emulate_push(regs, regs->ip - INT3_INSN_SIZE + CALL_INSN_SIZE);
        int3_emulate_jmp(regs, func);
 }
-#endif
+#endif /* CONFIG_X86_64 */
+#endif /* !CONFIG_UML_X86 */
 
 #endif /* _ASM_X86_TEXT_PATCHING_H */