aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2010-08-16 21:19:34 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:06 -0400
commit92f738a52b53dc13b5dd5753634bdb8c59ac9815 (patch)
tree792860967186aedc0d94e0c5198e49628960bb84 /arch/x86/kvm/emulate.c
parent31be40b3985f09c0c89b9e28a8206df32adba842 (diff)
KVM: x86 emulator: add XADD instruction emulation
Add XADD instruction emulation (opcode 0x0f 0xc0~0xc1) Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 003713041ce6..0c08bffe6cb4 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2385,7 +2385,8 @@ static struct opcode twobyte_table[256] = {
2385 D(DstReg | SrcMem | ModRM), D(DstReg | SrcMem | ModRM), 2385 D(DstReg | SrcMem | ModRM), D(DstReg | SrcMem | ModRM),
2386 D(ByteOp | DstReg | SrcMem | ModRM | Mov), D(DstReg | SrcMem16 | ModRM | Mov), 2386 D(ByteOp | DstReg | SrcMem | ModRM | Mov), D(DstReg | SrcMem16 | ModRM | Mov),
2387 /* 0xC0 - 0xCF */ 2387 /* 0xC0 - 0xCF */
2388 N, N, N, D(DstMem | SrcReg | ModRM | Mov), 2388 D(ByteOp | DstMem | SrcReg | ModRM | Lock), D(DstMem | SrcReg | ModRM | Lock),
2389 N, D(DstMem | SrcReg | ModRM | Mov),
2389 N, N, N, GD(0, &group9), 2390 N, N, N, GD(0, &group9),
2390 N, N, N, N, N, N, N, N, 2391 N, N, N, N, N, N, N, N,
2391 /* 0xD0 - 0xDF */ 2392 /* 0xD0 - 0xDF */
@@ -3531,6 +3532,12 @@ twobyte_insn:
3531 c->dst.val = (c->d & ByteOp) ? (s8) c->src.val : 3532 c->dst.val = (c->d & ByteOp) ? (s8) c->src.val :
3532 (s16) c->src.val; 3533 (s16) c->src.val;
3533 break; 3534 break;
3535 case 0xc0 ... 0xc1: /* xadd */
3536 emulate_2op_SrcV("add", c->src, c->dst, ctxt->eflags);
3537 /* Write back the register source. */
3538 c->src.val = c->dst.orig_val;
3539 write_register_operand(&c->src);
3540 break;
3534 case 0xc3: /* movnti */ 3541 case 0xc3: /* movnti */
3535 c->dst.bytes = c->op_bytes; 3542 c->dst.bytes = c->op_bytes;
3536 c->dst.val = (c->op_bytes == 4) ? (u32) c->src.val : 3543 c->dst.val = (c->op_bytes == 4) ? (u32) c->src.val :