linux-stable/arch/powerpc
Christophe Leroy 1a28e70f3b static_call: Properly initialise DEFINE_STATIC_CALL_RET0()
[ Upstream commit 5517d50082 ]

When a static call is updated with __static_call_return0() as target,
arch_static_call_transform() set it to use an optimised set of
instructions which are meant to lay in the same cacheline.

But when initialising a static call with DEFINE_STATIC_CALL_RET0(),
we get a branch to the real __static_call_return0() function instead
of getting the optimised setup:

	c00d8120 <__SCT__perf_snapshot_branch_stack>:
	c00d8120:	4b ff ff f4 	b       c00d8114 <__static_call_return0>
	c00d8124:	3d 80 c0 0e 	lis     r12,-16370
	c00d8128:	81 8c 81 3c 	lwz     r12,-32452(r12)
	c00d812c:	7d 89 03 a6 	mtctr   r12
	c00d8130:	4e 80 04 20 	bctr
	c00d8134:	38 60 00 00 	li      r3,0
	c00d8138:	4e 80 00 20 	blr
	c00d813c:	00 00 00 00 	.long 0x0

Add ARCH_DEFINE_STATIC_CALL_RET0_TRAMP() defined by each architecture
to setup the optimised configuration, and rework
DEFINE_STATIC_CALL_RET0() to call it:

	c00d8120 <__SCT__perf_snapshot_branch_stack>:
	c00d8120:	48 00 00 14 	b       c00d8134 <__SCT__perf_snapshot_branch_stack+0x14>
	c00d8124:	3d 80 c0 0e 	lis     r12,-16370
	c00d8128:	81 8c 81 3c 	lwz     r12,-32452(r12)
	c00d812c:	7d 89 03 a6 	mtctr   r12
	c00d8130:	4e 80 04 20 	bctr
	c00d8134:	38 60 00 00 	li      r3,0
	c00d8138:	4e 80 00 20 	blr
	c00d813c:	00 00 00 00 	.long 0x0

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/1e0a61a88f52a460f62a58ffc2a5f847d1f7d9d8.1647253456.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-20 09:36:21 +02:00
..
boot powerpc: dts: t104xrdb: fix phy type for FMAN 4/5 2022-04-13 19:27:10 +02:00
configs RTC for 5.17 2022-01-21 13:13:35 +02:00
crypto powerpc updates for 5.17 2022-01-14 15:17:26 +01:00
include static_call: Properly initialise DEFINE_STATIC_CALL_RET0() 2022-04-20 09:36:21 +02:00
kernel powerpc/secvar: fix refcount leak in format_show() 2022-04-13 19:27:20 +02:00
kexec powerpc: Set crashkernel offset to mid of RMA region 2022-04-13 19:27:12 +02:00
kvm KVM: PPC: Book3S HV P9: Fix "lost kick" race 2022-04-20 09:36:18 +02:00
lib powerpc/code-patching: Pre-map patch area 2022-04-13 19:27:20 +02:00
math-emu powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
mm Revert "powerpc: Set max_mapnr correctly" 2022-04-13 19:27:41 +02:00
net powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06 2022-01-15 12:21:25 +11:00
perf powerpc/64s/hash: Make hash faults work in NMI context 2022-04-13 19:27:18 +02:00
platforms powerpc/64e: Tie PPC_BOOK3E_64 to PPC_FSL_BOOK3E 2022-04-13 19:27:20 +02:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc/xive: Export XIVE IPI information for online-only processors. 2022-04-13 19:27:10 +02:00
tools powerpc/head_check: Fix shellcheck errors 2021-08-17 22:52:02 +10:00
xmon powerpc/xmon: Dump XIVE information for online-only processors. 2022-01-06 21:47:00 +11:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig Merge branch 'akpm' (patches from Andrew) 2022-01-20 10:41:01 +02:00
Kconfig.debug powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP 2021-08-25 13:35:48 +10:00
Makefile powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit 2022-04-08 13:58:14 +02:00
Makefile.postlink