> From: Wang Han <[email protected]>
> 
> A reliable unwinder needs to validate that every frame record it reads
> is fully contained in a known kernel stack, and it needs to refuse to
> walk back into a stack it has already left. Add the building blocks
> for that:
> 
>   * struct stack_info / struct unwind_state in a new
>     asm/stacktrace/common.h, modelled on the arm64 reference
>     implementation.
>   * stackinfo_get_irq() / stackinfo_get_task() / stackinfo_get_overflow()
>     plus the corresponding on_*_stack() predicates in asm/stacktrace.h,
>     so callers can ask "is this object on stack X?" by stack kind
>     rather than open-coded address arithmetic.
>   * unwind_init_common(), unwind_find_stack() and
>     unwind_consume_stack() helpers that enforce the
>     forward-progress-only invariant required for reliability.
> 
> No existing user is wired up to these helpers in this commit; the
> unwinder switch comes in a follow-up. The header changes leave
> on_thread_stack() with the same semantics as before, just expressed in
> terms of the new helpers.
> 
> Reviewed-by: Shuai Xue <[email protected]>
> Assisted-by: Qoder:Qwen-3.8-MAX-Preview
> Signed-off-by: Wang Han <[email protected]>
> Signed-off-by: Shuai Xue <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=4


Reply via email to