aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index d554d96afbca..541801527225 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -130,7 +130,7 @@
130#define Mov (1<<20) 130#define Mov (1<<20)
131/* Misc flags */ 131/* Misc flags */
132#define Prot (1<<21) /* instruction generates #UD if not in prot-mode */ 132#define Prot (1<<21) /* instruction generates #UD if not in prot-mode */
133#define VendorSpecific (1<<22) /* Vendor specific instruction */ 133#define EmulateOnUD (1<<22) /* Emulate if unsupported by the host */
134#define NoAccess (1<<23) /* Don't access memory (lea/invlpg/verr etc) */ 134#define NoAccess (1<<23) /* Don't access memory (lea/invlpg/verr etc) */
135#define Op3264 (1<<24) /* Operand is 64b in long mode, 32b otherwise */ 135#define Op3264 (1<<24) /* Operand is 64b in long mode, 32b otherwise */
136#define Undefined (1<<25) /* No Such Instruction */ 136#define Undefined (1<<25) /* No Such Instruction */
@@ -3502,7 +3502,7 @@ static const struct opcode group7_rm1[] = {
3502 3502
3503static const struct opcode group7_rm3[] = { 3503static const struct opcode group7_rm3[] = {
3504 DIP(SrcNone | Prot | Priv, vmrun, check_svme_pa), 3504 DIP(SrcNone | Prot | Priv, vmrun, check_svme_pa),
3505 II(SrcNone | Prot | VendorSpecific, em_vmmcall, vmmcall), 3505 II(SrcNone | Prot | EmulateOnUD, em_vmmcall, vmmcall),
3506 DIP(SrcNone | Prot | Priv, vmload, check_svme_pa), 3506 DIP(SrcNone | Prot | Priv, vmload, check_svme_pa),
3507 DIP(SrcNone | Prot | Priv, vmsave, check_svme_pa), 3507 DIP(SrcNone | Prot | Priv, vmsave, check_svme_pa),
3508 DIP(SrcNone | Prot | Priv, stgi, check_svme), 3508 DIP(SrcNone | Prot | Priv, stgi, check_svme),
@@ -3587,7 +3587,7 @@ static const struct group_dual group7 = { {
3587 II(SrcMem16 | Mov | Priv, em_lmsw, lmsw), 3587 II(SrcMem16 | Mov | Priv, em_lmsw, lmsw),
3588 II(SrcMem | ByteOp | Priv | NoAccess, em_invlpg, invlpg), 3588 II(SrcMem | ByteOp | Priv | NoAccess, em_invlpg, invlpg),
3589}, { 3589}, {
3590 I(SrcNone | Priv | VendorSpecific, em_vmcall), 3590 I(SrcNone | Priv | EmulateOnUD, em_vmcall),
3591 EXT(0, group7_rm1), 3591 EXT(0, group7_rm1),
3592 N, EXT(0, group7_rm3), 3592 N, EXT(0, group7_rm3),
3593 II(SrcNone | DstMem | Mov, em_smsw, smsw), N, 3593 II(SrcNone | DstMem | Mov, em_smsw, smsw), N,
@@ -3810,7 +3810,7 @@ static const struct opcode opcode_table[256] = {
3810static const struct opcode twobyte_table[256] = { 3810static const struct opcode twobyte_table[256] = {
3811 /* 0x00 - 0x0F */ 3811 /* 0x00 - 0x0F */
3812 G(0, group6), GD(0, &group7), N, N, 3812 G(0, group6), GD(0, &group7), N, N,
3813 N, I(ImplicitOps | VendorSpecific, em_syscall), 3813 N, I(ImplicitOps | EmulateOnUD, em_syscall),
3814 II(ImplicitOps | Priv, em_clts, clts), N, 3814 II(ImplicitOps | Priv, em_clts, clts), N,
3815 DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, 3815 DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N,
3816 N, D(ImplicitOps | ModRM), N, N, 3816 N, D(ImplicitOps | ModRM), N, N,
@@ -3830,8 +3830,8 @@ static const struct opcode twobyte_table[256] = {
3830 IIP(ImplicitOps, em_rdtsc, rdtsc, check_rdtsc), 3830 IIP(ImplicitOps, em_rdtsc, rdtsc, check_rdtsc),
3831 II(ImplicitOps | Priv, em_rdmsr, rdmsr), 3831 II(ImplicitOps | Priv, em_rdmsr, rdmsr),
3832 IIP(ImplicitOps, em_rdpmc, rdpmc, check_rdpmc), 3832 IIP(ImplicitOps, em_rdpmc, rdpmc, check_rdpmc),
3833 I(ImplicitOps | VendorSpecific, em_sysenter), 3833 I(ImplicitOps | EmulateOnUD, em_sysenter),
3834 I(ImplicitOps | Priv | VendorSpecific, em_sysexit), 3834 I(ImplicitOps | Priv | EmulateOnUD, em_sysexit),
3835 N, N, 3835 N, N,
3836 N, N, N, N, N, N, N, N, 3836 N, N, N, N, N, N, N, N,
3837 /* 0x40 - 0x4F */ 3837 /* 0x40 - 0x4F */
@@ -4268,7 +4268,7 @@ done_prefixes:
4268 if (ctxt->d == 0 || (ctxt->d & NotImpl)) 4268 if (ctxt->d == 0 || (ctxt->d & NotImpl))
4269 return EMULATION_FAILED; 4269 return EMULATION_FAILED;
4270 4270
4271 if (!(ctxt->d & VendorSpecific) && ctxt->only_vendor_specific_insn) 4271 if (!(ctxt->d & EmulateOnUD) && ctxt->ud)
4272 return EMULATION_FAILED; 4272 return EMULATION_FAILED;
4273 4273
4274 if (mode == X86EMUL_MODE_PROT64 && (ctxt->d & Stack)) 4274 if (mode == X86EMUL_MODE_PROT64 && (ctxt->d & Stack))