ARM: aarch64: Re-implement most of barebox_arm_entry() in assembly
GCC9 now produces the following warning:

common.h:51:2: warning: listing the stack pointer register ‘sp’ in a clobber list is deprecated [-Wdeprecated]
   51 |  __asm__ __volatile__("mov sp, %0"
      |  ^~~~~~~
common.h:51:2: note: the value of the stack pointer after  an ‘asm’ statement must be the same as it was before the statement

Stack pointer was added to clobber list in commit f9fc8254b2 ("ARM:
Mark SP as being clobbered in arm_setup_stack()") to prevent GCC from
generating code that would corrupt 'boarddata' pointer by trying to
restore it from invalid stack frame.

Interestingly enough, seemingly unrelated change in commit
64d95896cf ("ARM: aarch64: compile with general-regs-only") changed
generated code such that adding SP to clobber list became no longer
necessary.

While the above can probably be a fix by itself, it seems a better and
more future proof approach would be to address the problem at its root
and re-implement offending startup sequence in assembly.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent f56b18c commit 1d9cc19aa742bff1aa848c48aad58e8d1166037d
@Andrey Smirnov Andrey Smirnov authored on 14 Sep 2019
Sascha Hauer committed on 1 Oct 2019
Showing 5 changed files
View
arch/arm/cpu/Makefile
View
arch/arm/cpu/entry.c
View
arch/arm/cpu/entry_ll.S 0 → 100644
View
arch/arm/cpu/entry_ll_64.S 0 → 100644
View
arch/arm/include/asm/common.h