[PATCH v2] arm64: ftrace: use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR

Mark Brown broonie at kernel.org
Tue Nov 2 11:38:07 PDT 2021


On Fri, Oct 29, 2021 at 05:22:45PM +0100, Mark Rutland wrote:

> To fix this, we need to be able to uniquely identify each rewritten
> return address such that we can map this back to the original return
> address. We can use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR to associate
> each rewritten return address with a unique location on the stack. As
> the return address is passed in the LR (and so is not guaranteed a
> unique location in memory), we use the FP upon entry to the function
> (i.e. the address of the caller's frame record) as the return address
> pointer. Any nested call will have a different FP value as the caller
> must create its own frame record and update FP to point to this.

As a bonus since we're relying on core code more the result is also
simpler.

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/20211102/5bc04ae6/attachment.sig>


More information about the linux-arm-kernel mailing list