Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Issue 2841863003: Improve the decoding of the VEX encoded instructions. (Closed)

Created:
3 years, 7 months ago by Sébastien Marchand
Modified:
3 years, 7 months ago
Reviewers:
chrisha, huangs
CC:
syzygy-changes_googlegroups.com
Target Ref:
refs/heads/master
Project:
syzygy
Visibility:
Public.

Description

Improve the decoding of the VEX encoded instructions. Currently our decoding assumes a constant instruction size (based on the opcode) but this doesn't really work because these instructions use a Mod R/M operand (see http://www.c-jump.com/CIS77/CPU/x86/X77_0090_addressing_modes.htm). This add support for the different sizes that these instructions can have, as well as some restrictions on which variants are supported. This has been tested on the latest official build of Chrome. Review-Url: https://codereview.chromium.org/2841863003 Committed: https://github.com/google/syzygy/commit/5970d392dbf2d3746fe13212eea1dbc9af9cd46c

Patch Set 1 #

Patch Set 2 : Use a constant. #

Total comments: 4

Patch Set 3 : Add support for the Mod R/M byte. #

Patch Set 4 : Add support for the Mod R/M byte. #

Total comments: 28

Patch Set 5 : Address Sam's comment, support SIB.base = 5 #

Total comments: 26

Patch Set 6 : Address Sam's second round of comments. #

Total comments: 4

Patch Set 7 : Nits. #

Total comments: 2

Patch Set 8 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3071 lines, -49 lines) Patch
M syzygy/core/core.gyp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M syzygy/core/disassembler_util.cc View 1 2 3 4 5 6 7 3 chunks +287 lines, -29 lines 0 comments Download
M syzygy/core/disassembler_util_unittest.cc View 1 2 3 4 5 3 chunks +17 lines, -20 lines 0 comments Download
A syzygy/core/disassembler_util_unittest_vex_utils.h View 1 2 3 4 5 1 chunk +40 lines, -0 lines 0 comments Download
A syzygy/core/disassembler_util_unittest_vex_utils.cc View 1 2 3 4 5 6 1 chunk +2725 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (12 generated)
huangs
Some comments. https://codereview.chromium.org/2841863003/diff/20001/syzygy/core/disassembler_util.cc File syzygy/core/disassembler_util.cc (right): https://codereview.chromium.org/2841863003/diff/20001/syzygy/core/disassembler_util.cc#newcode63 syzygy/core/disassembler_util.cc:63: CHECK((ci->code[4] & kModRMMask) != 0) << Perhaps ...
3 years, 7 months ago (2017-04-25 22:14:21 UTC) #4
chrisha
https://codereview.chromium.org/2841863003/diff/20001/syzygy/core/disassembler_util.cc File syzygy/core/disassembler_util.cc (right): https://codereview.chromium.org/2841863003/diff/20001/syzygy/core/disassembler_util.cc#newcode43 syzygy/core/disassembler_util.cc:43: // - Fourth byte: The opcode for this instruction. ...
3 years, 7 months ago (2017-04-26 15:09:10 UTC) #6
Sébastien Marchand
My previous approach was still too simplistic and I had to add support for Mod ...
3 years, 7 months ago (2017-04-28 19:38:40 UTC) #8
huangs
Haven't looked through everything, but here are some more items. https://codereview.chromium.org/2841863003/diff/60001/syzygy/core/disassembler_util.cc File syzygy/core/disassembler_util.cc (right): https://codereview.chromium.org/2841863003/diff/60001/syzygy/core/disassembler_util.cc#newcode73 ...
3 years, 7 months ago (2017-04-28 21:58:05 UTC) #9
Sébastien Marchand
Thanks for the thorough review Sam (as always)! PTAnL. https://codereview.chromium.org/2841863003/diff/60001/syzygy/core/disassembler_util.cc File syzygy/core/disassembler_util.cc (right): https://codereview.chromium.org/2841863003/diff/60001/syzygy/core/disassembler_util.cc#newcode73 syzygy/core/disassembler_util.cc:73: ...
3 years, 7 months ago (2017-05-01 16:04:32 UTC) #11
huangs
Round 2. https://codereview.chromium.org/2841863003/diff/100001/syzygy/core/disassembler_util.cc File syzygy/core/disassembler_util.cc (right): https://codereview.chromium.org/2841863003/diff/100001/syzygy/core/disassembler_util.cc#newcode37 syzygy/core/disassembler_util.cc:37: // - mod: combined with the r/m ...
3 years, 7 months ago (2017-05-01 18:54:14 UTC) #12
Sébastien Marchand
Thanks! PTAnL. https://codereview.chromium.org/2841863003/diff/100001/syzygy/core/disassembler_util.cc File syzygy/core/disassembler_util.cc (right): https://codereview.chromium.org/2841863003/diff/100001/syzygy/core/disassembler_util.cc#newcode37 syzygy/core/disassembler_util.cc:37: // - mod: combined with the r/m ...
3 years, 7 months ago (2017-05-01 21:19:27 UTC) #14
huangs
LGTM with NITs. Please run full production flow to ensure things still work. Thanks! https://codereview.chromium.org/2841863003/diff/140001/syzygy/core/disassembler_util.cc ...
3 years, 7 months ago (2017-05-01 21:42:19 UTC) #15
Sébastien Marchand
Thanks! Waiting for Chris' review before committing this. https://codereview.chromium.org/2841863003/diff/140001/syzygy/core/disassembler_util.cc File syzygy/core/disassembler_util.cc (right): https://codereview.chromium.org/2841863003/diff/140001/syzygy/core/disassembler_util.cc#newcode68 syzygy/core/disassembler_util.cc:68: // ...
3 years, 7 months ago (2017-05-01 22:27:28 UTC) #16
chrisha
lgtm! Thanks for solving VEX once and for all :) https://codereview.chromium.org/2841863003/diff/160001/syzygy/core/disassembler_util.cc File syzygy/core/disassembler_util.cc (right): https://codereview.chromium.org/2841863003/diff/160001/syzygy/core/disassembler_util.cc#newcode89 ...
3 years, 7 months ago (2017-05-02 15:02:51 UTC) #17
Sébastien Marchand
Don't jinx it! There's still some strict limitation on what kind of instruction are supported, ...
3 years, 7 months ago (2017-05-02 15:20:48 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2841863003/180001
3 years, 7 months ago (2017-05-02 15:37:09 UTC) #22
commit-bot: I haz the power
3 years, 7 months ago (2017-05-02 16:18:13 UTC) #25
Message was sent while issue was closed.
Committed patchset #8 (id:180001) as
https://github.com/google/syzygy/commit/5970d392dbf2d3746fe13212eea1dbc9af9cd46c

Powered by Google App Engine
This is Rietveld 408576698