[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1396998435.5056.74.camel@oc7886638347.ibm.com.usor.ibm.com>
Date: Tue, 08 Apr 2014 16:07:15 -0700
From: Jim Keniston <jkenisto@...ux.vnet.ibm.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Ingo Molnar <mingo@...e.hu>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Anton Arapov <aarapov@...hat.com>,
David Long <dave.long@...aro.org>,
Denys Vlasenko <dvlasenk@...hat.com>,
"Frank Ch. Eigler" <fche@...hat.com>,
Jonathan Lebon <jlebon@...hat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 6/6] uprobes/x86: Emulate rip-relative conditional
"near" jmp's
On Mon, 2014-04-07 at 16:28 +0200, Oleg Nesterov wrote:
> On 04/06, Oleg Nesterov wrote:
> >
> > But I'll try to cleanup this patch...
>
> See v2 below.
>
> -------------------------------------------------------------------------------
> Subject: [RFC PATCH v2 6/6] uprobes/x86: Emulate rip-relative conditional "near" jmp's
>
> It seems that 16bit condi jmp is just 0x0f + short_jump_opc_plus_0x10.
Yes, but the code could use a comment to that effect. See below.
Searching for "jump" in the AMD manual, I see that there are 3 other
instructions that are essentially conditional branches: loop,
loope/loopz, and loopne/loopnz. They decrement ecx/rcx and then
conditionally branch. The offset is always 8 bits.
BTW, patches 2 and 3 look fine to me.
>
> Reported-by: Jonathan Lebon <jlebon@...hat.com>
> Signed-off-by: Oleg Nesterov <oleg@...hat.com>
> ---
> arch/x86/kernel/uprobes.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
> index 3865d8b..dae02f9 100644
> --- a/arch/x86/kernel/uprobes.c
> +++ b/arch/x86/kernel/uprobes.c
> @@ -591,6 +591,10 @@ static int ttt_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn)
> auprobe->ttt.opc1 = opc1;
> break;
>
> + case 0x0f:
> + if (insn->opcode.nbytes != 2)
> + return -ENOSYS;
/*
* Map 0f 8x (Jcc with 32-bit displacement) to 7x
* (Jcc with 8-bit displacement). insn lib maps both
* to 32 bits.
*/
> + opc1 = OPCODE2(insn) - 0x10;
> default:
> if (!is_cond_jmp_opcode(opc1))
> return -ENOSYS;
Jim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists