Commit 98587c2d authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

s390: simplify disabled_wait



The disabled_wait() function uses its argument as the PSW address when
it stops the CPU with a wait PSW that is disabled for interrupts.
The different callers sometimes use a specific number like 0xdeadbeef
to indicate a specific failure, the early boot code uses 0 and some
other calls sites use __builtin_return_address(0).

At the time a dump is created the current PSW and the registers of a
CPU are written to lowcore to make them avaiable to the dump analysis
tool. For a CPU stopped with disabled_wait the PSW and the registers
do not really make sense together, the PSW address does not point to
the function the registers belong to.

Simplify disabled_wait() by using _THIS_IP_ for the PSW address and
drop the argument to the function.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent ec7bf478
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ static void facility_mismatch(void)
	print_machine_type();
	print_missing_facilities();
	sclp_early_printk("See Principles of Operations for facility bits\n");
	disabled_wait(0x8badcccc);
	disabled_wait();
}

void verify_facilities(void)
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ void error(char *x)
	sclp_early_printk(x);
	sclp_early_printk("\n\n -- System halted");

	disabled_wait(0xdeadbeef);
	disabled_wait();
}

#ifdef CONFIG_KERNEL_UNCOMPRESSED
+2 −2
Original line number Diff line number Diff line
@@ -315,12 +315,12 @@ void enabled_wait(void);
/*
 * Function to drop a processor into disabled wait state
 */
static inline void __noreturn disabled_wait(unsigned long code)
static inline void __noreturn disabled_wait(void)
{
	psw_t psw;

	psw.mask = PSW_MASK_BASE | PSW_MASK_WAIT | PSW_MASK_BA | PSW_MASK_EA;
	psw.addr = code;
	psw.addr = _THIS_IP_;
	__load_psw(psw);
	while (1);
}
+2 −2
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ static void early_pgm_check_handler(void)
	addr = S390_lowcore.program_old_psw.addr;
	fixup = s390_search_extables(addr);
	if (!fixup)
		disabled_wait(0);
		disabled_wait();
	/* Disable low address protection before storing into lowcore. */
	__ctl_store(cr0, 0, 0);
	cr0_new = cr0 & ~(1UL << 28);
@@ -298,7 +298,7 @@ static void __init check_image_bootable(void)
	sclp_early_printk("Linux kernel boot failure: An attempt to boot a vmlinux ELF image failed.\n");
	sclp_early_printk("This image does not contain all parts necessary for starting up. Use\n");
	sclp_early_printk("bzImage or arch/s390/boot/compressed/vmlinux instead.\n");
	disabled_wait(0xbadb007);
	disabled_wait();
}

void __init startup_init(void)
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ static void __init reset_tod_clock(void)
		return;
	/* TOD clock not running. Set the clock to Unix Epoch. */
	if (set_tod_clock(TOD_UNIX_EPOCH) != 0 || store_tod_clock(&time) != 0)
		disabled_wait(0);
		disabled_wait();

	memset(tod_clock_base, 0, 16);
	*(__u64 *) &tod_clock_base[1] = TOD_UNIX_EPOCH;
Loading