]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/32: Remove unneccessary calculations in load_up_{fpu/altivec}
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 18 Aug 2021 08:47:28 +0000 (08:47 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 18 Aug 2021 13:49:55 +0000 (23:49 +1000)
No need to re-read SPRN_THREAD, we can calculate thread address
from current (r2).

And remove a reload of value 1 into r4 as r4 is already 1.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/c04cce578b97a76a9e69a096698b1d89f721768a.1629276437.git.christophe.leroy@csgroup.eu
arch/powerpc/kernel/fpu.S
arch/powerpc/kernel/vector.S

index 6010adcee16e2d575fd8e3112c37cb28751e03a4..ba4afe3b5a9cc761b66e12cddc2e7672dbad23a5 100644 (file)
@@ -91,8 +91,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX)
        isync
        /* enable use of FP after return */
 #ifdef CONFIG_PPC32
-       mfspr   r5,SPRN_SPRG_THREAD     /* current task's THREAD (phys) */
-       tovirt(r5, r5)
+       addi    r5,r2,THREAD
        lwz     r4,THREAD_FPEXC_MODE(r5)
        ori     r9,r9,MSR_FP            /* enable FP for current */
        or      r9,r9,r4
index fc120fac19104a78d0ba2a6238946cc3612dc957..ba03eedfdcd89f5d1208a8a085e5c69af9a5c1b8 100644 (file)
@@ -65,9 +65,8 @@ _GLOBAL(load_up_altivec)
 1:
        /* enable use of VMX after return */
 #ifdef CONFIG_PPC32
-       mfspr   r5,SPRN_SPRG_THREAD             /* current task's THREAD (phys) */
+       addi    r5,r2,THREAD
        oris    r9,r9,MSR_VEC@h
-       tovirt(r5, r5)
 #else
        ld      r4,PACACURRENT(r13)
        addi    r5,r4,THREAD            /* Get THREAD */
@@ -81,7 +80,6 @@ _GLOBAL(load_up_altivec)
        li      r4,1
        stb     r4,THREAD_LOAD_VEC(r5)
        addi    r6,r5,THREAD_VRSTATE
-       li      r4,1
        li      r10,VRSTATE_VSCR
        stw     r4,THREAD_USED_VR(r5)
        lvx     v0,r10,r6