Skip to content

Commit d86c6f8

Browse files
jan-kiszkagregkh
authored andcommittedFeb 17, 2025
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 82aa8d3 commit d86c6f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎scripts/gdb/linux/cpus.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def get_current_task(cpu):
172172
var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task")
173173
return per_cpu(var_ptr, cpu).dereference()
174174
elif utils.is_target_arch("aarch64"):
175-
current_task_addr = gdb.parse_and_eval("$SP_EL0")
175+
current_task_addr = gdb.parse_and_eval("(unsigned long)$SP_EL0")
176176
if (current_task_addr >> 63) != 0:
177177
current_task = current_task_addr.cast(task_ptr_type)
178178
return current_task.dereference()

0 commit comments

Comments
 (0)
Please sign in to comment.