diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2015-01-26 02:32:22 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-01-26 06:14:25 -0500 |
commit | 16794aaaab66fa74ab19588a8e255a460e8b3ace (patch) | |
tree | 35466fbdb5fac67987570583ae9b95ce19658e8b /arch/x86 | |
parent | 2fcf5c8ae244b4c298d2111a288d410a719ac626 (diff) |
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/emulate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index aa272545402e..dd7100481aac 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -4062,8 +4062,8 @@ static const struct opcode opcode_table[256] = { | |||
4062 | G(ByteOp, group11), G(0, group11), | 4062 | G(ByteOp, group11), G(0, group11), |
4063 | /* 0xC8 - 0xCF */ | 4063 | /* 0xC8 - 0xCF */ |
4064 | I(Stack | SrcImmU16 | Src2ImmByte, em_enter), I(Stack, em_leave), | 4064 | I(Stack | SrcImmU16 | Src2ImmByte, em_enter), I(Stack, em_leave), |
4065 | I(ImplicitOps | Stack | SrcImmU16, em_ret_far_imm), | 4065 | I(ImplicitOps | SrcImmU16, em_ret_far_imm), |
4066 | I(ImplicitOps | Stack, em_ret_far), | 4066 | I(ImplicitOps, em_ret_far), |
4067 | D(ImplicitOps), DI(SrcImmByte, intn), | 4067 | D(ImplicitOps), DI(SrcImmByte, intn), |
4068 | D(ImplicitOps | No64), II(ImplicitOps, em_iret, iret), | 4068 | D(ImplicitOps | No64), II(ImplicitOps, em_iret, iret), |
4069 | /* 0xD0 - 0xD7 */ | 4069 | /* 0xD0 - 0xD7 */ |