mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
KVM: x86 emulator: add CBW/CWDE/CDQE instruction emulation
Add CBW/CWDE/CDQE instruction emulation.(opcode 0x98) Used by FreeBSD's boot loader. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
0fa6ccbd28
commit
e8b6fa70e3
@ -2300,7 +2300,7 @@ static struct opcode opcode_table[256] = {
|
|||||||
/* 0x90 - 0x97 */
|
/* 0x90 - 0x97 */
|
||||||
X8(D(SrcAcc | DstReg)),
|
X8(D(SrcAcc | DstReg)),
|
||||||
/* 0x98 - 0x9F */
|
/* 0x98 - 0x9F */
|
||||||
N, N, D(SrcImmFAddr | No64), N,
|
D(DstAcc | SrcNone), N, D(SrcImmFAddr | No64), N,
|
||||||
D(ImplicitOps | Stack), D(ImplicitOps | Stack), N, N,
|
D(ImplicitOps | Stack), D(ImplicitOps | Stack), N, N,
|
||||||
/* 0xA0 - 0xA7 */
|
/* 0xA0 - 0xA7 */
|
||||||
D(ByteOp | DstAcc | SrcMem | Mov | MemAbs), D(DstAcc | SrcMem | Mov | MemAbs),
|
D(ByteOp | DstAcc | SrcMem | Mov | MemAbs), D(DstAcc | SrcMem | Mov | MemAbs),
|
||||||
@ -3003,6 +3003,13 @@ special_insn:
|
|||||||
if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX])
|
if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX])
|
||||||
break;
|
break;
|
||||||
goto xchg;
|
goto xchg;
|
||||||
|
case 0x98: /* cbw/cwde/cdqe */
|
||||||
|
switch (c->op_bytes) {
|
||||||
|
case 2: c->dst.val = (s8)c->dst.val; break;
|
||||||
|
case 4: c->dst.val = (s16)c->dst.val; break;
|
||||||
|
case 8: c->dst.val = (s32)c->dst.val; break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 0x9c: /* pushf */
|
case 0x9c: /* pushf */
|
||||||
c->src.val = (unsigned long) ctxt->eflags;
|
c->src.val = (unsigned long) ctxt->eflags;
|
||||||
emulate_push(ctxt, ops);
|
emulate_push(ctxt, ops);
|
||||||
|
Loading…
Reference in New Issue
Block a user