aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorNadav Amit <namit@cs.technion.ac.il>2014-06-02 11:34:10 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-06-18 11:46:19 -0400
commitaaa05f2437b9450f30b301db962ec4d45ec90fbb (patch)
tree09849d5e0fac980d03aa65c5db44a9ce73056696 /arch
parent67f4d4288c353734d29c45f6725971c71af96791 (diff)
KVM: x86: Return error on cmpxchg16b emulation
cmpxchg16b is currently unimplemented in the emulator. The least we can do is return error upon the emulation of this instruction. Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/emulate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 3da8d82acb31..a151f8d24a1d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1999,6 +1999,9 @@ static int em_cmpxchg8b(struct x86_emulate_ctxt *ctxt)
1999{ 1999{
2000 u64 old = ctxt->dst.orig_val64; 2000 u64 old = ctxt->dst.orig_val64;
2001 2001
2002 if (ctxt->dst.bytes == 16)
2003 return X86EMUL_UNHANDLEABLE;
2004
2002 if (((u32) (old >> 0) != (u32) reg_read(ctxt, VCPU_REGS_RAX)) || 2005 if (((u32) (old >> 0) != (u32) reg_read(ctxt, VCPU_REGS_RAX)) ||
2003 ((u32) (old >> 32) != (u32) reg_read(ctxt, VCPU_REGS_RDX))) { 2006 ((u32) (old >> 32) != (u32) reg_read(ctxt, VCPU_REGS_RDX))) {
2004 *reg_write(ctxt, VCPU_REGS_RAX) = (u32) (old >> 0); 2007 *reg_write(ctxt, VCPU_REGS_RAX) = (u32) (old >> 0);
@@ -4077,7 +4080,7 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
4077 op->orig_val = op->val; 4080 op->orig_val = op->val;
4078 break; 4081 break;
4079 case OpMem64: 4082 case OpMem64:
4080 ctxt->memop.bytes = 8; 4083 ctxt->memop.bytes = (ctxt->op_bytes == 8) ? 16 : 8;
4081 goto mem_common; 4084 goto mem_common;
4082 case OpAcc: 4085 case OpAcc:
4083 op->type = OP_REG; 4086 op->type = OP_REG;