Michael Holzheu | 15 Aug 2011 17:13
Picon

[PATCH] s390: Add restart stack support

Hi Dave,

With Linux 3.0.1 on s390 we have a new kernel stack for the PSW restart
interrupt. See kernel git commit 7dd6b3343fdc190712d1620ee8848d25c4c77c33
for details. With this patch the crash "bt" command will find this stack.

Signed-off-by: Michael Holzheu <holzheu <at> linux.vnet.ibm.com>
---
 s390x.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

--- a/s390x.c
+++ b/s390x.c
 <at>  <at>  -825,9 +825,16  <at>  <at>  static void get_int_stack(char *stack_na
 	unsigned long stack_addr;

 	*start = *end = 0;
-	if (!MEMBER_EXISTS("_lowcore", stack_name))
-		return;
-	stack_addr = ULONG(lc + MEMBER_OFFSET("_lowcore", stack_name));
+	if (strcmp(stack_name, "restart_stack") == 0) {
+		stack_addr = symbol_value("restart_stack");
+		if (!stack_addr)
+			return;
+		stack_addr = readmem_ul(stack_addr);
+	} else {
+		if (!MEMBER_EXISTS("_lowcore", stack_name))
+			return;
+		stack_addr = ULONG(lc + MEMBER_OFFSET("_lowcore", stack_name));
+	}
(Continue reading)

Michael Holzheu | 15 Aug 2011 17:16
Picon

[PATCH] s390: Print pt_regs for interrupt stack frames

Hi Dave,

With this patch instead of just printing the string " - Interrupt -",
we print the pt_regs for interrupts. The pt_regs contain all the current
registers and PSW of the interrupted CPU. This is very useful information
for debugging.

Old output:
-----------
 #4 [00017ea0] do_restart at 111c18
 #5 [00017eb8] psw_restart_int_handler at 5c1194
 - Interrupt -
 #6 [00017f58] vtime_stop_cpu at 5c043e
 #0 [00907eb0] cpu_idle at 106026
 #1 [00907ef8] start_kernel at 9799e8

New output:
-----------
 #4 [00017ea0] do_restart at 111c18
 #5 [00017eb8] psw_restart_int_handler at 5c1194
 PSW:  0706000180000000 00000000005c043e (vtime_stop_cpu+134)
 GPRS: 0000000000000000 00000000005c043e 00000000011e5228 00000000011e5248 
       0000000000907f08 00000000011e5b40 0000000000979324 0000000000000000 
       00000000009c0000 00000000009c0010 00000000009ab024 00000000011e5200 
       00000000011e5238 00000000005c6a00 0000000000106026 0000000000907e68 
 #0 [00907eb0] cpu_idle at 106026
 #1 [00907ef8] start_kernel at 9799e

Signed-off-by: Michael Holzheu <holzheu <at> linux.vnet.ibm.com>
---
(Continue reading)

Dave Anderson | 15 Aug 2011 18:14
Picon
Favicon

Re: [PATCH] s390: Add restart stack support


----- Original Message -----
> Hi Dave,
> 
> With Linux 3.0.1 on s390 we have a new kernel stack for the PSW restart
> interrupt. See kernel git commit 7dd6b3343fdc190712d1620ee8848d25c4c77c33
> for details. With this patch the crash "bt" command will find this
> stack.
> 
> Signed-off-by: Michael Holzheu <holzheu <at> linux.vnet.ibm.com>
> ---

Queued for the next release (crash-5.1.8).

Thanks,
  Dave

> s390x.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
> 
> --- a/s390x.c
> +++ b/s390x.c
>  <at>  <at>  -825,9 +825,16  <at>  <at>  static void get_int_stack(char *stack_na
> unsigned long stack_addr;
> 
> *start = *end = 0;
> - if (!MEMBER_EXISTS("_lowcore", stack_name))
> - return;
> - stack_addr = ULONG(lc + MEMBER_OFFSET("_lowcore", stack_name));
> + if (strcmp(stack_name, "restart_stack") == 0) {
(Continue reading)

Dave Anderson | 15 Aug 2011 18:15
Picon
Favicon

Re: [PATCH] s390: Print pt_regs for interrupt stack frames


----- Original Message -----
> Hi Dave,
> 
> With this patch instead of just printing the string " - Interrupt -",
> we print the pt_regs for interrupts. The pt_regs contain all the current
> registers and PSW of the interrupted CPU. This is very useful information
> for debugging.
> 
> Old output:
> -----------
> #4 [00017ea0] do_restart at 111c18
> #5 [00017eb8] psw_restart_int_handler at 5c1194
> - Interrupt -
> #6 [00017f58] vtime_stop_cpu at 5c043e
> #0 [00907eb0] cpu_idle at 106026
> #1 [00907ef8] start_kernel at 9799e8
> 
> New output:
> -----------
> #4 [00017ea0] do_restart at 111c18
> #5 [00017eb8] psw_restart_int_handler at 5c1194
> PSW: 0706000180000000 00000000005c043e (vtime_stop_cpu+134)
> GPRS: 0000000000000000 00000000005c043e 00000000011e5228 00000000011e5248
> 0000000000907f08 00000000011e5b40 0000000000979324 0000000000000000
> 00000000009c0000 00000000009c0010 00000000009ab024 00000000011e5200
> 00000000011e5238 00000000005c6a00 0000000000106026 0000000000907e68
> #0 [00907eb0] cpu_idle at 106026
> #1 [00907ef8] start_kernel at 9799e
> 
(Continue reading)

Michael Holzheu | 15 Aug 2011 18:28
Picon

[PATCH] s390: Add restart stack support (version 2)

Hi Dave,

Sorry, the restart stack patch is missing a check if the restart_stack
symbols exists. Without this check, we get error messages for older
kernels. Here the updated patch.

Sorry for the noise.

Signed-off-by: Michael Holzheu <holzheu <at> linux.vnet.ibm.com>
---
 s390x.c |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

--- a/s390x.c
+++ b/s390x.c
 <at>  <at>  -825,9 +825,16  <at>  <at>  static void get_int_stack(char *stack_na
 	unsigned long stack_addr;

 	*start = *end = 0;
-	if (!MEMBER_EXISTS("_lowcore", stack_name))
-		return;
-	stack_addr = ULONG(lc + MEMBER_OFFSET("_lowcore", stack_name));
+	if (strcmp(stack_name, "restart_stack") == 0) {
+		stack_addr = symbol_value("restart_stack");
+		if (!stack_addr)
+			return;
+		stack_addr = readmem_ul(stack_addr);
+	} else {
+		if (!MEMBER_EXISTS("_lowcore", stack_name))
+			return;
(Continue reading)

Dave Anderson | 15 Aug 2011 19:28
Picon
Favicon

Re: [PATCH] s390: Add restart stack support (version 2)


----- Original Message -----
> Hi Dave,
> 
> Sorry, the restart stack patch is missing a check if the restart_stack
> symbols exists. Without this check, we get error messages for older
> kernels. Here the updated patch.
> 
> Sorry for the noise.
> 
> Signed-off-by: Michael Holzheu <holzheu <at> linux.vnet.ibm.com>

OK -- I had checked it out only a live system, but that code
path wouldn't be exercised in that case, so I'll add in the 
symbol_exists() check to s390x_back_trace_cmd().

Also, the "if (!stack_addr)" check in get_int_stack() is an 
impossibility, right?

Thanks,
  Dave

> ---
> s390x.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
> 
> --- a/s390x.c
> +++ b/s390x.c
>  <at>  <at>  -825,9 +825,16  <at>  <at>  static void get_int_stack(char *stack_na
> unsigned long stack_addr;
(Continue reading)

Michael Holzheu | 16 Aug 2011 10:20
Picon

Re: [PATCH] s390: Add restart stack support (version 2)

Hello Dave,

On Mon, 2011-08-15 at 13:28 -0400, Dave Anderson wrote:
> OK -- I had checked it out only a live system, but that code
> path wouldn't be exercised in that case, so I'll add in the 
> symbol_exists() check to s390x_back_trace_cmd().

Thanks!

> Also, the "if (!stack_addr)" check in get_int_stack() is an 
> impossibility, right?

Correct, with the symbol_exists("restart_stack") check the "if (!
stack_addr)" should be always false.

Michael


Gmane