aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-03-18 09:20:09 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:16:03 -0400
commitab8557b2b361c8bb2e2421c791c8f6c4f6ba3d08 (patch)
treeb43df99f13219901306c227a4c61c99a67c4afbf /arch/x86/kvm
parent6e1e5ffee8d95f9bce71eaa029cb5247b0f2f673 (diff)
KVM: x86 emulator: 0f (20|21|22|23) ignore mod bits.
Resent spec says that for 0f (20|21|22|23) the 2 bits in the mod field are ignored. Interestingly enough older spec says that 11 is only valid encoding. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/emulate.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 7c7debb424d..fa4604e0325 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2520,28 +2520,20 @@ twobyte_insn:
2520 c->dst.type = OP_NONE; 2520 c->dst.type = OP_NONE;
2521 break; 2521 break;
2522 case 0x20: /* mov cr, reg */ 2522 case 0x20: /* mov cr, reg */
2523 if (c->modrm_mod != 3)
2524 goto cannot_emulate;
2525 c->regs[c->modrm_rm] = ops->get_cr(c->modrm_reg, ctxt->vcpu); 2523 c->regs[c->modrm_rm] = ops->get_cr(c->modrm_reg, ctxt->vcpu);
2526 c->dst.type = OP_NONE; /* no writeback */ 2524 c->dst.type = OP_NONE; /* no writeback */
2527 break; 2525 break;
2528 case 0x21: /* mov from dr to reg */ 2526 case 0x21: /* mov from dr to reg */
2529 if (c->modrm_mod != 3)
2530 goto cannot_emulate;
2531 if (emulator_get_dr(ctxt, c->modrm_reg, &c->regs[c->modrm_rm])) 2527 if (emulator_get_dr(ctxt, c->modrm_reg, &c->regs[c->modrm_rm]))
2532 goto cannot_emulate; 2528 goto cannot_emulate;
2533 rc = X86EMUL_CONTINUE; 2529 rc = X86EMUL_CONTINUE;
2534 c->dst.type = OP_NONE; /* no writeback */ 2530 c->dst.type = OP_NONE; /* no writeback */
2535 break; 2531 break;
2536 case 0x22: /* mov reg, cr */ 2532 case 0x22: /* mov reg, cr */
2537 if (c->modrm_mod != 3)
2538 goto cannot_emulate;
2539 ops->set_cr(c->modrm_reg, c->modrm_val, ctxt->vcpu); 2533 ops->set_cr(c->modrm_reg, c->modrm_val, ctxt->vcpu);
2540 c->dst.type = OP_NONE; 2534 c->dst.type = OP_NONE;
2541 break; 2535 break;
2542 case 0x23: /* mov from reg to dr */ 2536 case 0x23: /* mov from reg to dr */
2543 if (c->modrm_mod != 3)
2544 goto cannot_emulate;
2545 if (emulator_set_dr(ctxt, c->modrm_reg, c->regs[c->modrm_rm])) 2537 if (emulator_set_dr(ctxt, c->modrm_reg, c->regs[c->modrm_rm]))
2546 goto cannot_emulate; 2538 goto cannot_emulate;
2547 rc = X86EMUL_CONTINUE; 2539 rc = X86EMUL_CONTINUE;