diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2025-01-10 11:36:33 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-17 10:05:42 +0100 |
commit | f6760e7fb03a15ee441515ce31826847740eff5a (patch) | |
tree | db0e3495ff4e9fef2cd7efadd2092a83380f7091 | |
parent | 19fc795e9de0674b4e54b99fe1a43e6a3f527a4f (diff) | |
download | linux-f6760e7fb03a15ee441515ce31826847740eff5a.tar.gz linux-f6760e7fb03a15ee441515ce31826847740eff5a.tar.bz2 linux-f6760e7fb03a15ee441515ce31826847740eff5a.zip |
scripts/gdb: fix aarch64 userspace detection in get_current_task
commit 4ebc417ef9cb34010a71270421fe320ec5d88aa2 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/dcd2fabc-9131-4b48-8419-6444e2d67454@siemens.com
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | scripts/gdb/linux/cpus.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py index 2f11c4f9c345..13eb8b3901b8 100644 --- a/scripts/gdb/linux/cpus.py +++ b/scripts/gdb/linux/cpus.py @@ -167,7 +167,7 @@ def get_current_task(cpu): var_ptr = gdb.parse_and_eval("&pcpu_hot.current_task") return per_cpu(var_ptr, cpu).dereference() elif utils.is_target_arch("aarch64"): - current_task_addr = gdb.parse_and_eval("$SP_EL0") + current_task_addr = gdb.parse_and_eval("(unsigned long)$SP_EL0") if (current_task_addr >> 63) != 0: current_task = current_task_addr.cast(task_ptr_type) return current_task.dereference() |