Merge branch 'linus' into x86/i8259
[sfrench/cifs-2.6.git] / arch / x86 / kvm / x86_emulate.c
index 2ca08386f9937ea43c4d126ca011af96c10abde9..932f216d890c343bc5ca4ebfd8a15e1955334969 100644 (file)
@@ -677,8 +677,9 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
        c->use_modrm_ea = 1;
 
        if (c->modrm_mod == 3) {
-               c->modrm_val = *(unsigned long *)
-                       decode_register(c->modrm_rm, c->regs, c->d & ByteOp);
+               c->modrm_ptr = decode_register(c->modrm_rm,
+                                              c->regs, c->d & ByteOp);
+               c->modrm_val = *(unsigned long *)c->modrm_ptr;
                return rc;
        }
 
@@ -1005,6 +1006,7 @@ done_prefixes:
                if ((c->d & ModRM) && c->modrm_mod == 3) {
                        c->src.type = OP_REG;
                        c->src.val = c->modrm_val;
+                       c->src.ptr = c->modrm_ptr;
                        break;
                }
                c->src.type = OP_MEM;
@@ -1049,6 +1051,7 @@ done_prefixes:
                if ((c->d & ModRM) && c->modrm_mod == 3) {
                        c->dst.type = OP_REG;
                        c->dst.val = c->dst.orig_val = c->modrm_val;
+                       c->dst.ptr = c->modrm_ptr;
                        break;
                }
                c->dst.type = OP_MEM;
@@ -1724,7 +1727,8 @@ twobyte_insn:
                        if (rc)
                                goto done;
 
-                       kvm_emulate_hypercall(ctxt->vcpu);
+                       /* Let the processor re-execute the fixed hypercall */
+                       c->eip = ctxt->vcpu->arch.rip;
                        /* Disable writeback. */
                        c->dst.type = OP_NONE;
                        break;
@@ -1761,6 +1765,7 @@ twobyte_insn:
                case 6: /* lmsw */
                        realmode_lmsw(ctxt->vcpu, (u16)c->src.val,
                                      &ctxt->eflags);
+                       c->dst.type = OP_NONE;
                        break;
                case 7: /* invlpg*/
                        emulate_invlpg(ctxt->vcpu, memop);