]> xenbits.xensource.com Git - xen.git/commit
x86emul: improve LOCK handling
authorJan Beulich <jbeulich@suse.com>
Wed, 17 Aug 2016 13:36:55 +0000 (15:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 17 Aug 2016 13:36:55 +0000 (15:36 +0200)
commitdee231b5a8e0408c12479940cd9874b3869bd5c9
tree81a380f372523e5a65bcc23ec51d99a19298d54b
parentc826567bbcf8f32cd9c08ba74cbcd29b60ad80d2
x86emul: improve LOCK handling

Certain opcodes would so far not have got #UD when a LOCK prefix was
present. Adjust this by
- moving the too early generic check into destination operand decoding,
  where DstNone and DstReg already have respective handling
- switching source and destination of TEST r,r/m, for it to be taken
  care of by aforementioned generic checks
- explicitly dealing with all forms of CMP, SHLD, SHRD, as well as
  TEST $imm,r/m

To make the handling of opcodes F6 and F7 more obvious, reduce the
amount of state set in the table, and adjust the respective switch()
statement accordingly.

Also eliminate the latent bug of the check in DstNone handling not
considering the opcode extension set.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c