arm64: factor out entry stack manipulation
authorMark Rutland <mark.rutland@arm.com>
Wed, 19 Jul 2017 16:24:49 +0000 (17:24 +0100)
committerHaibo Chen <haibo.chen@nxp.com>
Thu, 12 Apr 2018 10:46:05 +0000 (18:46 +0800)
commit3f2e0eb0e83a92c942ac44f796e6bcc610deea59
treebbadc1e22b5a088019d00bb012ec062ee10e09f0
parent17dd577a6ad517fb099eb5bb39ee399d99649012
arm64: factor out entry stack manipulation

commit b11e5759bfac upstream.

In subsequent patches, we will detect stack overflow in our exception
entry code, by verifying the SP after it has been decremented to make
space for the exception regs.

This verification code is small, and we can minimize its impact by
placing it directly in the vectors. To avoid redundant modification of
the SP, we also need to move the initial decrement of the SP into the
vectors.

As a preparatory step, this patch introduces kernel_ventry, which
performs this decrement, and updates the entry code accordingly.
Subsequent patches will fold SP verification into kernel_ventry.

There should be no functional change as a result of this patch.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
[Mark: turn into prep patch, expand commit msg]
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/kernel/entry.S