arm64: atomics: avoid anonymous LL/SC stubs

Since commit

  addfc38672c73efd ("arm64: atomics: avoid out-of-line ll/sc atomics")

The inlined LL/SC implementations of various atomic functions generate
an anonymous portion of code in a separate subsection. These are
effectively sibling functions which the compiler is not aware of, and
"return" to their caller with a direct branch.

If we backtrace one of these out-of-line portions of code, it will be
symbolized as an offset from the nearest prior symbol, which can be
misleading (TODO: example here). Further, since the return to the caller
is a direct branch, the caller will be missing from the backtrace.

This is confusing and hinders debugging. In general this pattern will
also be problematic for CONFIG_LIVEPATCH, since the caller is missing
from the stacktrace.

This is similar to the problem with out-of-line exception fixups, which
we dealt with in commits:

  35d67794b8828333 ("arm64: lib: __arch_clear_user(): fold fixups into body")
  4012e0e22739eef9 ("arm64: lib: __arch_copy_from_user(): fold fixups into body")
  139f9ab73d60cf76 ("arm64: lib: __arch_copy_to_user(): fold fixups into body")

TODO: explain what this patch does.

Other than the improved backtracing, there should be no functional
change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
1 file changed