]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc64/idle: Fix SP offsets when saving GPRs
authorChristopher M. Riedl <cmr@codefail.de>
Sat, 6 Feb 2021 07:23:42 +0000 (01:23 -0600)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 8 Feb 2021 14:10:16 +0000 (01:10 +1100)
commit0d78e0d6820b3d5b9a9a2a1aae48b21374630f0c
tree7cf13613c61cd1f2ad7766a3bc29a8f2b91c610c
parent8235a6905948e0280391966680bad14ad8dca3c9
powerpc64/idle: Fix SP offsets when saving GPRs

The idle entry/exit code saves/restores GPRs in the stack "red zone"
(Protected Zone according to PowerPC64 ELF ABI v2). However, the offset
used for the first GPR is incorrect and overwrites the back chain - the
Protected Zone actually starts below the current SP. In practice this is
probably not an issue, but it's still incorrect so fix it.

Also expand the comments to explain why using the stack "red zone"
instead of creating a new stackframe is appropriate here.

Signed-off-by: Christopher M. Riedl <cmr@codefail.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210206072342.5067-1-cmr@codefail.de
arch/powerpc/kernel/idle_book3s.S