diff options
-rw-r--r-- | drivers/kvm/x86_emulate.c | 23 |
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) |