[<prev] [next>] [day] [month] [year] [list]
Message-ID: <dcd2fabc-9131-4b48-8419-6444e2d67454@siemens.com>
Date: Fri, 10 Jan 2025 11:36:33 +0100
From: Jan Kiszka <jan.kiszka@...mens.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc: Kieran Bingham <kbingham@...nel.org>, Barry Song <baohua@...nel.org>
Subject: [PATCH] scripts/gdb: fix aarch64 userspace detection in
get_current_task
From: Jan Kiszka <jan.kiszka@...mens.com>
At least recent gdb releases (seen with 14.2) return SP_EL0 as signed
long which lets the right-shift always return 0.
Signed-off-by: Jan Kiszka <jan.kiszka@...mens.com>
---
scripts/gdb/linux/cpus.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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()
--
2.43.0
Powered by blists - more mailing lists