Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[platform/kernel/linux-rpi.git] / arch / x86 / kvm / emulate.c
index 166a145..5719d8c 100644 (file)
@@ -317,7 +317,7 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
        __FOP_FUNC(#name)
 
 #define __FOP_RET(name) \
-       "ret \n\t" \
+       "11: " ASM_RET \
        ".size " name ", .-" name "\n\t"
 
 #define FOP_RET(name) \
@@ -346,7 +346,7 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
        __FOP_RET(#op "_" #dst)
 
 #define FOP1EEX(op,  dst) \
-       FOP1E(op, dst) _ASM_EXTABLE(10b, kvm_fastop_exception)
+       FOP1E(op, dst) _ASM_EXTABLE_TYPE_REG(10b, 11b, EX_TYPE_ZERO_REG, %%esi)
 
 #define FASTOP1(op) \
        FOP_START(op) \
@@ -436,10 +436,6 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
        #op " %al \n\t" \
        __FOP_RET(#op)
 
-asm(".pushsection .fixup, \"ax\"\n"
-    "kvm_fastop_exception: xor %esi, %esi; ret\n"
-    ".popsection");
-
 FOP_START(setcc)
 FOP_SETCC(seto)
 FOP_SETCC(setno)
@@ -475,12 +471,8 @@ FOP_END;
  \
        asm volatile("1:" insn "\n" \
                     "2:\n" \
-                    ".pushsection .fixup, \"ax\"\n" \
-                    "3: movl $1, %[_fault]\n" \
-                    "   jmp  2b\n" \
-                    ".popsection\n" \
-                    _ASM_EXTABLE(1b, 3b) \
-                    : [_fault] "+qm"(_fault) inoutclob ); \
+                    _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_ONE_REG, %[_fault]) \
+                    : [_fault] "+r"(_fault) inoutclob ); \
  \
        _fault ? X86EMUL_UNHANDLEABLE : X86EMUL_CONTINUE; \
 })