]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/bpf/32: Only set a stack frame when necessary
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 1 Feb 2023 10:04:25 +0000 (11:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:30 +0000 (08:50 +0100)
commit496f832bcea3fe51339909c4026ed7ab0d115f80
tree8374a8be2687b5488ff7f4e2b47d0a1ff9bcaf9c
parentad6662cbd96ef16cddf1d9018ba50d0834500430
powerpc/bpf/32: Only set a stack frame when necessary

[ Upstream commit b5759a027416ec3e4c7cd0d847fcdae22bdf5908 ]

Until now a stack frame was set at all time due to the need
to keep tail call counter in the stack.

But since commit e99642531f8a ("powerpc/bpf/32: Fix Oops on tail call
tests") the tail call counter is passed via register r4. It is therefore
not necessary anymore to have a stack frame for that.

Just like PPC64, implement bpf_has_stack_frame() and only sets the frame
when needed.

The difference with PPC64 is that PPC32 doesn't have a redzone, so
the stack is required as soon as non volatile registers are used or
when tail call count is set up.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Fix commit reference in change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/62d7b654a3cfe73d998697cb29bbc5ffd89bfdb1.1675245773.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/net/bpf_jit_comp32.c