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

Commit 98775936 authored by Russell King's avatar Russell King
Browse files

Merge tag 'for_russell/arm-be-probes' of...

Merge tag 'for_russell/arm-be-probes' of git://git.linaro.org/people/taras.kondratiuk/linux into devel-stable

It is reworked initial Ben's series for big endian support [1].
Dropped patches that are not directly related to probes and rebased
series on top of Dave Long's ARM uprobes series. Current set of
patches is enough to have functional BE kprobes and uprobes.

One ARM kprobe test fails on Cortex-A15 boards (TC2 and Keystone2 EVM),
while it passes on Pandaboard. The issue is not related to this series
and already present since v3.13-rc7.

v1..v2: Rebased series on top of Dave Long's ARM uprobes series.
        Now this series fixes both BE kprobes and BE uprobes.

Tested on Pandaboard ES and TI Keystone2 EVM.

pull req v1: http://www.spinics.net/lists/arm-kernel/msg300227.html
[1] http://www.spinics.net/lists/arm-kernel/msg285210.html
parents 566b60c0 41b5368f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@

#include <linux/kernel.h>
#include <linux/kprobes.h>
#include <asm/opcodes.h>

#include "kprobes.h"

@@ -153,7 +154,8 @@ kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_probes_insn *asi,

	if (handler) {
		/* We can emulate the instruction in (possibly) modified form */
		asi->insn[0] = (insn & 0xfff00000) | (rn << 16) | reglist;
		asi->insn[0] = __opcode_to_mem_arm((insn & 0xfff00000) |
						   (rn << 16) | reglist);
		asi->insn_handler = handler;
		return INSN_GOOD;
	}
+302 −301

File changed.

Preview size limit exceeded, changes collapsed.

+224 −223

File changed.

Preview size limit exceeded, changes collapsed.

+7 −6
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@
 *	@ start of inline data...
 *	.ascii "mov r0, r7"	@ text title for test case
 *	.byte	0
 *	.align	2
 *	.align	2, 0
 *
 *	@ TEST_ARG_REG
 *	.byte	ARG_TYPE_REG
@@ -1333,7 +1333,8 @@ static void test_case_failed(const char *message)
static unsigned long next_instruction(unsigned long pc)
{
#ifdef CONFIG_THUMB2_KERNEL
	if ((pc & 1) && !is_wide_instruction(*(u16 *)(pc - 1)))
	if ((pc & 1) &&
	    !is_wide_instruction(__mem_to_opcode_thumb16(*(u16 *)(pc - 1))))
		return pc + 2;
	else
#endif
@@ -1378,13 +1379,13 @@ static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)

	if (test_case_is_thumb) {
		u16 *p = (u16 *)(test_code & ~1);
		current_instruction = p[0];
		current_instruction = __mem_to_opcode_thumb16(p[0]);
		if (is_wide_instruction(current_instruction)) {
			current_instruction <<= 16;
			current_instruction |= p[1];
			u16 instr2 = __mem_to_opcode_thumb16(p[1]);
			current_instruction = __opcode_thumb32_compose(current_instruction, instr2);
		}
	} else {
		current_instruction = *(u32 *)test_code;
		current_instruction = __mem_to_opcode_arm(*(u32 *)test_code);
	}

	if (current_title[0] == '.')
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ struct test_arg_end {
	/* multiple strings to be concatenated.  */		\
	".ascii "#title"				\n\t"	\
	".byte	0					\n\t"	\
	".align	2					\n\t"
	".align	2, 0					\n\t"

#define	TEST_ARG_REG(reg, val)					\
	".byte	"__stringify(ARG_TYPE_REG)"		\n\t"	\
Loading