]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
s390: simplify disabled_wait
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 30 Apr 2019 10:33:45 +0000 (12:33 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 2 May 2019 11:54:11 +0000 (13:54 +0200)
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: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/boot/als.c
arch/s390/boot/startup.c
arch/s390/include/asm/processor.h
arch/s390/kernel/early.c
arch/s390/kernel/early_nobss.c
arch/s390/kernel/ipl.c
arch/s390/kernel/machine_kexec.c
arch/s390/kernel/nmi.c
kernel/panic.c

index f902215e9cd9b60d4f8ee1fc4dd1f05707c9ea6c..ff6801d401c44f7f9f8e55e98d73561ada2ed22a 100644 (file)
@@ -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)
index 4401e992bda1e395818af82c79472a806ce7e1a9..7b0d05414618be9e992f96298b1b92b38fea898c 100644 (file)
@@ -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
index 9f2ff4a54aff18df9c8afd207cf3535b9ce768c6..b0fcbc37b637dfd0bc7d87eb3d07efdd7b97c7db 100644 (file)
@@ -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);
 }
index 33f704c16bd333376df5609694188816c2fbff63..629f173f60cd9dd72b2f8955a2007e2f54eb528a 100644 (file)
@@ -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)
index 8d73f7fae16e00422fa4ea9eb54c39ad0901fa89..52a3ef959341a0be9f3f8f414ccfd6882a4eef4c 100644 (file)
@@ -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;
index aa8fe768640e44aa34791bc9f6cd14bd991b9bf3..d836af3ccc38208b99428430ec629186281be48d 100644 (file)
@@ -920,7 +920,7 @@ static void __reipl_run(void *unused)
        case IPL_TYPE_FCP_DUMP:
                break;
        }
-       disabled_wait((unsigned long) __builtin_return_address(0));
+       disabled_wait();
 }
 
 static void reipl_run(struct shutdown_trigger *trigger)
@@ -1375,7 +1375,7 @@ static void stop_run(struct shutdown_trigger *trigger)
 {
        if (strcmp(trigger->name, ON_PANIC_STR) == 0 ||
            strcmp(trigger->name, ON_RESTART_STR) == 0)
-               disabled_wait((unsigned long) __builtin_return_address(0));
+               disabled_wait();
        smp_stop_cpu();
 }
 
index 2f3a742a71a5de6bd77919d03db9862ef60fed8d..8a1ae140c5e2c420ef8ea1f53ab485d2edf1f86e 100644 (file)
@@ -96,7 +96,7 @@ static void __do_machine_kdump(void *image)
        start_kdump(1);
 
        /* Die if start_kdump returns */
-       disabled_wait((unsigned long) __builtin_return_address(0));
+       disabled_wait();
 }
 
 /*
@@ -284,7 +284,7 @@ static void __do_machine_kexec(void *data)
        (*data_mover)(&image->head, image->start);
 
        /* Die if kexec returns */
-       disabled_wait((unsigned long) __builtin_return_address(0));
+       disabled_wait();
 }
 
 /*
index 8c867b43c8ebc5b60469b52700ad6198daf1d874..0a487fae763eeab927bf5faa65e9ebdcf140e766 100644 (file)
@@ -125,7 +125,7 @@ void nmi_free_per_cpu(struct lowcore *lc)
 static notrace void s390_handle_damage(void)
 {
        smp_emergency_stop();
-       disabled_wait((unsigned long) __builtin_return_address(0));
+       disabled_wait();
        while (1);
 }
 NOKPROBE_SYMBOL(s390_handle_damage);
index 0ae0d7332f12a6b99683f9f807cea6bf755cb007..c1fcaad337b743d00d7a1abe27cb94506b04338e 100644 (file)
@@ -318,12 +318,7 @@ void panic(const char *fmt, ...)
        }
 #endif
 #if defined(CONFIG_S390)
-       {
-               unsigned long caller;
-
-               caller = (unsigned long)__builtin_return_address(0);
-               disabled_wait(caller);
-       }
+       disabled_wait();
 #endif
        pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf);
        local_irq_enable();