KVM: x86 emulator: make (get|set)_dr() callback return error if it fails
Make (get|set)_dr() callback return error if it fails instead of injecting exception behind emulator's back. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
@@ -3151,9 +3151,14 @@ twobyte_insn:
|
||||
goto done;
|
||||
}
|
||||
|
||||
ops->set_dr(c->modrm_reg,c->regs[c->modrm_rm] &
|
||||
((ctxt->mode == X86EMUL_MODE_PROT64) ? ~0ULL : ~0U),
|
||||
ctxt->vcpu);
|
||||
if (ops->set_dr(c->modrm_reg, c->regs[c->modrm_rm] &
|
||||
((ctxt->mode == X86EMUL_MODE_PROT64) ?
|
||||
~0ULL : ~0U), ctxt->vcpu) < 0) {
|
||||
/* #UD condition is already handled by the code above */
|
||||
kvm_inject_gp(ctxt->vcpu, 0);
|
||||
goto done;
|
||||
}
|
||||
|
||||
c->dst.type = OP_NONE; /* no writeback */
|
||||
break;
|
||||
case 0x30:
|
||||
|
Reference in New Issue
Block a user