[PATCH v2 7/8] arm64: stacktrace: track all stack boundaries explicitly

Mark Brown broonie at kernel.org
Mon Aug 8 05:04:30 PDT 2022


On Fri, Aug 05, 2022 at 01:45:21PM +0100, Mark Rutland wrote:
> Currently we call an on_accessible_stack() callback for each step of the
> unwinder, requiring redundant work to be performed in the core of the
> unwind loop (e.g. disabling preemption around accesses to per-cpu
> variables containing stack boundaries). To prevent unwind loops which go
> through a stack multiple times, we have to track the set of unwound
> stacks, requiring a stack_type enum which needs to cater for all the
> stacks of all possible callees. To prevent loops within a stack, we must
> track the prior FP values.
> 
> This patch reworks the unwinder to minimize the work in the core of the
> unwinder, and to remove the need for the stack_type enum. The set of
> accessible stacks (and their boundaries) are determined at the start of
> the unwind, and the current stack is tracked during the unwind, with
> completed stacks removed from the set of accessible stacks. This makes
> the boundary checks more accurate (e.g. detecting overlapped frame
> records), and removes the need for separate tracking of the prior FP and
> visited stacks.

Reviewed-by: Mark Brown <broonie at kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220808/adec265d/attachment.sig>


More information about the linux-arm-kernel mailing list