linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn()
@ 2012-06-06  9:19 Ananth N Mavinakayanahalli
  2012-06-06  9:21 ` [PATCH 2/2] [POWERPC] uprobes: powerpc port Ananth N Mavinakayanahalli
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Ananth N Mavinakayanahalli @ 2012-06-06  9:19 UTC (permalink / raw)
  To: linuxppc-dev, lkml
  Cc: Srikar Dronamraju, peterz, oleg, Paul Mackerras, Anton Blanchard,
	Ingo Molnar

From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>

On RISC architectures like powerpc, instructions are fixed size.
Instruction analysis on such platforms is just a matter of (insn % 4).
Pass the vaddr at which the uprobe is to be inserted so that
arch_uprobe_analyze_insn() can flag misaligned registration requests.

Signed-off-by: Ananth N Mavinakaynahalli <ananth@in.ibm.com>
---
 arch/x86/include/asm/uprobes.h |    2 +-
 arch/x86/kernel/uprobes.c      |    3 ++-
 kernel/events/uprobes.c        |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

Index: uprobes-24may/arch/x86/include/asm/uprobes.h
===================================================================
--- uprobes-24may.orig/arch/x86/include/asm/uprobes.h
+++ uprobes-24may/arch/x86/include/asm/uprobes.h
@@ -48,7 +48,7 @@ struct arch_uprobe_task {
 #endif
 };
 
-extern int  arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm);
+extern int  arch_uprobe_analyze_insn(struct arch_uprobe *aup, struct mm_struct *mm, loff_t vaddr);
 extern int  arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs);
 extern int  arch_uprobe_post_xol(struct arch_uprobe *aup, struct pt_regs *regs);
 extern bool arch_uprobe_xol_was_trapped(struct task_struct *tsk);
Index: uprobes-24may/arch/x86/kernel/uprobes.c
===================================================================
--- uprobes-24may.orig/arch/x86/kernel/uprobes.c
+++ uprobes-24may/arch/x86/kernel/uprobes.c
@@ -409,9 +409,10 @@ static int validate_insn_bits(struct arc
  * arch_uprobe_analyze_insn - instruction analysis including validity and fixups.
  * @mm: the probed address space.
  * @arch_uprobe: the probepoint information.
+ * @vaddr: virtual address at which to install the probepoint
  * Return 0 on success or a -ve number on error.
  */
-int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm)
+int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, loff_t vaddr)
 {
 	int ret;
 	struct insn insn;
Index: uprobes-24may/kernel/events/uprobes.c
===================================================================
--- uprobes-24may.orig/kernel/events/uprobes.c
+++ uprobes-24may/kernel/events/uprobes.c
@@ -697,7 +697,7 @@ install_breakpoint(struct uprobe *uprobe
 		if (is_swbp_insn((uprobe_opcode_t *)uprobe->arch.insn))
 			return -EEXIST;
 
-		ret = arch_uprobe_analyze_insn(&uprobe->arch, mm);
+		ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, vaddr);
 		if (ret)
 			return ret;
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-06-12  4:53 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-06  9:19 [PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn() Ananth N Mavinakayanahalli
2012-06-06  9:21 ` [PATCH 2/2] [POWERPC] uprobes: powerpc port Ananth N Mavinakayanahalli
2012-06-06  9:27   ` Peter Zijlstra
2012-06-06  9:35     ` Ananth N Mavinakayanahalli
2012-06-06 18:08       ` Jim Keniston
2012-06-08  4:36         ` Ananth N Mavinakayanahalli
2012-06-08  5:51           ` Michael Ellerman
2012-06-08  6:01             ` Ananth N Mavinakayanahalli
2012-06-08  6:17               ` Michael Ellerman
2012-06-08  6:19                 ` Ananth N Mavinakayanahalli
2012-06-08  6:38                   ` Michael Ellerman
2012-06-08  9:21                     ` Ananth N Mavinakayanahalli
2012-06-12  4:01                       ` Michael Ellerman
2012-06-12  4:52                         ` Ananth N Mavinakayanahalli
2012-06-06  9:23 ` [PATCH 1/2] uprobes: Pass probed vaddr to arch_uprobe_analyze_insn() Peter Zijlstra
2012-06-06  9:37   ` Ananth N Mavinakayanahalli
2012-06-06  9:40     ` Ingo Molnar
2012-06-06 10:22       ` Ananth N Mavinakayanahalli
2012-06-06 11:44       ` Srikar Dronamraju
2012-06-08  4:33         ` Ananth N Mavinakayanahalli
2012-06-06 15:08 ` Oleg Nesterov
2012-06-06 16:30   ` Srikar Dronamraju

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).