diff options
Diffstat (limited to 'arch/x86/kernel/uprobes.c')
-rw-r--r-- | arch/x86/kernel/uprobes.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 6c1ff31d99ff..495c776de4b4 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c | |||
@@ -357,20 +357,22 @@ static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn) | |||
357 | *cursor &= 0xfe; | 357 | *cursor &= 0xfe; |
358 | } | 358 | } |
359 | /* | 359 | /* |
360 | * Similar treatment for VEX3 prefix. | 360 | * Similar treatment for VEX3/EVEX prefix. |
361 | * TODO: add XOP/EVEX treatment when insn decoder supports them | 361 | * TODO: add XOP treatment when insn decoder supports them |
362 | */ | 362 | */ |
363 | if (insn->vex_prefix.nbytes == 3) { | 363 | if (insn->vex_prefix.nbytes >= 3) { |
364 | /* | 364 | /* |
365 | * vex2: c5 rvvvvLpp (has no b bit) | 365 | * vex2: c5 rvvvvLpp (has no b bit) |
366 | * vex3/xop: c4/8f rxbmmmmm wvvvvLpp | 366 | * vex3/xop: c4/8f rxbmmmmm wvvvvLpp |
367 | * evex: 62 rxbR00mm wvvvv1pp zllBVaaa | 367 | * evex: 62 rxbR00mm wvvvv1pp zllBVaaa |
368 | * (evex will need setting of both b and x since | 368 | * Setting VEX3.b (setting because it has inverted meaning). |
369 | * in non-sib encoding evex.x is 4th bit of MODRM.rm) | 369 | * Setting EVEX.x since (in non-SIB encoding) EVEX.x |
370 | * Setting VEX3.b (setting because it has inverted meaning): | 370 | * is the 4th bit of MODRM.rm, and needs the same treatment. |
371 | * For VEX3-encoded insns, VEX3.x value has no effect in | ||
372 | * non-SIB encoding, the change is superfluous but harmless. | ||
371 | */ | 373 | */ |
372 | cursor = auprobe->insn + insn_offset_vex_prefix(insn) + 1; | 374 | cursor = auprobe->insn + insn_offset_vex_prefix(insn) + 1; |
373 | *cursor |= 0x20; | 375 | *cursor |= 0x60; |
374 | } | 376 | } |
375 | 377 | ||
376 | /* | 378 | /* |
@@ -415,12 +417,10 @@ static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn) | |||
415 | 417 | ||
416 | reg = MODRM_REG(insn); /* Fetch modrm.reg */ | 418 | reg = MODRM_REG(insn); /* Fetch modrm.reg */ |
417 | reg2 = 0xff; /* Fetch vex.vvvv */ | 419 | reg2 = 0xff; /* Fetch vex.vvvv */ |
418 | if (insn->vex_prefix.nbytes == 2) | 420 | if (insn->vex_prefix.nbytes) |
419 | reg2 = insn->vex_prefix.bytes[1]; | ||
420 | else if (insn->vex_prefix.nbytes == 3) | ||
421 | reg2 = insn->vex_prefix.bytes[2]; | 421 | reg2 = insn->vex_prefix.bytes[2]; |
422 | /* | 422 | /* |
423 | * TODO: add XOP, EXEV vvvv reading. | 423 | * TODO: add XOP vvvv reading. |
424 | * | 424 | * |
425 | * vex.vvvv field is in bits 6-3, bits are inverted. | 425 | * vex.vvvv field is in bits 6-3, bits are inverted. |
426 | * But in 32-bit mode, high-order bit may be ignored. | 426 | * But in 32-bit mode, high-order bit may be ignored. |