Skip to contentSkip to conversation

+ s390-kprobes-add-support-for-pc-relative-long-displacement-instructions.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Aug 23, 2013 s390

lore
Share & tools
lore
#0 lore raw

Subject: + s390-kprobes-add-support-for-pc-relative-long-displacement-instructions.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Fri, 23 Aug 2013 16:24:05 -0700

The patch titled
Subject: s390/kprobes: add support for pc-relative long displacement instructions
has been added to the -mm tree. Its filename is
s390-kprobes-add-support-for-pc-relative-long-displacement-instructions.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/s390-kprobes-add-support-for-pc-relative-long-displacement-instructions.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/s390-kprobes-add-support-for-pc-relative-long-displacement-instructions.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Heiko Carstens <[email protected]>
Subject: s390/kprobes: add support for pc-relative long displacement instructions

With the general-instruction extension facility (z10) a couple of instructions with a pc-relative long displacement were introduced. The kprobes support for these instructions however was never implemented.

In result, if anybody ever put a probe on any of these instructions the result would have been random behaviour after the instruction got executed within the insn slot.

So lets add the missing handling for these instructions. Since all of the new instructions have 32 bit signed displacement the easiest solution is to allocate an insn slot that is within the same 2GB area like the original instruction and patch the displacement field.

Cc Masami Hiramatsu <[email protected]>
Cc Ananth N Mavinakayanahalli <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Martin Schwidefsky <[email protected]>

---

 arch/s390/include/asm/kprobes.h |    4 
 arch/s390/kernel/kprobes.c      |  144 ++++++++++++++++++++++++++++--
 2 files changed, 140 insertions(+), 8 deletions(-)
arch/s390/include/asm/kprobes.h renamed from arch/s390/include/asm/kprobes.h~s390-kprobes-add-support-for-pc-relative-long-displacement-instructions +3 -1
diff -puN arch/s390/include/asm/kprobes.h~s390-kprobes-add-support-for-pc-relative-long-displacement-instructions arch/s390/include/asm/kprobes.h
@@ -31,6 +31,8 @@
 #include <linux/ptrace.h>
 #include <linux/percpu.h>
 
+#define __ARCH_WANT_KPROBES_INSN_SLOT
+
 struct pt_regs;
 struct kprobe;
 
@@ -57,7 +59,7 @@ typedef u16 kprobe_opcode_t;
 /* Architecture specific copy of original instruction */
 struct arch_specific_insn {
 	/* copy of original instruction */
-	kprobe_opcode_t insn[MAX_INSN_SIZE];
+	kprobe_opcode_t *insn;
 };
 
 struct prev_kprobe {
arch/s390/kernel/kprobes.c renamed from arch/s390/kernel/kprobes.c~s390-kprobes-add-support-for-pc-relative-long-displacement-instructions +135 -6

164 lines not on this page · raw message