KVM: emulator: emulate SALC
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 9 May 2013 09:32:51 +0000 (11:32 +0200)
committerGleb Natapov <gleb@redhat.com>
Thu, 9 May 2013 10:15:08 +0000 (13:15 +0300)
commit326f578f7e1443bac2333712dd130a261ec15288
tree7d1e6123f831b6789f68d4e9ea0f7f10a904230b
parent7fa57952d70f5737513d8319395e471d107e4e0d
KVM: emulator: emulate SALC

This is an almost-undocumented instruction available in 32-bit mode.
I say "almost" undocumented because AMD documents it in their opcode
maps just to say that it is unavailable in 64-bit mode (sections
"A.2.1 One-Byte Opcodes" and "B.3 Invalid and Reassigned Instructions
in 64-Bit Mode").

It is roughly equivalent to "sbb %al, %al" except it does not
set the flags.  Use fastop to emulate it, but do not use the opcode
directly because it would fail if the host is 64-bit!

Reported-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: stable@vger.kernel.org # 3.9
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
arch/x86/kvm/emulate.c