For s390x we still use OFFSET(task_struct_thread_info) to find out
the stack base. Since crash commit c9f932440bd06f0 which added support
for the new CONFIG_THREAD_INFO_IN_TASK configuration (Linux 4.9-rc1)
this is no longer possible.

So fix this and use the generic task_to_stackbase() to find the stack
base instead.

Without the patch the stack backtrace for running tasks (bt -a) can be
incomplete.

Signed-off-by: Michael Holzheu <[email protected]>
---
 s390x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/s390x.c b/s390x.c
index 8e9cafa..e13bd59 100644
--- a/s390x.c
+++ b/s390x.c
@@ -1304,8 +1304,7 @@ static void s390x_back_trace_cmd(struct bt_info *bt)
         * Print task stack
         */
        if (THIS_KERNEL_VERSION >= LINUX(2, 6, 0)) {
-               readmem(bt->task + OFFSET(task_struct_thread_info), KVADDR,
-                       &low, sizeof(long), "thread info", FAULT_ON_ERROR);
+               low = task_to_stackbase(bt->task);
        } else {
                low = bt->task;
        }
-- 
2.8.4

>From 71dd30f6051ba156821852d6a3956348e0064bec Mon Sep 17 00:00:00 2001
From: Michael Holzheu <[email protected]>
Date: Thu, 10 Nov 2016 20:10:26 +0100
Subject: [PATCH] s390x: Add support for CONFIG_THREAD_INFO_IN_TASK

For s390x we still use OFFSET(task_struct_thread_info) to find out
the stack base. Since crash commit c9f932440bd06f0 which added support
for the new CONFIG_THREAD_INFO_IN_TASK configuration (Linux 4.9-rc1)
this is no longer possible.

So fix this and use the generic task_to_stackbase() to find the stack
base instead.

Without the patch the stack backtrace for running tasks (bt -a) can be
incomplete.

Signed-off-by: Michael Holzheu <[email protected]>
---
 s390x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/s390x.c b/s390x.c
index 8e9cafa..e13bd59 100644
--- a/s390x.c
+++ b/s390x.c
@@ -1304,8 +1304,7 @@ static void s390x_back_trace_cmd(struct bt_info *bt)
 	 * Print task stack
 	 */
 	if (THIS_KERNEL_VERSION >= LINUX(2, 6, 0)) {
-		readmem(bt->task + OFFSET(task_struct_thread_info), KVADDR,
-			&low, sizeof(long), "thread info", FAULT_ON_ERROR);
+		low = task_to_stackbase(bt->task);
 	} else {
 		low = bt->task;
 	}
-- 
2.8.4

--
Crash-utility mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/crash-utility

Reply via email to