Commit aca7f966 authored by Anthony Liguori's avatar Anthony Liguori Committed by Avi Kivity

KVM: x86 emulator: Add vmmcall/vmcall to x86_emulate (v3)

Add vmmcall/vmcall to x86_emulate.  Future patch will implement functionality
for these instructions.
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent dd430ca2
...@@ -1380,6 +1380,12 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -1380,6 +1380,12 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
u16 size; u16 size;
unsigned long address; unsigned long address;
case 0: /* vmcall */
if (modrm_mod != 3 || modrm_rm != 1)
goto cannot_emulate;
/* nop */
break;
case 2: /* lgdt */ case 2: /* lgdt */
rc = read_descriptor(ctxt, ops, src.ptr, rc = read_descriptor(ctxt, ops, src.ptr,
&size, &address, op_bytes); &size, &address, op_bytes);
...@@ -1387,12 +1393,17 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) ...@@ -1387,12 +1393,17 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
goto done; goto done;
realmode_lgdt(ctxt->vcpu, size, address); realmode_lgdt(ctxt->vcpu, size, address);
break; break;
case 3: /* lidt */ case 3: /* lidt/vmmcall */
if (modrm_mod == 3 && modrm_rm == 1) {
/* nop */
} else {
rc = read_descriptor(ctxt, ops, src.ptr, rc = read_descriptor(ctxt, ops, src.ptr,
&size, &address, op_bytes); &size, &address,
op_bytes);
if (rc) if (rc)
goto done; goto done;
realmode_lidt(ctxt->vcpu, size, address); realmode_lidt(ctxt->vcpu, size, address);
}
break; break;
case 4: /* smsw */ case 4: /* smsw */
if (modrm_mod != 3) if (modrm_mod != 3)
......
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