Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753773Ab2BHJkx (ORCPT ); Wed, 8 Feb 2012 04:40:53 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:46456 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074Ab2BHJkv convert rfc822-to-8bit (ORCPT ); Wed, 8 Feb 2012 04:40:51 -0500 MIME-Version: 1.0 In-Reply-To: <20120207171707.GA24443@linux.vnet.ibm.com> References: <20120202141840.5967.39687.sendpatchset@srdronam.in.ibm.com> <20120202141851.5967.68000.sendpatchset@srdronam.in.ibm.com> <20120207171707.GA24443@linux.vnet.ibm.com> From: Denys Vlasenko Date: Wed, 8 Feb 2012 10:40:30 +0100 Message-ID: Subject: Re: [PATCH v10 3.3-rc2 1/9] uprobes: Install and remove breakpoints. To: Srikar Dronamraju Cc: Peter Zijlstra , Linus Torvalds , Oleg Nesterov , Ingo Molnar , Andrew Morton , LKML , Linux-mm , Andi Kleen , Christoph Hellwig , Steven Rostedt , Roland McGrath , Thomas Gleixner , Masami Hiramatsu , Arnaldo Carvalho de Melo , Anton Arapov , Ananth N Mavinakayanahalli , Jim Keniston , Stephen Rothwell Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1248 Lines: 32 On Tue, Feb 7, 2012 at 6:17 PM, Srikar Dronamraju wrote: > Changelog: (Since v10): Add code to clear REX.B prefix pointed out by Denys Vlasenko > and fix suggested by Masami Hiramatsu. ... > + ? ? ? /* > + ? ? ? ?* Point cursor at the modrm byte. ?The next 4 bytes are the > + ? ? ? ?* displacement. ?Beyond the displacement, for some instructions, > + ? ? ? ?* is the immediate operand. > + ? ? ? ?*/ > + ? ? ? cursor = uprobe->insn + insn_offset_modrm(insn); > + ? ? ? insn_get_length(insn); > + ? ? ? if (insn->rex_prefix.nbytes) > + ? ? ? ? ? ? ? *cursor &= 0xfe; ? ? ? ?/* Clearing REX.B bit */ It looks like cursor points to mod/reg/rm byte, not rex byte. Comment above says it too. You seem to be clearing a bit in a wrong byte. I think it should be /* Clear REX.b bit (extension of MODRM.rm field): * we want to encode rax/rcx, not r8/r9. */ if (insn->rex_prefix.nbytes) insn->rex_prefix.bytes[0] &= 0xfe; -- vda -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/