Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759533AbXL3H2k (ORCPT ); Sun, 30 Dec 2007 02:28:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756635AbXL3HLm (ORCPT ); Sun, 30 Dec 2007 02:11:42 -0500 Received: from terminus.zytor.com ([198.137.202.10]:49904 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753322AbXL3HLQ (ORCPT ); Sun, 30 Dec 2007 02:11:16 -0500 Message-ID: <47774314.9080406@zytor.com> Date: Sat, 29 Dec 2007 23:04:52 -0800 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Masami Hiramatsu CC: Harvey Harrison , Ananth N Mavinakayanahalli , Jim Keniston , Ingo Molnar , LKML , Thomas Gleixner Subject: Re: [PATCH] x86: Introduce REX prefix helper for kprobes References: <1198466795.6323.12.camel@brick> <47773C2D.8070600@redhat.com> In-Reply-To: <47773C2D.8070600@redhat.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: 950 Lines: 28 Masami Hiramatsu wrote: > Hi Harvey, > > Harvey Harrison wrote: >> Fold some small ifdefs into a helper function. >> >> Signed-off-by: Harvey Harrison >> --- >> Masami, Ingo, I had this left in some unsent kprobes unification >> work. Depends on your tastes, but does reduce ifdefs and is a bit >> better about self-documenting the REX prefix on X86_64. > > Basically, I think it is good idea. > Could you use a macro same as the stack_addr() macro, like as below? > > #defile is_REX_prefix(insn) ((insn & 0xf0) == 0x40)) > > This is just a bit checker, so I think a macro is better to do that. > Why is a macro better than an inline, and why the odd mIXed case? -hpa -- 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/