From: Srikar Dronamraju <srikar@linux.vnet.ibm.com> To: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>, Linux-mm <linux-mm@kvack.org>, Arnaldo Carvalho de Melo <acme@infradead.org>, Linus Torvalds <torvalds@linux-foundation.org>, Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>, Hugh Dickins <hughd@google.com>, Christoph Hellwig <hch@infradead.org>, Andi Kleen <andi@firstfloor.org>, Thomas Gleixner <tglx@linutronix.de>, Jonathan Corbet <corbet@lwn.net>, Oleg Nesterov <oleg@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Jim Keniston <jkenisto@linux.vnet.ibm.com>, Roland McGrath <roland@hack.frob.com>, Ananth N Mavinakayanahalli <ananth@in.ibm.com>, LKML <linux-kernel@vger.kernel.org> Subject: Re: [PATCH v4 3.0-rc2-tip 2/22] 2: uprobes: Breakground page replacement. Date: Mon, 13 Jun 2011 14:29:55 +0530 [thread overview] Message-ID: <20110613085955.GD27130@linux.vnet.ibm.com> (raw) In-Reply-To: <1307660609.2497.1773.camel@laptop> * Peter Zijlstra <peterz@infradead.org> [2011-06-10 01:03:29]: > On Tue, 2011-06-07 at 18:28 +0530, Srikar Dronamraju wrote: > > + vaddr_old = kmap_atomic(old_page, KM_USER0); > > + vaddr_new = kmap_atomic(new_page, KM_USER1); > > + > > + memcpy(vaddr_new, vaddr_old, PAGE_SIZE); > > + /* poke the new insn in, ASSUMES we don't cross page boundary */ > > + addr = vaddr; > > + vaddr &= ~PAGE_MASK; > > + memcpy(vaddr_new + vaddr, &opcode, uprobe_opcode_sz); > > + > > + kunmap_atomic(vaddr_new); > > + kunmap_atomic(vaddr_old); > > > > + vaddr_new = kmap_atomic(page, KM_USER0); > > + vaddr &= ~PAGE_MASK; > > + memcpy(opcode, vaddr_new + vaddr, uprobe_opcode_sz); > > + kunmap_atomic(vaddr_new); > > > > Both sequences in resp {write,read}_opcode() assume the opcode doesn't > cross page boundaries but don't in fact have any assertions validating > this assumption. > read_opcode and write_opcode reads/writes just one breakpoint instruction I had the below note just above the write_opcode definition. /* * NOTE: * Expect the breakpoint instruction to be the smallest size instruction for * the architecture. If an arch has variable length instruction and the * breakpoint instruction is not of the smallest length instruction * supported by that architecture then we need to modify read_opcode / * write_opcode accordingly. This would never be a problem for archs that * have fixed length instructions. */ Do we have archs which have a breakpoint instruction which isnt of the smallest instruction size for that arch. If we do have can we change the write_opcode/read_opcode while we support that architecture? -- Thanks and Regards Srikar > >
WARNING: multiple messages have this Message-ID (diff)
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com> To: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>, Linux-mm <linux-mm@kvack.org>, Arnaldo Carvalho de Melo <acme@infradead.org>, Linus Torvalds <torvalds@linux-foundation.org>, Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>, Hugh Dickins <hughd@google.com>, Christoph Hellwig <hch@infradead.org>, Andi Kleen <andi@firstfloor.org>, Thomas Gleixner <tglx@linutronix.de>, Jonathan Corbet <corbet@lwn.net>, Oleg Nesterov <oleg@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Jim Keniston <jkenisto@linux.vnet.ibm.com>, Roland McGrath <roland@hack.frob.com>, Ananth N Mavinakayanahalli <ananth@in.ibm.com>, LKML <linux-kernel@vger.kernel.org> Subject: Re: [PATCH v4 3.0-rc2-tip 2/22] 2: uprobes: Breakground page replacement. Date: Mon, 13 Jun 2011 14:29:55 +0530 [thread overview] Message-ID: <20110613085955.GD27130@linux.vnet.ibm.com> (raw) In-Reply-To: <1307660609.2497.1773.camel@laptop> * Peter Zijlstra <peterz@infradead.org> [2011-06-10 01:03:29]: > On Tue, 2011-06-07 at 18:28 +0530, Srikar Dronamraju wrote: > > + vaddr_old = kmap_atomic(old_page, KM_USER0); > > + vaddr_new = kmap_atomic(new_page, KM_USER1); > > + > > + memcpy(vaddr_new, vaddr_old, PAGE_SIZE); > > + /* poke the new insn in, ASSUMES we don't cross page boundary */ > > + addr = vaddr; > > + vaddr &= ~PAGE_MASK; > > + memcpy(vaddr_new + vaddr, &opcode, uprobe_opcode_sz); > > + > > + kunmap_atomic(vaddr_new); > > + kunmap_atomic(vaddr_old); > > > > + vaddr_new = kmap_atomic(page, KM_USER0); > > + vaddr &= ~PAGE_MASK; > > + memcpy(opcode, vaddr_new + vaddr, uprobe_opcode_sz); > > + kunmap_atomic(vaddr_new); > > > > Both sequences in resp {write,read}_opcode() assume the opcode doesn't > cross page boundaries but don't in fact have any assertions validating > this assumption. > read_opcode and write_opcode reads/writes just one breakpoint instruction I had the below note just above the write_opcode definition. /* * NOTE: * Expect the breakpoint instruction to be the smallest size instruction for * the architecture. If an arch has variable length instruction and the * breakpoint instruction is not of the smallest length instruction * supported by that architecture then we need to modify read_opcode / * write_opcode accordingly. This would never be a problem for archs that * have fixed length instructions. */ Do we have archs which have a breakpoint instruction which isnt of the smallest instruction size for that arch. If we do have can we change the write_opcode/read_opcode while we support that architecture? -- Thanks and Regards Srikar > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-06-13 9:07 UTC|newest] Thread overview: 244+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-06-07 12:58 [PATCH v4 3.0-rc2-tip 0/22] 0: Uprobes patchset with perf probe support Srikar Dronamraju 2011-06-07 12:58 ` Srikar Dronamraju 2011-06-07 12:58 ` [PATCH v4 3.0-rc2-tip 1/22] 1: X86 specific breakpoint definitions Srikar Dronamraju 2011-06-07 12:58 ` Srikar Dronamraju 2011-06-07 12:58 ` [PATCH v4 3.0-rc2-tip 2/22] 2: uprobes: Breakground page replacement Srikar Dronamraju 2011-06-07 12:58 ` Srikar Dronamraju 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-13 8:48 ` Srikar Dronamraju 2011-06-13 8:48 ` Srikar Dronamraju 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-13 8:50 ` Srikar Dronamraju 2011-06-13 8:50 ` Srikar Dronamraju 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-13 8:59 ` Srikar Dronamraju [this message] 2011-06-13 8:59 ` Srikar Dronamraju 2011-06-14 12:57 ` Peter Zijlstra 2011-06-14 12:57 ` Peter Zijlstra 2011-06-14 14:57 ` Srikar Dronamraju 2011-06-14 14:57 ` Srikar Dronamraju 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-13 9:14 ` Srikar Dronamraju 2011-06-13 9:14 ` Srikar Dronamraju 2011-06-13 13:46 ` Oleg Nesterov 2011-06-13 13:46 ` Oleg Nesterov 2011-06-13 17:00 ` Oleg Nesterov 2011-06-13 17:00 ` Oleg Nesterov 2011-06-14 12:35 ` Srikar Dronamraju 2011-06-14 12:35 ` Srikar Dronamraju 2011-06-14 14:20 ` Oleg Nesterov 2011-06-14 14:20 ` Oleg Nesterov 2011-06-15 8:55 ` Srikar Dronamraju 2011-06-15 8:55 ` Srikar Dronamraju 2011-06-15 17:54 ` Oleg Nesterov 2011-06-15 17:54 ` Oleg Nesterov 2011-06-14 13:01 ` Peter Zijlstra 2011-06-14 13:01 ` Peter Zijlstra 2011-06-14 14:27 ` Oleg Nesterov 2011-06-14 14:27 ` Oleg Nesterov 2011-06-14 15:07 ` Peter Zijlstra 2011-06-14 15:07 ` Peter Zijlstra 2011-06-14 15:40 ` Oleg Nesterov 2011-06-14 15:40 ` Oleg Nesterov 2011-06-14 18:22 ` Peter Zijlstra 2011-06-14 18:22 ` Peter Zijlstra 2011-06-16 12:48 ` Peter Zijlstra 2011-06-16 12:48 ` Peter Zijlstra 2011-06-07 12:58 ` [PATCH v4 3.0-rc2-tip 3/22] 3: uprobes: Adding and remove a uprobe in a rb tree Srikar Dronamraju 2011-06-07 12:58 ` Srikar Dronamraju 2011-06-08 4:12 ` Stephen Wilson 2011-06-08 4:12 ` Stephen Wilson 2011-06-08 7:04 ` Josh Stone 2011-06-08 7:04 ` Josh Stone 2011-06-08 10:29 ` Srikar Dronamraju 2011-06-08 10:29 ` Srikar Dronamraju 2011-06-08 10:30 ` Srikar Dronamraju 2011-06-08 10:30 ` Srikar Dronamraju 2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 4/22] 4: Uprobes: register/unregister probes Srikar Dronamraju 2011-06-07 12:59 ` Srikar Dronamraju 2011-06-08 22:10 ` Stephen Wilson 2011-06-08 22:10 ` Stephen Wilson 2011-06-09 5:43 ` Srikar Dronamraju 2011-06-09 5:43 ` Srikar Dronamraju 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-16 5:40 ` Srikar Dronamraju 2011-06-16 5:40 ` Srikar Dronamraju 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-13 16:50 ` Steven Rostedt 2011-06-13 16:50 ` Steven Rostedt 2011-06-16 5:26 ` Srikar Dronamraju 2011-06-16 5:26 ` Srikar Dronamraju 2011-06-16 9:42 ` Peter Zijlstra 2011-06-16 9:42 ` Peter Zijlstra 2011-06-13 19:57 ` Oleg Nesterov 2011-06-13 19:57 ` Oleg Nesterov 2011-06-14 12:00 ` Srikar Dronamraju 2011-06-14 12:00 ` Srikar Dronamraju 2011-06-14 14:29 ` Oleg Nesterov 2011-06-14 14:29 ` Oleg Nesterov 2011-06-15 17:30 ` Oleg Nesterov 2011-06-15 17:30 ` Oleg Nesterov 2011-06-16 5:09 ` Srikar Dronamraju 2011-06-16 5:09 ` Srikar Dronamraju 2011-06-15 17:41 ` Peter Zijlstra 2011-06-15 17:41 ` Peter Zijlstra 2011-06-16 4:11 ` Srikar Dronamraju 2011-06-16 4:11 ` Srikar Dronamraju 2011-06-16 9:46 ` Peter Zijlstra 2011-06-16 9:46 ` Peter Zijlstra 2011-06-16 9:54 ` Srikar Dronamraju 2011-06-16 9:54 ` Srikar Dronamraju 2011-06-16 10:09 ` Peter Zijlstra 2011-06-16 10:09 ` Peter Zijlstra 2011-06-16 13:51 ` Oleg Nesterov 2011-06-16 13:51 ` Oleg Nesterov 2011-06-17 9:29 ` Srikar Dronamraju 2011-06-17 9:29 ` Srikar Dronamraju 2011-06-15 18:01 ` Peter Zijlstra 2011-06-15 18:01 ` Peter Zijlstra 2011-07-24 18:07 ` Oleg Nesterov 2011-07-24 18:07 ` Oleg Nesterov 2011-07-25 12:17 ` Srikar Dronamraju 2011-07-25 12:17 ` Srikar Dronamraju 2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 5/22] 5: x86: analyze instruction and determine fixups Srikar Dronamraju 2011-06-07 12:59 ` Srikar Dronamraju 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 6/22] 6: uprobes: store/restore original instruction Srikar Dronamraju 2011-06-07 12:59 ` Srikar Dronamraju 2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 7/22] 7: uprobes: mmap and fork hooks Srikar Dronamraju 2011-06-07 12:59 ` Srikar Dronamraju 2011-06-08 22:12 ` Stephen Wilson 2011-06-08 22:12 ` Stephen Wilson 2011-06-09 5:50 ` Srikar Dronamraju 2011-06-09 5:50 ` Srikar Dronamraju 2011-06-15 18:11 ` Peter Zijlstra 2011-06-15 18:11 ` Peter Zijlstra 2011-06-16 3:26 ` Srikar Dronamraju 2011-06-16 3:26 ` Srikar Dronamraju 2011-06-16 12:00 ` Peter Zijlstra 2011-06-16 12:00 ` Peter Zijlstra 2011-06-16 13:00 ` Srikar Dronamraju 2011-06-16 13:00 ` Srikar Dronamraju 2011-06-16 18:23 ` Peter Zijlstra 2011-06-16 18:23 ` Peter Zijlstra 2011-06-16 18:25 ` Peter Zijlstra 2011-06-16 18:25 ` Peter Zijlstra 2011-06-17 4:50 ` Srikar Dronamraju 2011-06-17 4:50 ` Srikar Dronamraju 2011-06-17 8:03 ` Peter Zijlstra 2011-06-17 8:03 ` Peter Zijlstra 2011-06-17 9:05 ` Srikar Dronamraju 2011-06-17 9:05 ` Srikar Dronamraju 2011-06-17 9:41 ` Peter Zijlstra 2011-06-17 9:41 ` Peter Zijlstra 2011-06-21 13:17 ` Peter Zijlstra 2011-06-21 13:17 ` Peter Zijlstra 2011-06-22 14:39 ` Srikar Dronamraju 2011-06-22 14:39 ` Srikar Dronamraju 2011-06-24 2:06 ` Srikar Dronamraju 2011-06-24 2:06 ` Srikar Dronamraju 2011-06-24 7:42 ` Peter Zijlstra 2011-06-24 7:42 ` Peter Zijlstra 2011-06-27 6:45 ` Srikar Dronamraju 2011-06-27 6:45 ` Srikar Dronamraju 2011-06-27 8:57 ` Peter Zijlstra 2011-06-27 8:57 ` Peter Zijlstra 2011-07-18 9:20 ` Srikar Dronamraju 2011-07-18 9:20 ` Srikar Dronamraju 2011-07-18 14:31 ` Peter Zijlstra 2011-07-18 14:31 ` Peter Zijlstra 2011-07-19 6:53 ` Srikar Dronamraju 2011-07-19 6:53 ` Srikar Dronamraju 2011-07-20 11:56 ` Peter Zijlstra 2011-07-20 11:56 ` Peter Zijlstra 2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 8/22] 8: x86: architecture specific task information Srikar Dronamraju 2011-06-07 12:59 ` Srikar Dronamraju 2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 9/22] 9: uprobes: task specific information Srikar Dronamraju 2011-06-07 12:59 ` Srikar Dronamraju 2011-06-07 13:00 ` [PATCH v4 3.0-rc2-tip 10/22] 10: uprobes: slot allocation for uprobes Srikar Dronamraju 2011-06-07 13:00 ` Srikar Dronamraju 2011-06-07 13:00 ` [PATCH v4 3.0-rc2-tip 11/22] 11: uprobes: get the breakpoint address Srikar Dronamraju 2011-06-07 13:00 ` Srikar Dronamraju 2011-06-07 13:00 ` [PATCH v4 3.0-rc2-tip 12/22] 12: x86: x86 specific probe handling Srikar Dronamraju 2011-06-07 13:00 ` Srikar Dronamraju 2011-06-07 13:00 ` [PATCH v4 3.0-rc2-tip 13/22] 13: uprobes: Handing int3 and singlestep exception Srikar Dronamraju 2011-06-07 13:00 ` Srikar Dronamraju 2011-06-08 22:11 ` Stephen Wilson 2011-06-08 22:11 ` Stephen Wilson 2011-06-09 5:47 ` Srikar Dronamraju 2011-06-09 5:47 ` Srikar Dronamraju 2011-06-16 11:52 ` Peter Zijlstra 2011-06-16 11:52 ` Peter Zijlstra 2011-06-16 12:04 ` Srikar Dronamraju 2011-06-16 12:04 ` Srikar Dronamraju 2011-06-16 12:35 ` Peter Zijlstra 2011-06-16 12:35 ` Peter Zijlstra 2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 14/22] 14: x86: uprobes exception notifier for x86 Srikar Dronamraju 2011-06-07 13:01 ` Srikar Dronamraju 2011-06-21 13:31 ` Peter Zijlstra 2011-06-21 13:31 ` Peter Zijlstra 2011-06-21 13:32 ` Peter Zijlstra 2011-06-21 13:32 ` Peter Zijlstra 2011-06-22 14:54 ` Srikar Dronamraju 2011-06-22 14:54 ` Srikar Dronamraju 2011-06-22 16:40 ` Roland McGrath 2011-06-22 16:40 ` Roland McGrath 2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 15/22] 15: uprobes: register a notifier for uprobes Srikar Dronamraju 2011-06-07 13:01 ` Srikar Dronamraju 2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 16/22] 16: tracing: Extract out common code for kprobes/uprobes traceevents Srikar Dronamraju 2011-06-07 13:01 ` Srikar Dronamraju 2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 17/22] 17: tracing: uprobes trace_event interface Srikar Dronamraju 2011-06-07 13:01 ` Srikar Dronamraju 2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 18/22] 18: tracing: Uprobe tracer documentation Srikar Dronamraju 2011-06-07 13:01 ` Srikar Dronamraju 2011-06-07 13:02 ` [PATCH v4 3.0-rc2-tip 19/22] 19: perf: rename target_module to target Srikar Dronamraju 2011-06-07 13:02 ` Srikar Dronamraju 2011-06-07 13:02 ` [PATCH v4 3.0-rc2-tip 20/22] 20: perf: perf interface for uprobes Srikar Dronamraju 2011-06-07 13:02 ` Srikar Dronamraju 2011-06-07 13:30 ` Christoph Hellwig 2011-06-07 13:30 ` Christoph Hellwig 2011-06-07 13:38 ` Ananth N Mavinakayanahalli 2011-06-07 13:38 ` Ananth N Mavinakayanahalli 2011-06-07 14:21 ` Arnaldo Carvalho de Melo 2011-06-07 14:21 ` Arnaldo Carvalho de Melo 2011-06-07 16:06 ` Srikar Dronamraju 2011-06-07 16:06 ` Srikar Dronamraju 2011-06-08 3:41 ` Masami Hiramatsu 2011-06-08 3:41 ` Masami Hiramatsu 2011-06-07 19:59 ` Josh Stone 2011-06-07 19:59 ` Josh Stone 2011-06-08 3:44 ` Srikar Dronamraju 2011-06-08 3:44 ` Srikar Dronamraju 2011-06-10 11:50 ` Masami Hiramatsu 2011-06-10 11:50 ` Masami Hiramatsu 2011-06-13 8:41 ` Srikar Dronamraju 2011-06-14 6:29 ` Masami Hiramatsu 2011-06-14 11:56 ` Srikar Dronamraju 2011-06-16 5:59 ` Masami Hiramatsu 2011-06-07 13:02 ` [PATCH v4 3.0-rc2-tip 21/22] 21: perf: show possible probes in a given executable file or library Srikar Dronamraju 2011-06-07 13:02 ` Srikar Dronamraju 2011-06-07 13:02 ` [PATCH v4 3.0-rc2-tip 22/22] 22: perf: Documentation for perf uprobes Srikar Dronamraju 2011-06-07 13:02 ` Srikar Dronamraju 2011-06-10 12:03 ` Masami Hiramatsu 2011-06-10 12:03 ` Masami Hiramatsu 2011-06-09 18:42 ` [PATCH v4 3.0-rc2-tip 0/22] 0: Uprobes patchset with perf probe support Peter Zijlstra 2011-06-09 18:42 ` Peter Zijlstra 2011-06-10 5:56 ` Ananth N Mavinakayanahalli 2011-06-10 5:56 ` Ananth N Mavinakayanahalli 2011-06-13 9:23 ` Srikar Dronamraju 2011-06-13 9:23 ` Srikar Dronamraju 2011-06-09 23:03 ` Peter Zijlstra 2011-06-09 23:03 ` Peter Zijlstra 2011-06-10 6:15 ` Masami Hiramatsu 2011-06-10 6:15 ` Masami Hiramatsu 2011-06-13 10:08 ` Srikar Dronamraju 2011-06-13 10:08 ` Srikar Dronamraju
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20110613085955.GD27130@linux.vnet.ibm.com \ --to=srikar@linux.vnet.ibm.com \ --cc=acme@infradead.org \ --cc=akpm@linux-foundation.org \ --cc=ananth@in.ibm.com \ --cc=andi@firstfloor.org \ --cc=corbet@lwn.net \ --cc=hch@infradead.org \ --cc=hughd@google.com \ --cc=jkenisto@linux.vnet.ibm.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=masami.hiramatsu.pt@hitachi.com \ --cc=mingo@elte.hu \ --cc=oleg@redhat.com \ --cc=peterz@infradead.org \ --cc=roland@hack.frob.com \ --cc=rostedt@goodmis.org \ --cc=tglx@linutronix.de \ --cc=torvalds@linux-foundation.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.