diff options
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index f56ec486393e..061f7d37c9f7 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2272,7 +2272,10 @@ static int load_state_from_tss32(struct x86_emulate_ctxt *ctxt, | |||
2272 | struct decode_cache *c = &ctxt->decode; | 2272 | struct decode_cache *c = &ctxt->decode; |
2273 | int ret; | 2273 | int ret; |
2274 | 2274 | ||
2275 | ops->set_cr(3, tss->cr3, ctxt->vcpu); | 2275 | if (ops->set_cr(3, tss->cr3, ctxt->vcpu)) { |
2276 | kvm_inject_gp(ctxt->vcpu, 0); | ||
2277 | return X86EMUL_PROPAGATE_FAULT; | ||
2278 | } | ||
2276 | c->eip = tss->eip; | 2279 | c->eip = tss->eip; |
2277 | ctxt->eflags = tss->eflags | 2; | 2280 | ctxt->eflags = tss->eflags | 2; |
2278 | c->regs[VCPU_REGS_RAX] = tss->eax; | 2281 | c->regs[VCPU_REGS_RAX] = tss->eax; |
@@ -3135,7 +3138,10 @@ twobyte_insn: | |||
3135 | c->dst.type = OP_NONE; /* no writeback */ | 3138 | c->dst.type = OP_NONE; /* no writeback */ |
3136 | break; | 3139 | break; |
3137 | case 0x22: /* mov reg, cr */ | 3140 | case 0x22: /* mov reg, cr */ |
3138 | ops->set_cr(c->modrm_reg, c->modrm_val, ctxt->vcpu); | 3141 | if (ops->set_cr(c->modrm_reg, c->modrm_val, ctxt->vcpu)) { |
3142 | kvm_inject_gp(ctxt->vcpu, 0); | ||
3143 | goto done; | ||
3144 | } | ||
3139 | c->dst.type = OP_NONE; | 3145 | c->dst.type = OP_NONE; |
3140 | break; | 3146 | break; |
3141 | case 0x23: /* mov from reg to dr */ | 3147 | case 0x23: /* mov from reg to dr */ |