arm64: head.S: use ordinary stack frame for __primary_switched()
commit60699ba18b69ff210ed0304bc23f6c9d11d27a72
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 31 Aug 2016 11:05:16 +0000 (31 12:05 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 2 Sep 2016 10:47:51 +0000 (2 11:47 +0100)
treedc618b2522ad8382207796cc43f772ebf4c250d4
parentb929fe320e5f3c91c76cca81be80f2dde2ac54a6
arm64: head.S: use ordinary stack frame for __primary_switched()

Instead of stashing the value of the link register in x28 before setting
up the stack and calling into C code, create an ordinary PCS compatible
stack frame so that we can push the return address onto the stack.

Since exception handlers require a stack as well, assign the stack pointer
register before installing the vector table.

Note that this accounts for the difference between THREAD_START_SP and
THREAD_SIZE, given that the stack pointer is always decremented before
calling into any C code.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/head.S