Thread (49 messages) 49 messages, 7 authors, 2022-11-03

Re: [PATCH v6 20/25] powerpc: Change system_call_exception calling convention

From: "Nicholas Piggin" <npiggin@gmail.com>
Date: 2022-09-23 07:44:15

On Wed Sep 21, 2022 at 4:56 PM AEST, Rohan McLure wrote:
Change system_call_exception arguments to pass a pointer to a stack frame
container caller state, as well as the original r0, which determines the
number of the syscall. This has been observed to yield improved performance
to passing them by registers, circumventing the need to allocate a stack frame.

Signed-off-by: Rohan McLure <redacted>
Thanks for splitting it out, I think it does make it nicer to review.

[...]
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/kernel/syscall.c b/arch/powerpc/kernel/syscall.c
index 15af0ed019a7..0e9ba3efee94 100644
--- a/arch/powerpc/kernel/syscall.c
+++ b/arch/powerpc/kernel/syscall.c
@@ -13,9 +13,7 @@
 
 
 /* Has to run notrace because it is entered not completely "reconciled" */
-notrace long system_call_exception(long r3, long r4, long r5,
-				   long r6, long r7, long r8,
-				   unsigned long r0, struct pt_regs *regs)
+notrace long system_call_exception(struct pt_regs *regs, unsigned long r0)
 {
 	long ret;
 	syscall_fn f;
@@ -136,12 +134,6 @@ notrace long system_call_exception(long r3, long r4, long r5,
 		r0 = do_syscall_trace_enter(regs);
 		if (unlikely(r0 >= NR_syscalls))
 			return regs->gpr[3];
-		r3 = regs->gpr[3];
-		r4 = regs->gpr[4];
-		r5 = regs->gpr[5];
-		r6 = regs->gpr[6];
-		r7 = regs->gpr[7];
-		r8 = regs->gpr[8];
 
 	} else if (unlikely(r0 >= NR_syscalls)) {
 		if (unlikely(trap_is_unsupported_scv(regs))) {
-- 
2.34.1
This is probably just missing the hunk

+       ret = f(regs->gpr[3], regs->gpr[4], regs->gpr[5],                                                                                                                                                                              
+               regs->gpr[6], regs->gpr[7], regs->gpr[8]);        

which got into your next patch.

Otherwise I think it looks good.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help