aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2007-09-17 15:57:49 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:52:46 -0500
commitaca7f96600b170e470b3056aba0ed8d7df8d330d (patch)
treebab4af6e6a0d013dbc74d1b772d55da287192d59
parentdd430ca20c40ecccd6954a7efd13d4398f507728 (diff)
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: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--drivers/kvm/x86_emulate.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index bd46de6bf891..84af9cc737fa 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -1380,6 +1380,12 @@ twobyte_insn:
1380 u16 size; 1380 u16 size;
1381 unsigned long address; 1381 unsigned long address;
1382 1382
1383 case 0: /* vmcall */
1384 if (modrm_mod != 3 || modrm_rm != 1)
1385 goto cannot_emulate;
1386
1387 /* nop */
1388 break;
1383 case 2: /* lgdt */ 1389 case 2: /* lgdt */
1384 rc = read_descriptor(ctxt, ops, src.ptr, 1390 rc = read_descriptor(ctxt, ops, src.ptr,
1385 &size, &address, op_bytes); 1391 &size, &address, op_bytes);
@@ -1387,12 +1393,17 @@ twobyte_insn:
1387 goto done; 1393 goto done;
1388 realmode_lgdt(ctxt->vcpu, size, address); 1394 realmode_lgdt(ctxt->vcpu, size, address);
1389 break; 1395 break;
1390 case 3: /* lidt */ 1396 case 3: /* lidt/vmmcall */
1391 rc = read_descriptor(ctxt, ops, src.ptr, 1397 if (modrm_mod == 3 && modrm_rm == 1) {
1392 &size, &address, op_bytes); 1398 /* nop */
1393 if (rc) 1399 } else {
1394 goto done; 1400 rc = read_descriptor(ctxt, ops, src.ptr,
1395 realmode_lidt(ctxt->vcpu, size, address); 1401 &size, &address,
1402 op_bytes);
1403 if (rc)
1404 goto done;
1405 realmode_lidt(ctxt->vcpu, size, address);
1406 }
1396 break; 1407 break;
1397 case 4: /* smsw */ 1408 case 4: /* smsw */
1398 if (modrm_mod != 3) 1409 if (modrm_mod != 3)