x86: Fix VEX instruction decoding.
authorGabe Black <gabeblack@google.com>
Fri, 27 Oct 2017 20:46:58 +0000 (13:46 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 31 Oct 2017 02:04:33 +0000 (02:04 +0000)
When decoding VEX prefixed instructions, the x86 predecoder wasn't walking
past the opcode byte and so was also interpreting it as the modRM byte.

Reported-by: likunxi@fas.harvard.edu
Change-Id: I6d4bdabfa03411704c48d905c50c7b23072fc615
Reviewed-on: https://gem5-review.googlesource.com/5281
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/arch/x86/decoder.cc

index 930c2b951054ca496804935bca45d87febee8187..9c4997d6f02146cdf444b844a69d45546ac160f9 100644 (file)
@@ -355,6 +355,7 @@ Decoder::doVexOpcodeState(uint8_t nextByte)
     DPRINTF(Decoder, "Found VEX opcode %#x.\n", nextByte);
 
     emi.opcode.op = nextByte;
+    consumeByte();
 
     switch (emi.opcode.type) {
       case TwoByteOpcode: