KVM: x86: POP [ESP] is not emulated correctly
authorNadav Amit <namit@cs.technion.ac.il>
Thu, 25 Dec 2014 00:52:21 +0000 (02:52 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 8 Jan 2015 21:48:07 +0000 (22:48 +0100)
commitab708099a0617e2c37b26d9ecbb373456057ba9b
treea11bd04a1019decdab48396f949a17e39a06e8b1
parent80976dbb5cb2b64480d7d38981b3220887575728
KVM: x86: POP [ESP] is not emulated correctly

According to Intel SDM: "If the ESP register is used as a base register for
addressing a destination operand in memory, the POP instruction computes the
effective address of the operand after it increments the ESP register."

The current emulation does not behave so. The fix required to waste another
of the precious instruction flags and to check the flag in decode_modrm.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c