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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 8db0010ed150..5953dcea752d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -1240,9 +1240,12 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
1240 ctxt->modrm_seg = VCPU_SREG_DS; 1240 ctxt->modrm_seg = VCPU_SREG_DS;
1241 1241
1242 if (ctxt->modrm_mod == 3) { 1242 if (ctxt->modrm_mod == 3) {
1243 int highbyte_regs = ctxt->rex_prefix == 0;
1244
1243 op->type = OP_REG; 1245 op->type = OP_REG;
1244 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes; 1246 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes;
1245 op->addr.reg = decode_register(ctxt, ctxt->modrm_rm, ctxt->d & ByteOp); 1247 op->addr.reg = decode_register(ctxt, ctxt->modrm_rm,
1248 highbyte_regs && (ctxt->d & ByteOp));
1246 if (ctxt->d & Sse) { 1249 if (ctxt->d & Sse) {
1247 op->type = OP_XMM; 1250 op->type = OP_XMM;
1248 op->bytes = 16; 1251 op->bytes = 16;
@@ -3997,7 +4000,8 @@ static const struct opcode twobyte_table[256] = {
3997 DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, 4000 DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N,
3998 N, D(ImplicitOps | ModRM), N, N, 4001 N, D(ImplicitOps | ModRM), N, N,
3999 /* 0x10 - 0x1F */ 4002 /* 0x10 - 0x1F */
4000 N, N, N, N, N, N, N, N, D(ImplicitOps | ModRM), N, N, N, N, N, N, N, 4003 N, N, N, N, N, N, N, N,
4004 D(ImplicitOps | ModRM), N, N, N, N, N, N, D(ImplicitOps | ModRM),
4001 /* 0x20 - 0x2F */ 4005 /* 0x20 - 0x2F */
4002 DIP(ModRM | DstMem | Priv | Op3264, cr_read, check_cr_read), 4006 DIP(ModRM | DstMem | Priv | Op3264, cr_read, check_cr_read),
4003 DIP(ModRM | DstMem | Priv | Op3264, dr_read, check_dr_read), 4007 DIP(ModRM | DstMem | Priv | Op3264, dr_read, check_dr_read),
@@ -4836,6 +4840,7 @@ twobyte_insn:
4836 case 0x08: /* invd */ 4840 case 0x08: /* invd */
4837 case 0x0d: /* GrpP (prefetch) */ 4841 case 0x0d: /* GrpP (prefetch) */
4838 case 0x18: /* Grp16 (prefetch/nop) */ 4842 case 0x18: /* Grp16 (prefetch/nop) */
4843 case 0x1f: /* nop */
4839 break; 4844 break;
4840 case 0x20: /* mov cr, reg */ 4845 case 0x20: /* mov cr, reg */
4841 ctxt->dst.val = ops->get_cr(ctxt, ctxt->modrm_reg); 4846 ctxt->dst.val = ops->get_cr(ctxt, ctxt->modrm_reg);