Merge tag 'v6.8-rc4' into x86/percpu, to resolve conflicts and refresh the branch
[linux-block.git] / arch / x86 / kernel / callthunks.c
index 2324c7f9a84131829ee01697041e8c0670174bf2..cf7e5be1b844b2316aab120b21e41b0831dac2b4 100644 (file)
@@ -50,11 +50,6 @@ EXPORT_SYMBOL_GPL(__x86_call_count);
 
 extern s32 __call_sites[], __call_sites_end[];
 
-struct thunk_desc {
-       void            *template;
-       unsigned int    template_size;
-};
-
 struct core_text {
        unsigned long   base;
        unsigned long   end;
@@ -245,14 +240,13 @@ patch_call_sites(s32 *start, s32 *end, const struct core_text *ct)
 }
 
 static __init_or_module void
-patch_paravirt_call_sites(struct paravirt_patch_site *start,
-                         struct paravirt_patch_site *end,
-                         const struct core_text *ct)
+patch_alt_call_sites(struct alt_instr *start, struct alt_instr *end,
+                    const struct core_text *ct)
 {
-       struct paravirt_patch_site *p;
+       struct alt_instr *a;
 
-       for (p = start; p < end; p++)
-               patch_call(p->instr, ct);
+       for (a = start; a < end; a++)
+               patch_call((void *)&a->instr_offset + a->instr_offset, ct);
 }
 
 static __init_or_module void
@@ -260,7 +254,7 @@ callthunks_setup(struct callthunk_sites *cs, const struct core_text *ct)
 {
        prdbg("Patching call sites %s\n", ct->name);
        patch_call_sites(cs->call_start, cs->call_end, ct);
-       patch_paravirt_call_sites(cs->pv_start, cs->pv_end, ct);
+       patch_alt_call_sites(cs->alt_start, cs->alt_end, ct);
        prdbg("Patching call sites done%s\n", ct->name);
 }
 
@@ -269,8 +263,8 @@ void __init callthunks_patch_builtin_calls(void)
        struct callthunk_sites cs = {
                .call_start     = __call_sites,
                .call_end       = __call_sites_end,
-               .pv_start       = __parainstructions,
-               .pv_end         = __parainstructions_end
+               .alt_start      = __alt_instructions,
+               .alt_end        = __alt_instructions_end
        };
 
        if (!cpu_feature_enabled(X86_FEATURE_CALL_DEPTH))
@@ -279,7 +273,6 @@ void __init callthunks_patch_builtin_calls(void)
        pr_info("Setting up call depth tracking\n");
        mutex_lock(&text_mutex);
        callthunks_setup(&cs, &builtin_coretext);
-       static_call_force_reinit();
        thunks_initialized = true;
        mutex_unlock(&text_mutex);
 }