Commit ace76fac authored by Heiko Carstens's avatar Heiko Carstens Committed by Vasily Gorbik

s390/alternatives: Move text sync functions

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: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Tested-by: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent c77f7354
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <linux/module.h> #include <linux/module.h>
#include <linux/cpu.h>
#include <linux/smp.h>
#include <asm/text-patching.h>
#include <asm/alternative.h> #include <asm/alternative.h>
#include <asm/facility.h> #include <asm/facility.h>
#include <asm/nospec-branch.h> #include <asm/nospec-branch.h>
...@@ -32,20 +29,3 @@ void __init apply_alternative_instructions(void) ...@@ -32,20 +29,3 @@ void __init apply_alternative_instructions(void)
{ {
apply_alternatives(__alt_instructions, __alt_instructions_end); 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();
}
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#include <linux/mm_types.h> #include <linux/mm_types.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/smp.h>
#include <asm/text-patching.h>
#include <asm/diag.h> #include <asm/diag.h>
#include <asm/facility.h> #include <asm/facility.h>
#include <asm/elf.h> #include <asm/elf.h>
...@@ -79,6 +80,23 @@ void notrace stop_machine_yield(const struct cpumask *cpumask) ...@@ -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. * cpu_init - initializes state that is per-CPU.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment