aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2012-04-04 23:44:48 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-04-30 01:37:14 -0400
commitfd6c40f3b00a1e76d6a920cb6591907c53450afc (patch)
treed642ee27a10ca9914a56e10b8990c45087a515b7 /arch
parent82087414c608440c5ca7faa5c2fb6327daebcd15 (diff)
powerpc: Better scheduling of CR save code in system call path
At the moment system call entry looks like: crclr so ... mfcr r9 ... std r9,_CCR(r1) commit bd19c8994a82 ([POWERPC] system call micro optimisation) put some space between the crclr and mfcr in order to avoid a stall. There is still a stall seen between the mfcr and std. We can avoid the crclr by doing it in a GPR with rlwinm which gives us more room to better schedule the sequence. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/entry_64.S16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index ba72ddbe5238..fd4604674468 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -63,15 +63,9 @@ system_call_common:
63 std r0,GPR0(r1) 63 std r0,GPR0(r1)
64 std r10,GPR1(r1) 64 std r10,GPR1(r1)
65 ACCOUNT_CPU_USER_ENTRY(r10, r11) 65 ACCOUNT_CPU_USER_ENTRY(r10, r11)
66 /*
67 * This "crclr so" clears CR0.SO, which is the error indication on
68 * return from this system call. There must be no cmp instruction
69 * between it and the "mfcr r9" below, otherwise if XER.SO is set,
70 * CR0.SO will get set, causing all system calls to appear to fail.
71 */
72 crclr so
73 std r2,GPR2(r1) 66 std r2,GPR2(r1)
74 std r3,GPR3(r1) 67 std r3,GPR3(r1)
68 mfcr r2
75 std r4,GPR4(r1) 69 std r4,GPR4(r1)
76 std r5,GPR5(r1) 70 std r5,GPR5(r1)
77 std r6,GPR6(r1) 71 std r6,GPR6(r1)
@@ -85,13 +79,17 @@ system_call_common:
85 std r11,_XER(r1) 79 std r11,_XER(r1)
86 std r11,_CTR(r1) 80 std r11,_CTR(r1)
87 std r9,GPR13(r1) 81 std r9,GPR13(r1)
88 mfcr r9
89 mflr r10 82 mflr r10
83 /*
84 * This clears CR0.SO (bit 28), which is the error indication on
85 * return from this system call.
86 */
87 rldimi r2,r11,28,(63-28)
90 li r11,0xc01 88 li r11,0xc01
91 std r9,_CCR(r1)
92 std r10,_LINK(r1) 89 std r10,_LINK(r1)
93 std r11,_TRAP(r1) 90 std r11,_TRAP(r1)
94 std r3,ORIG_GPR3(r1) 91 std r3,ORIG_GPR3(r1)
92 std r2,_CCR(r1)
95 ld r2,PACATOC(r13) 93 ld r2,PACATOC(r13)
96 addi r9,r1,STACK_FRAME_OVERHEAD 94 addi r9,r1,STACK_FRAME_OVERHEAD
97 ld r11,exception_marker@toc(r2) 95 ld r11,exception_marker@toc(r2)