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

Commit 602cd260 authored by David A. Long's avatar David A. Long
Browse files

ARM: Add an emulate flag to the kprobes/uprobes instruction decode functions



Add an emulate flag into the instruction interpreter, primarily for uprobes
support.

Signed-off-by: default avatarDavid A. Long <dave.long@linaro.org>
Acked-by: default avatarJon Medhurst <tixy@linaro.org>
parent 47e190fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
	p->opcode = insn;
	p->ainsn.insn = tmp_insn;

	switch ((*decode_insn)(insn, &p->ainsn, actions)) {
	switch ((*decode_insn)(insn, &p->ainsn, true, actions)) {
	case INSN_REJECTED:	/* not supported */
		return -EINVAL;

+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi,

typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t,
						struct arch_specific_insn *,
						bool,
						const union decode_action *);

#ifdef CONFIG_THUMB2_KERNEL
+2 −2
Original line number Diff line number Diff line
@@ -725,10 +725,10 @@ static void __kprobes arm_singlestep(probes_opcode_t insn,
 */
enum probes_insn __kprobes
arm_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
		       const union decode_action *actions)
		       bool emulate, const union decode_action *actions)
{
	asi->insn_singlestep = arm_singlestep;
	asi->insn_check_cc = probes_condition_checks[insn>>28];
	return probes_decode_insn(insn, asi, probes_decode_arm_table, false,
				  actions);
				  emulate, actions);
}
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ void __kprobes simulate_mov_ipsp(probes_opcode_t opcode,
extern const union decode_item probes_decode_arm_table[];

enum probes_insn arm_probes_decode_insn(probes_opcode_t,
		struct arch_specific_insn *,
		struct arch_specific_insn *, bool emulate,
		const union decode_action *actions);

#endif
+4 −4
Original line number Diff line number Diff line
@@ -863,20 +863,20 @@ static void __kprobes thumb32_singlestep(probes_opcode_t opcode,

enum probes_insn __kprobes
thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
			   const union decode_action *actions)
			   bool emulate, const union decode_action *actions)
{
	asi->insn_singlestep = thumb16_singlestep;
	asi->insn_check_cc = thumb_check_cc;
	return probes_decode_insn(insn, asi, probes_decode_thumb16_table, true,
				  actions);
				  emulate, actions);
}

enum probes_insn __kprobes
thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_specific_insn *asi,
			   const union decode_action *actions)
			   bool emulate, const union decode_action *actions)
{
	asi->insn_singlestep = thumb32_singlestep;
	asi->insn_check_cc = thumb_check_cc;
	return probes_decode_insn(insn, asi, probes_decode_thumb32_table, true,
				  actions);
				  emulate, actions);
}
Loading