]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[S390] kernel: Fix smp_switch_to_ipl_cpu() stack frame setup
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Tue, 27 Dec 2011 10:27:08 +0000 (11:27 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 27 Dec 2011 10:27:10 +0000 (11:27 +0100)
Currently, when smp_switch_to_ipl_cpu() is done, the backchain in the dump
analysis tool crash looks like the following:

 #0 [1f746e70] __machine_kexec at 11dd92
 #1 [1f746eb8] smp_restart_cpu at 11820e
 #0 [00907eb0] cpu_idle at 10602e
 #1 [00907ef8] start_kernel at 979a08

It would be good to see the registers of the interrupted function.
To achieve this, the backchain on the new stack has to be set to zero.
This looks then like the following:

 #0 [1f746e70] __machine_kexec at 11dd8e
 #1 [1f746eb8] smp_restart_cpu at 11820a
 PSW:  0706000180000000 00000000005c6fe6 (vtime_stop_cpu+134)
 GPRS: 0000000000000000 00000000005c6fe6 0000000001ad0228 0000000001ad0248
       0000000000907f08 0000000001ad0b40 0000000000979344 0000000000000000
       00000000009c0000 00000000009c0010 00000000009ab024 0000000001ad0200
       0000000001ad0238 00000000005cc9d8 000000000010602e 0000000000907e68
 #0 [00907eb0] cpu_idle at 10602e
 #1 [00907ef8] start_kernel at 979a08

In addition to this, now also the correct PSW is stored in the pt_regs
structure that is located at the start of the panic stack.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/smp.c

index ee327365e436dcee7ed2c1d55d7454a157d6c2de..14d5211a185d4615434d0961ca92f5c6cde0e93b 100644 (file)
@@ -149,10 +149,10 @@ void smp_switch_to_ipl_cpu(void (*func)(void *), void *data)
        sp -= sizeof(struct pt_regs);
        regs = (struct pt_regs *) sp;
        memcpy(&regs->gprs, &current_lc->gpregs_save_area, sizeof(regs->gprs));
-       regs->psw = lc->psw_save_area;
+       regs->psw = current_lc->psw_save_area;
        sp -= STACK_FRAME_OVERHEAD;
        sf = (struct stack_frame *) sp;
-       sf->back_chain = regs->gprs[15];
+       sf->back_chain = 0;
        smp_switch_to_cpu(func, data, sp, stap(), __cpu_logical_map[0]);
 }