Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e29df90 authored by Ivaylo Georgiev's avatar Ivaylo Georgiev
Browse files

Revert "x86_64: Allow breakpoints to emulate call instructions"



This reverts commit ba246f64.

This is a preparation change for merging android-4.19.46 into
msm-4.19 branch.

This change leads to following errors during Usermode Linux Compilation:

/checker/work.refs/heads/msm-4.19/src/linux/kernel/arch/x86/include/asm/text-patching.h:44:6:
error: 'struct pt_regs' has no member named 'ip'
 S 12:31:00   regs->ip = ip;
 S 12:31:00       ^
 S 12:31:00
/checker/work.refs/heads/msm-4.19/src/linux/kernel/arch/x86/include/asm/text-patching.h:59:6:
error: 'struct pt_regs' has no member named 'sp'
 S 12:31:00   regs->sp -= sizeof(unsigned long);
 S 12:31:00       ^
 S 12:31:00
/checker/work.refs/heads/msm-4.19/src/linux/kernel/arch/x86/include/asm/text-patching.h:60:24:
error: 'struct pt_regs' has no member named 'sp'
 S 12:31:00   *(unsigned long *)regs->sp = val;
 S 12:31:00                         ^
 S 12:31:00
/checker/work.refs/heads/msm-4.19/src/linux/kernel/arch/x86/include/asm/text-patching.h:65:30:
error: 'struct pt_regs' has no member named 'ip'
 S 12:31:00   int3_emulate_push(regs, regs->ip - INT3_INSN_SIZE +
CALL_INSN_SIZE);
 S 12:31:00                               ^

Change-Id: Id67d4728096921773f48e4d7ebc08371557b2423
Signed-off-by: default avatarIvaylo Georgiev <irgeorgiev@codeaurora.org>
parent aa07ecba
Loading
Loading
Loading
Loading
+0 −28
Original line number Original line Diff line number Diff line
@@ -39,32 +39,4 @@ 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 void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler);
extern int after_bootmem;
extern int after_bootmem;


static inline void int3_emulate_jmp(struct pt_regs *regs, unsigned long ip)
{
	regs->ip = ip;
}

#define INT3_INSN_SIZE 1
#define CALL_INSN_SIZE 5

#ifdef CONFIG_X86_64
static inline void int3_emulate_push(struct pt_regs *regs, unsigned long val)
{
	/*
	 * The int3 handler in entry_64.S adds a gap between the
	 * stack where the break point happened, and the saving of
	 * pt_regs. We can extend the original stack because of
	 * this gap. See the idtentry macro's create_gap option.
	 */
	regs->sp -= sizeof(unsigned long);
	*(unsigned long *)regs->sp = val;
}

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 /* _ASM_X86_TEXT_PATCHING_H */
#endif /* _ASM_X86_TEXT_PATCHING_H */