arm64: Split unwind_init()
authorMadhavan T. Venkataraman <madvenka@linux.microsoft.com>
Fri, 17 Jun 2022 18:02:14 +0000 (13:02 -0500)
committerWill Deacon <will@kernel.org>
Mon, 27 Jun 2022 09:51:34 +0000 (10:51 +0100)
commita019d8a2cc82a95880677fb0ec16d1d4e8647df7
treec3334d7e6c07e9a070e1c935ad709be0baddb231
parent446297b28a21244e4045026c4599d1b14a67e2ce
arm64: Split unwind_init()

unwind_init() is currently a single function that initializes all of the
unwind state. Split it into the following functions and call them
appropriately:

- unwind_init_from_regs() - initialize from regs passed by caller.

- unwind_init_from_caller() - initialize for the current task
  from the caller of arch_stack_walk().

- unwind_init_from_task() - initialize from the saved state of a
  task other than the current task. In this case, the other
  task must not be running.

This is done for two reasons:

- the different ways of initializing are clear

- specialized code can be added to each initializer in the future.

Signed-off-by: Madhavan T. Venkataraman <madvenka@linux.microsoft.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20220617180219.20352-2-madvenka@linux.microsoft.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/stacktrace.c