]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Wrong operand size for far ret
authorNadav Amit <namit@cs.technion.ac.il>
Mon, 26 Jan 2015 07:32:22 +0000 (09:32 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Jan 2015 11:14:25 +0000 (12:14 +0100)
commite5a15e4f27aa9bd7663b82cb476eaf0792e651fb
tree35466fbdb5fac67987570583ae9b95ce19658e8b
parenta0a676577b1070325839e9cca3591c0529d3f288
KVM: x86: Wrong operand size for far ret

Indeed, Intel SDM specifically states that for the RET instruction "In 64-bit
mode, the default operation size of this instruction is the stack-address size,
i.e. 64 bits."

However, experiments show this is not the case. Here is for example objdump of
small 64-bit asm:

  4004f1: ca 14 00              lret   $0x14
  4004f4: 48 cb                 lretq
  4004f6: 48 ca 14 00           lretq  $0x14

Therefore, remove the Stack flag from far-ret instructions.

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