lkml.org 
[lkml]   [2021]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/1] x86/kprobes: Use int3 instead of debug trap for single-step
On Mon, Mar 01, 2021 at 11:08:15PM +0900, Masami Hiramatsu wrote:

> + default:
> + if ((opcode & 0xf0) == 0x70) {
> + /* 1 byte conditional jump */
> + p->ainsn.emulate_op = kprobe_emulate_jcc;
> + p->ainsn.jcc.type = opcode & 0xf;
> + p->ainsn.rel32 = *(char *)insn->immediate.bytes;
> + }
> }

Would it make sense to write that as:

case 0x70 ... 0x7f:
/* 1 byte conditional jump */
p->ainsn.emulate_op = kprobe_emulate_jcc;
p->ainsn.jcc.type = opcode & 0xf;
p->ainsn.rel32 = *(char *)insn->immediate.bytes;
break;

instead? Preferably right before the 0x0f case :-)

\
 
 \ /
  Last update: 2021-03-02 16:40    [W:0.106 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site