x86/paravirt: Switch iret pvops to ALTERNATIVE
[sfrench/cifs-2.6.git] / arch / x86 / kernel / paravirt.c
index a688edf35e31bdf06a2959c97419d9d42885861b..9b0f568b0200b2e7470b05ded4905f22d9325368 100644 (file)
@@ -86,25 +86,6 @@ u64 notrace _paravirt_ident_64(u64 x)
 {
        return x;
 }
-
-static unsigned paravirt_patch_jmp(void *insn_buff, const void *target,
-                                  unsigned long addr, unsigned len)
-{
-       struct branch *b = insn_buff;
-       unsigned long delta = (unsigned long)target - (addr+5);
-
-       if (len < 5) {
-#ifdef CONFIG_RETPOLINE
-               WARN_ONCE(1, "Failing to patch indirect JMP in %ps\n", (void *)addr);
-#endif
-               return len;     /* call too long for patch site */
-       }
-
-       b->opcode = 0xe9;       /* jmp */
-       b->delta = delta;
-
-       return 5;
-}
 #endif
 
 DEFINE_STATIC_KEY_TRUE(virt_spin_lock_key);
@@ -136,9 +117,6 @@ unsigned paravirt_patch_default(u8 type, void *insn_buff,
        else if (opfunc == _paravirt_ident_64)
                ret = paravirt_patch_ident_64(insn_buff, len);
 
-       else if (type == PARAVIRT_PATCH(cpu.iret))
-               /* If operation requires a jmp, then jmp */
-               ret = paravirt_patch_jmp(insn_buff, opfunc, addr, len);
 #endif
        else
                /* Otherwise call the function. */
@@ -313,8 +291,6 @@ struct paravirt_patch_template pv_ops = {
 
        .cpu.load_sp0           = native_load_sp0,
 
-       .cpu.iret               = native_iret,
-
 #ifdef CONFIG_X86_IOPL_IOPERM
        .cpu.invalidate_io_bitmap       = native_tss_invalidate_io_bitmap,
        .cpu.update_io_bitmap           = native_tss_update_io_bitmap,
@@ -419,6 +395,8 @@ struct paravirt_patch_template pv_ops = {
 NOKPROBE_SYMBOL(native_get_debugreg);
 NOKPROBE_SYMBOL(native_set_debugreg);
 NOKPROBE_SYMBOL(native_load_idt);
+
+void (*paravirt_iret)(void) = native_iret;
 #endif
 
 EXPORT_SYMBOL(pv_ops);