s390/alternatives: Move text sync functions
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 16 Jul 2024 11:50:51 +0000 (13:50 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 23 Jul 2024 14:02:31 +0000 (16:02 +0200)
Move all text sync functions from alternative.c to processor.c. This
way there is only minimal code left in alternative.c left, which is a
prerequisite to use the C file within boot code as well.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Tested-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/alternative.c
arch/s390/kernel/processor.c

index e2b6549f8eafa779c587d559ee7e86c0bf2f7644..33debc2a26c919436240c9758787c41c515157ce 100644 (file)
@@ -1,8 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <linux/module.h>
-#include <linux/cpu.h>
-#include <linux/smp.h>
-#include <asm/text-patching.h>
 #include <asm/alternative.h>
 #include <asm/facility.h>
 #include <asm/nospec-branch.h>
@@ -32,20 +29,3 @@ void __init apply_alternative_instructions(void)
 {
        apply_alternatives(__alt_instructions, __alt_instructions_end);
 }
-
-static void do_sync_core(void *info)
-{
-       sync_core();
-}
-
-void text_poke_sync(void)
-{
-       on_each_cpu(do_sync_core, NULL, 1);
-}
-
-void text_poke_sync_lock(void)
-{
-       cpus_read_lock();
-       text_poke_sync();
-       cpus_read_unlock();
-}
index 65c1464eea4fcc210ca6ed65c7ce843d2ea28fe9..5ce9a795a0fe1b4f3d2afd03e1093b1642308a3a 100644 (file)
@@ -17,7 +17,8 @@
 #include <linux/mm_types.h>
 #include <linux/delay.h>
 #include <linux/cpu.h>
-
+#include <linux/smp.h>
+#include <asm/text-patching.h>
 #include <asm/diag.h>
 #include <asm/facility.h>
 #include <asm/elf.h>
@@ -79,6 +80,23 @@ void notrace stop_machine_yield(const struct cpumask *cpumask)
        }
 }
 
+static void do_sync_core(void *info)
+{
+       sync_core();
+}
+
+void text_poke_sync(void)
+{
+       on_each_cpu(do_sync_core, NULL, 1);
+}
+
+void text_poke_sync_lock(void)
+{
+       cpus_read_lock();
+       text_poke_sync();
+       cpus_read_unlock();
+}
+
 /*
  * cpu_init - initializes state that is per-CPU.
  */