arm64/perf: fix backtrace for AAPCS with FP enabled
This change is for arm64 platform compat mode. The change for arm32 platform has been included in this commit "perf: fix backtrace for AAPCS with FP enabled". This change replaces code designed for the obsolete ARM APCS ABI, which causes failures of the perf backtrace logic unless the gcc option -mapcs-frame is used to build all binaries on the platform. This obsolete gcc option forces the compiler to include the stack pointer along with the frame pointer and link register in the stack frame for each funciton call. The current AAPCS ABI document, doesn't explicitly describe the frame structure when the gcc frame pointer option, -fno-omit-frame-pointer, is enabled. However, with this option enabled, examination of the emitted prologue instructions shows that 1) R11 is used as the frame pointer, 2) only the R11 and LR are saved onto the stack, not the stack pointer, 3) after this prologue setup, the frame pointer, R11 points to the saved location of LR on the stack. The use of unsigned int arithmetic in the commit is required since the gcc emitted pointer arithmetic uses 8-byte pointer sizes, which are incorrect addresses for the 4-byte stack address size. Signed-off-by:Fang Jia <fang.jia@windriver.com> Reviewed-by:
Jiwei Sun <jiwei.sun@windriver.com> Signed-off-by:
De Huo <de.huo@windriver.com>
Loading