backtrace: Strip PAC field when PAUTH is enabled
authorLouis Mayencourt <louis.mayencourt@arm.com>
Tue, 9 Jul 2019 10:40:55 +0000 (11:40 +0100)
committerLouis Mayencourt <louis.mayencourt@arm.com>
Wed, 17 Jul 2019 09:43:48 +0000 (10:43 +0100)
commitb8b31ad00046e163c40427758ec8cf976008e99b
tree85dead6c1119f9bf03a280a8b864d73a80efabcd
parent2cbeee4d519bac0d79da98faae969fae9f9558f9
backtrace: Strip PAC field when PAUTH is enabled

When pointer authentication is enabled, the LR value saved on the stack
contains a Pointer Authentication Code (PAC). It must be stripped to
retrieve the return address.

The PAC field is stored on the high bits of the address and defined as:
- PAC field = Xn[54:bottom_PAC_bit], when address tagging is used.
- PAC field = Xn[63:56, 54:bottom_PAC_bit], without address tagging.

With bottom_PAC_bit = 64 - TCR_ELx.TnSZ

Change-Id: I21d804e58200dfeca1da4c2554690bed5d191936
Signed-off-by: Louis Mayencourt <louis.mayencourt@arm.com>
common/backtrace/backtrace.c