diff options
author | Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net> | 2008-05-27 09:13:28 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-07-20 05:42:28 -0400 |
commit | 38d5bc6d50a4368be08b39b02efb9cbbe1dd60d0 (patch) | |
tree | 96298c26d72f0a34ea6a370ff8af896eaf504315 /arch | |
parent | 4257198ae2c36e030a0947fef661c8de973778be (diff) |
KVM: x86 emulator: Add support for mov r, sreg (0x8c) instruction
Add support for mov r, sreg (0x8c) instruction
Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
Signed-off-by: Laurent Vivier <laurent.vivier@bull.net>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/x86_emulate.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index b049b6bf9a71..2a9db4d90bac 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c | |||
@@ -138,7 +138,7 @@ static u16 opcode_table[256] = { | |||
138 | /* 0x88 - 0x8F */ | 138 | /* 0x88 - 0x8F */ |
139 | ByteOp | DstMem | SrcReg | ModRM | Mov, DstMem | SrcReg | ModRM | Mov, | 139 | ByteOp | DstMem | SrcReg | ModRM | Mov, DstMem | SrcReg | ModRM | Mov, |
140 | ByteOp | DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, | 140 | ByteOp | DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, |
141 | 0, ModRM | DstReg, | 141 | DstMem | SrcReg | ModRM | Mov, ModRM | DstReg, |
142 | DstReg | SrcMem | ModRM | Mov, Group | Group1A, | 142 | DstReg | SrcMem | ModRM | Mov, Group | Group1A, |
143 | /* 0x90 - 0x9F */ | 143 | /* 0x90 - 0x9F */ |
144 | 0, 0, 0, 0, 0, 0, 0, 0, | 144 | 0, 0, 0, 0, 0, 0, 0, 0, |
@@ -1518,6 +1518,19 @@ special_insn: | |||
1518 | break; | 1518 | break; |
1519 | case 0x88 ... 0x8b: /* mov */ | 1519 | case 0x88 ... 0x8b: /* mov */ |
1520 | goto mov; | 1520 | goto mov; |
1521 | case 0x8c: { /* mov r/m, sreg */ | ||
1522 | struct kvm_segment segreg; | ||
1523 | |||
1524 | if (c->modrm_reg <= 5) | ||
1525 | kvm_get_segment(ctxt->vcpu, &segreg, c->modrm_reg); | ||
1526 | else { | ||
1527 | printk(KERN_INFO "0x8c: Invalid segreg in modrm byte 0x%02x\n", | ||
1528 | c->modrm); | ||
1529 | goto cannot_emulate; | ||
1530 | } | ||
1531 | c->dst.val = segreg.selector; | ||
1532 | break; | ||
1533 | } | ||
1521 | case 0x8d: /* lea r16/r32, m */ | 1534 | case 0x8d: /* lea r16/r32, m */ |
1522 | c->dst.val = c->modrm_ea; | 1535 | c->dst.val = c->modrm_ea; |
1523 | break; | 1536 | break; |