* [PATCH] Optimise syscall entry for virtual, relocatable case
@ 2016-07-23 7:18 Nicholas Piggin
0 siblings, 0 replies; only message in thread
From: Nicholas Piggin @ 2016-07-23 7:18 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin, Michael Neuling, Benjamin Herrenschmidt
The mflr r10 instruction was left over saving of lr when the code
used lr to branch to system_call_entry from the exception handler.
That was changed by 6a404806d to use the count register.
The value is never used now, so mflr can be removed, and r10 can be
used for storage rather than spilling to scratch register.
This brings getppid syscall cost from 406 to 376 cycles on a POWER8.
Non-relocatable case is 371 cycles.
Cc: Michael Neuling <mikey@neuling.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Nick Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/exceptions-64s.S | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 4c94406..eb0cac2 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -63,15 +63,12 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \
* is volatile across system calls.
*/
#define SYSCALL_PSERIES_2_DIRECT \
- mflr r10 ; \
ld r12,PACAKBASE(r13) ; \
LOAD_HANDLER(r12, system_call_entry) ; \
mtctr r12 ; \
mfspr r12,SPRN_SRR1 ; \
- /* Re-use of r13... No spare regs to do this */ \
- li r13,MSR_RI ; \
- mtmsrd r13,1 ; \
- GET_PACA(r13) ; /* get r13 back */ \
+ li r10,MSR_RI ; \
+ mtmsrd r10,1 ; \
bctr ;
#else
/* We can branch directly */
--
2.8.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-23 7:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-23 7:18 [PATCH] Optimise syscall entry for virtual, relocatable case Nicholas Piggin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).