powerpc: No need to save XER in a system call
authorAnton Blanchard <anton@samba.org>
Wed, 4 Apr 2012 18:24:29 +0000 (18:24 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 30 Apr 2012 05:34:44 +0000 (15:34 +1000)
The XER is a volatile register so there is no need to save and restore
it over a system call - zero it out in the exception stack frame
instead.

This should fix a 5 cycle stall of the mfxer/std seen on POWER7.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/entry_64.S

index e212c2f57fd89043d761f9f14245a414c066d70f..7f1e6de9a5a9e6d68188d7b14ff877278dc45cb5 100644 (file)
@@ -82,6 +82,7 @@ system_call_common:
        std     r11,GPR10(r1)
        std     r11,GPR11(r1)
        std     r11,GPR12(r1)
+       std     r11,_XER(r1)
        std     r9,GPR13(r1)
        mfcr    r9
        mflr    r10
@@ -89,9 +90,7 @@ system_call_common:
        std     r9,_CCR(r1)
        std     r10,_LINK(r1)
        std     r11,_TRAP(r1)
-       mfxer   r9
        mfctr   r10
-       std     r9,_XER(r1)
        std     r10,_CTR(r1)
        std     r3,ORIG_GPR3(r1)
        ld      r2,PACATOC(r13)