aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-04-28 12:15:32 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:35:32 -0400
commit338dbc9781eb5acd0b12809d95d4006135f29767 (patch)
treeceb9fc9b2eb7e52c9352f094436590c82852d71f /arch/x86/kvm/emulate.c
parent0f12244fe70e8a94a491f6cd7ed70a352ab6c26c (diff)
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>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 061f7d37c9f7..d5979ecc2521 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3151,9 +3151,14 @@ twobyte_insn:
3151 goto done; 3151 goto done;
3152 } 3152 }
3153 3153
3154 ops->set_dr(c->modrm_reg,c->regs[c->modrm_rm] & 3154 if (ops->set_dr(c->modrm_reg, c->regs[c->modrm_rm] &
3155 ((ctxt->mode == X86EMUL_MODE_PROT64) ? ~0ULL : ~0U), 3155 ((ctxt->mode == X86EMUL_MODE_PROT64) ?
3156 ctxt->vcpu); 3156 ~0ULL : ~0U), ctxt->vcpu) < 0) {
3157 /* #UD condition is already handled by the code above */
3158 kvm_inject_gp(ctxt->vcpu, 0);
3159 goto done;
3160 }
3161
3157 c->dst.type = OP_NONE; /* no writeback */ 3162 c->dst.type = OP_NONE; /* no writeback */
3158 break; 3163 break;
3159 case 0x30: 3164 case 0x30: