summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2019-05-11 08:32:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 06:46:00 -0700
commit1d84eb87efceb7bfbe52d7f3539af6c2e9c86870 (patch)
treeceb08dbe1176a57ff50cff470b440c375823cc9c /arch
parent8b2fc005825583918be22b7bea6c155061e2f18d (diff)
downloadlinux-stable-1d84eb87efceb7bfbe52d7f3539af6c2e9c86870.tar.gz
linux-stable-1d84eb87efceb7bfbe52d7f3539af6c2e9c86870.tar.bz2
linux-stable-1d84eb87efceb7bfbe52d7f3539af6c2e9c86870.zip
x86: Hide the int3_emulate_call/jmp functions from UML
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@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/text-patching.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h
index 05861cc08787..0bbb07eaed6b 100644
--- a/arch/x86/include/asm/text-patching.h
+++ b/arch/x86/include/asm/text-patching.h
@@ -39,6 +39,7 @@ extern int poke_int3_handler(struct pt_regs *regs);
extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler);
extern int after_bootmem;
+#ifndef CONFIG_UML_X86
static inline void int3_emulate_jmp(struct pt_regs *regs, unsigned long ip)
{
regs->ip = ip;
@@ -65,6 +66,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 */