]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: head.S: use ordinary stack frame for __primary_switched()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 31 Aug 2016 11:05:16 +0000 (12:05 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 2 Sep 2016 10:47:51 +0000 (11:47 +0100)
commited88a5c5a217bc60b076c27780b36d871e6cd1cf
treedc618b2522ad8382207796cc43f772ebf4c250d4
parenteda3368a87b50dd4865c85e5b1b5b40f529526a2
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