]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Oct 2021 07:54:28 +0000 (09:54 +0200)
commit5d93b24b82bc05d4342ef542ed95397aa5236688
treeff8c307d401fee14f74b3080ed40c8e135d46a31
parenteb0e8ed5f537e4031a46d3c6a048b15d3fbf0cb7
powerpc64/idle: Fix SP offsets when saving GPRs

commit 73287caa9210ded6066833195f4335f7f688a46b upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/idle_book3s.S