@@ -1980,7 +1980,6 @@ special_insn:
case 0x8e: { /* mov seg, r/m16 */
uint16_t sel;
int type_bits;
- int err;
sel = c->src.val;
if (c->modrm_reg == VCPU_SREG_SS)
@@ -1988,16 +1987,16 @@ special_insn:
if (c->modrm_reg <= 5) {
type_bits = (c->modrm_reg == 1) ? 9 : 1;
- err = kvm_load_segment_descriptor(ctxt->vcpu, sel,
- type_bits, c->modrm_reg);
+ rc = kvm_load_segment_descriptor(ctxt->vcpu, sel,
+ type_bits, c->modrm_reg);
} else {
printk(KERN_INFO "Invalid segreg in modrm byte 0x%02x\n",
c->modrm);
goto cannot_emulate;
}
- if (err < 0)
- goto cannot_emulate;
+ if (rc != X86EMUL_CONTINUE)
+ goto done;
c->dst.type = OP_NONE; /* Disable writeback. */
break;
@@ -2168,11 +2167,10 @@ special_insn:
case 0xe9: /* jmp rel */
goto jmp;
case 0xea: /* jmp far */
- if (kvm_load_segment_descriptor(ctxt->vcpu, c->src2.val, 9,
- VCPU_SREG_CS) < 0) {
- DPRINTF("jmp far: Failed to load CS descriptor\n");
- goto cannot_emulate;
- }
+ rc = kvm_load_segment_descriptor(ctxt->vcpu, c->src2.val, 9,
+ VCPU_SREG_CS);
+ if (rc != X86EMUL_CONTINUE)
+ goto done;
c->eip = c->src.val;
break;