Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933233AbbBIXez (ORCPT ); Mon, 9 Feb 2015 18:34:55 -0500 Received: from mail7.hitachi.co.jp ([133.145.228.42]:47541 "EHLO mail7.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932911AbbBIXex (ORCPT ); Mon, 9 Feb 2015 18:34:53 -0500 Message-ID: <54D94415.8070206@hitachi.com> Date: Tue, 10 Feb 2015 08:34:45 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Wang Nan Cc: tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org, lizefan@huawei.com Subject: Re: [PATCH] kprobes: x86: mark 2 bytes NOP as boostable. References: <1423485906-76291-1-git-send-email-wangnan0@huawei.com> In-Reply-To: <1423485906-76291-1-git-send-email-wangnan0@huawei.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1929 Lines: 54 (2015/02/09 21:45), Wang Nan wrote: > x86 kprobes is unable to probe at 2 bytes nop like: ^^^^^ boost > > nopl 0x0(%rax,%rax,1) > > which is 0x0f 0x1f 0x44 0x00 0x00. > > Such nops have exactly 5 bytes which is able to hold a relative jmp > instruction. Boosting them should be obviously safe. > > This patch enable boosting such nops by simply updating > twobyte_is_boostable[] array. Anyway, this looks good to me. Acked-by: Masami Hiramatsu Thank you! > > Signed-off-by: Wang Nan > --- > arch/x86/kernel/kprobes/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c > index 98f654d..6a1146e 100644 > --- a/arch/x86/kernel/kprobes/core.c > +++ b/arch/x86/kernel/kprobes/core.c > @@ -84,7 +84,7 @@ static volatile u32 twobyte_is_boostable[256 / 32] = { > /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ > /* ---------------------------------------------- */ > W(0x00, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0) | /* 00 */ > - W(0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 10 */ > + W(0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) , /* 10 */ > W(0x20, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* 20 */ > W(0x30, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 30 */ > W(0x40, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* 40 */ > -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com -- 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/