KVM: x86 emulator: inject #UD on access to non-existing CR
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
@@ -2520,6 +2520,13 @@ twobyte_insn:
|
|||||||
c->dst.type = OP_NONE;
|
c->dst.type = OP_NONE;
|
||||||
break;
|
break;
|
||||||
case 0x20: /* mov cr, reg */
|
case 0x20: /* mov cr, reg */
|
||||||
|
switch (c->modrm_reg) {
|
||||||
|
case 1:
|
||||||
|
case 5 ... 7:
|
||||||
|
case 9 ... 15:
|
||||||
|
kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
c->regs[c->modrm_rm] = ops->get_cr(c->modrm_reg, ctxt->vcpu);
|
c->regs[c->modrm_rm] = ops->get_cr(c->modrm_reg, ctxt->vcpu);
|
||||||
c->dst.type = OP_NONE; /* no writeback */
|
c->dst.type = OP_NONE; /* no writeback */
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user