Skip to content

Commit c315a19

Browse files
jan-kiszkagregkh
authored andcommitted
scripts/gdb: fix aarch64 userspace detection in get_current_task
commit 4ebc417 upstream. At least recent gdb releases (seen with 14.2) return SP_EL0 as signed long which lets the right-shift always return 0. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jan Kiszka <[email protected]> Cc: Barry Song <[email protected]> Cc: Kieran Bingham <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3a50995 commit c315a19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/gdb/linux/cpus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def get_current_task(cpu):
167167
var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task")
168168
return per_cpu(var_ptr, cpu).dereference()
169169
elif utils.is_target_arch("aarch64"):
170-
current_task_addr = gdb.parse_and_eval("$SP_EL0")
170+
current_task_addr = gdb.parse_and_eval("(unsigned long)$SP_EL0")
171171
if (current_task_addr >> 63) != 0:
172172
current_task = current_task_addr.cast(task_ptr_type)
173173
return current_task.dereference()

0 commit comments

Comments
 (0)