Re: [PATCH v2 08/21] scripts/gdb: arm64: Use TPIDRRO_EL0 instead of SP_EL0 for 'current'

From: Jinjie Ruan

Date: Thu Oct 08 2026 - 03:56:57 EST




在 2026/9/19 0:13, Will Deacon 写道:
> The current task pointer now lives in TPIDRRO_EL0 instead of SP_EL0, so
> update the gdb 'cpus.py' helper script with the new register allocation.
>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Signed-off-by: Will Deacon <will@xxxxxxxxxx>
> ---
> 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 6edf4ef61636..547a623280ae 100644
> --- a/scripts/gdb/linux/cpus.py
> +++ b/scripts/gdb/linux/cpus.py
> @@ -185,7 +185,7 @@ def get_current_task(cpu):
> var_ptr = gdb.parse_and_eval("&current_task")
> return per_cpu(var_ptr, cpu).dereference()
> elif utils.is_target_arch("aarch64"):
> - current_task_addr = gdb.parse_and_eval("(unsigned long)$SP_EL0")
> + current_task_addr = gdb.parse_and_eval("(unsigned long)$TPIDRRO_EL0")

Reviewed-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>

> if (current_task_addr >> 63) != 0:
> current_task = current_task_addr.cast(task_ptr_type)
> return current_task.dereference()

--
Best regards,
Jinjie