[PATCH] powerpc/ftrace: restore r2 to caller's stack on livepatch sibling call

Michael Ellerman mpe at ellerman.id.au
Thu Aug 15 20:22:15 AEST 2024


Ryan Sullivan <rysulliv at redhat.com> writes:
> Hello Michael,
>
> In the case of no sibling call within the livepatch then the store is
> only "restoring" the r2 value that was already there as it is stored
> and retrieved from the livepatch stack.

But what guarantee do we have that it's the value that was already
there?

Notice that the current livepatch_handler doesn't store to the (normal)
stack at all, because it doesn't know the context it's called in.

Does kpatch do anything special to induce the sibling call? Is it doing
objcopy or anything else weird?

I tried writing a selftest (in tools/testing/selftests/livepatch) to
trigger this case but couldn't get it to work. The compiler never
generates a sibling call across modules.

cheers


More information about the Linuxppc-dev mailing list