Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e8df6da authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Martin Schwidefsky
Browse files

s390/smp: kasan stack instrumentation support



smp_start_secondary function is called without DAT enabled. To avoid
disabling kasan instrumentation for entire arch/s390/kernel/smp.c
smp_start_secondary has been split in 2 parts. smp_start_secondary has
instrumentation disabled, it does minimal setup and enables DAT. Then
instrumentated __smp_start_secondary is called to do the rest.

__load_psw_mask function instrumentation has been disabled as well
to be able to call it from smp_start_secondary.

Reviewed-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent dde709d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ static inline void __load_psw(psw_t psw)
 * Set PSW mask to specified value, while leaving the
 * PSW addr pointing to the next instruction.
 */
static inline void __load_psw_mask(unsigned long mask)
static __no_sanitize_address_or_inline void __load_psw_mask(unsigned long mask)
{
	unsigned long addr;
	psw_t psw;
+3 −3
Original line number Diff line number Diff line
@@ -804,6 +804,8 @@ static void smp_init_secondary(void)
{
	int cpu = smp_processor_id();

	S390_lowcore.last_update_clock = get_tod_clock();
	restore_access_regs(S390_lowcore.access_regs_save_area);
	cpu_init();
	preempt_disable();
	init_cpu_timer();
@@ -823,14 +825,12 @@ static void smp_init_secondary(void)
/*
 *	Activate a secondary processor.
 */
static void smp_start_secondary(void *cpuvoid)
static void __no_sanitize_address smp_start_secondary(void *cpuvoid)
{
	S390_lowcore.last_update_clock = get_tod_clock();
	S390_lowcore.restart_stack = (unsigned long) restart_stack;
	S390_lowcore.restart_fn = (unsigned long) do_restart;
	S390_lowcore.restart_data = 0;
	S390_lowcore.restart_source = -1UL;
	restore_access_regs(S390_lowcore.access_regs_save_area);
	__ctl_load(S390_lowcore.cregs_save_area, 0, 15);
	__load_psw_mask(PSW_KERNEL_BITS | PSW_MASK_DAT);
	CALL_ON_STACK(smp_init_secondary, S390_lowcore.kernel_stack, 0);