]> git.karo-electronics.de Git - karo-tx-linux.git/commit
KVM: emulator: emulate SALC
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 9 May 2013 09:32:51 +0000 (11:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 May 2013 18:38:09 +0000 (11:38 -0700)
commitc2b4972016dcc9d883ce5333d97d9454d9ae24e1
tree892482b3d9713936d225822c2619c9c7757da22c
parente3ed61f1dcb250148b14c37d62918d6fe9e01070
KVM: emulator: emulate SALC

commit 326f578f7e1443bac2333712dd130a261ec15288 upstream.

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>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/emulate.c