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

2024-08-15 Thread Ryan Sullivan
Hi Michael, The r2 value is stored to the livepatch stack prior to entering into the livepatched code, so accessing it will gurantee the previous value is restored. Also, yes, this bug is caused by tooling that "scoops out" pre-compiled code and places it into the livepatch handler (e.g. kpatch)

RE: [PATCH v2] powerpc/ftrace: restore caller's toc on ppc64 livepatch sibling call

2024-08-08 Thread Ryan Sullivan
Restores caller's toc pointer to r2, on a sibling call this will uncorrupt the caller's toc pointer and otherwise will be redundant Signed-off-by: Ryan Sullivan --- arch/powerpc/kernel/trace/ftrace_entry.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/ke

[PATCH v2] powerpc/ftrace: restore caller's toc on ppc64 livepatch sibling call

2024-08-08 Thread Ryan Sullivan
Restores caller's toc pointer to r2, on a sibling call this will uncorrupt the caller's toc pointer and otherwise will be redundant Signed-off-by: Ryan Sullivan --- arch/powerpc/kernel/trace/ftrace_entry.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/ke

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

2024-07-29 Thread Ryan Sullivan
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. The only time that the r2 value is corrupted is in the case of a sibling call and thus this additi

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

2024-07-24 Thread Ryan Sullivan
alue to caller's stack, on a sibling call this will uncorrupt the caller's stack and otherwise will be redundant. Signed-off-by: Ryan Sullivan --- arch/powerpc/kernel/trace/ftrace_entry.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kernel/trace/ftrace_entry.