aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-02-25 09:36:43 -0500
committerAvi Kivity <avi@redhat.com>2010-04-25 06:53:45 -0400
commitea79849d4c8461034b75acb19c8041b6fddee2a5 (patch)
tree8f8e6845cea5669e4fd4eefa6016b6f6fe0dc7a8 /arch/x86/kvm/emulate.c
parente35b7b9c9e7d8768ee34e5904fed4cb0f2c2cb5d (diff)
KVM: x86 emulator: Implement jmp far opcode ff/5
Implement jmp far opcode ff/5. It is used by multiboot loader. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 97a740368b30..5b6794adaa2e 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -346,7 +346,8 @@ static u32 group_table[] = {
346 [Group5*8] = 346 [Group5*8] =
347 DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM, 347 DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM,
348 SrcMem | ModRM | Stack, 0, 348 SrcMem | ModRM | Stack, 0,
349 SrcMem | ModRM | Stack, 0, SrcMem | ModRM | Stack, 0, 349 SrcMem | ModRM | Stack, SrcMem | ModRM | Src2Mem16 | ImplicitOps,
350 SrcMem | ModRM | Stack, 0,
350 [Group7*8] = 351 [Group7*8] =
351 0, 0, ModRM | SrcMem | Priv, ModRM | SrcMem | Priv, 352 0, 0, ModRM | SrcMem | Priv, ModRM | SrcMem | Priv,
352 SrcNone | ModRM | DstMem | Mov, 0, 353 SrcNone | ModRM | DstMem | Mov, 0,
@@ -2322,6 +2323,7 @@ special_insn:
2322 case 0xe9: /* jmp rel */ 2323 case 0xe9: /* jmp rel */
2323 goto jmp; 2324 goto jmp;
2324 case 0xea: /* jmp far */ 2325 case 0xea: /* jmp far */
2326 jump_far:
2325 if (kvm_load_segment_descriptor(ctxt->vcpu, c->src2.val, 2327 if (kvm_load_segment_descriptor(ctxt->vcpu, c->src2.val,
2326 VCPU_SREG_CS)) 2328 VCPU_SREG_CS))
2327 goto done; 2329 goto done;
@@ -2397,11 +2399,16 @@ special_insn:
2397 ctxt->eflags |= EFLG_DF; 2399 ctxt->eflags |= EFLG_DF;
2398 c->dst.type = OP_NONE; /* Disable writeback. */ 2400 c->dst.type = OP_NONE; /* Disable writeback. */
2399 break; 2401 break;
2400 case 0xfe ... 0xff: /* Grp4/Grp5 */ 2402 case 0xfe: /* Grp4 */
2403 grp45:
2401 rc = emulate_grp45(ctxt, ops); 2404 rc = emulate_grp45(ctxt, ops);
2402 if (rc != X86EMUL_CONTINUE) 2405 if (rc != X86EMUL_CONTINUE)
2403 goto done; 2406 goto done;
2404 break; 2407 break;
2408 case 0xff: /* Grp5 */
2409 if (c->modrm_reg == 5)
2410 goto jump_far;
2411 goto grp45;
2405 } 2412 }
2406 2413
2407writeback: 2414writeback: