Commit ea79849d authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity

KVM: x86 emulator: Implement jmp far opcode ff/5

Implement jmp far opcode ff/5. It is used by multiboot loader.
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent e35b7b9c
...@@ -346,7 +346,8 @@ static u32 group_table[] = { ...@@ -346,7 +346,8 @@ static u32 group_table[] = {
[Group5*8] = [Group5*8] =
DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM,
SrcMem | ModRM | Stack, 0, SrcMem | ModRM | Stack, 0,
SrcMem | ModRM | Stack, 0, SrcMem | ModRM | Stack, 0, SrcMem | ModRM | Stack, SrcMem | ModRM | Src2Mem16 | ImplicitOps,
SrcMem | ModRM | Stack, 0,
[Group7*8] = [Group7*8] =
0, 0, ModRM | SrcMem | Priv, ModRM | SrcMem | Priv, 0, 0, ModRM | SrcMem | Priv, ModRM | SrcMem | Priv,
SrcNone | ModRM | DstMem | Mov, 0, SrcNone | ModRM | DstMem | Mov, 0,
...@@ -2322,6 +2323,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -2322,6 +2323,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
case 0xe9: /* jmp rel */ case 0xe9: /* jmp rel */
goto jmp; goto jmp;
case 0xea: /* jmp far */ case 0xea: /* jmp far */
jump_far:
if (kvm_load_segment_descriptor(ctxt->vcpu, c->src2.val, if (kvm_load_segment_descriptor(ctxt->vcpu, c->src2.val,
VCPU_SREG_CS)) VCPU_SREG_CS))
goto done; goto done;
...@@ -2397,11 +2399,16 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -2397,11 +2399,16 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
ctxt->eflags |= EFLG_DF; ctxt->eflags |= EFLG_DF;
c->dst.type = OP_NONE; /* Disable writeback. */ c->dst.type = OP_NONE; /* Disable writeback. */
break; break;
case 0xfe ... 0xff: /* Grp4/Grp5 */ case 0xfe: /* Grp4 */
grp45:
rc = emulate_grp45(ctxt, ops); rc = emulate_grp45(ctxt, ops);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
goto done; goto done;
break; break;
case 0xff: /* Grp5 */
if (c->modrm_reg == 5)
goto jump_far;
goto grp45;
} }
writeback: writeback:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment