[PATCH] powerpc: Make the vDSO functions set error code (#2)

The vDSO functions should have the same calling convention as a syscall.
Unfortunately, they currently don't set the cr0.so bit which is used to
indicate an error. This patch makes them clear this bit unconditionally
since all functions currently succeed. The syscall fallback done by some
of them will eventually override this if the syscall fails.

This also changes the symbol version of all vdso exports to make sure
glibc can differenciate between old and fixed calls for existing ones
like __kernel_gettimeofday.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by Benjamin Herrenschmidt and committed by Paul Mackerras 5d66da3d d3ed6583

+17 -3
+2
arch/powerpc/kernel/vdso32/cacheflush.S
··· 35 35 subf r8,r6,r4 /* compute length */ 36 36 add r8,r8,r5 /* ensure we get enough */ 37 37 srwi. r8,r8,7 /* compute line count */ 38 + crclr cr0*4+so 38 39 beqlr /* nothing to do? */ 39 40 mtctr r8 40 41 mr r3,r6 ··· 59 58 */ 60 59 V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) 61 60 .cfi_startproc 61 + crclr cr0*4+so 62 62 sync 63 63 isync 64 64 li r3,0
+2 -1
arch/powerpc/kernel/vdso32/datapage.S
··· 54 54 .cfi_startproc 55 55 mflr r12 56 56 .cfi_register lr,r12 57 - 58 57 mr r4,r3 59 58 bl __get_datapage@local 60 59 mtlr r12 ··· 62 63 beqlr 63 64 li r0,__NR_syscalls 64 65 stw r0,0(r4) 66 + crclr cr0*4+so 65 67 blr 66 68 .cfi_endproc 67 69 V_FUNCTION_END(__kernel_get_syscall_map) ··· 80 80 lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) 81 81 lwz r3,CFG_TB_TICKS_PER_SEC(r3) 82 82 mtlr r12 83 + crclr cr0*4+so 83 84 blr 84 85 .cfi_endproc 85 86 V_FUNCTION_END(__kernel_get_tbfreq)
+4
arch/powerpc/kernel/vdso32/gettimeofday.S
··· 59 59 stw r5,TZONE_TZ_DSTTIME(r11) 60 60 61 61 1: mtlr r12 62 + crclr cr0*4+so 62 63 li r3,0 63 64 blr 64 65 ··· 118 117 mulli r5,r5,1000 119 118 stw r5,TSPC32_TV_NSEC(r11) 120 119 mtlr r12 120 + crclr cr0*4+so 121 121 li r3,0 122 122 blr 123 123 ··· 187 185 stw r4,TSPC32_TV_NSEC(r11) 188 186 189 187 mtlr r12 188 + crclr cr0*4+so 190 189 li r3,0 191 190 blr 192 191 ··· 222 219 223 220 li r3,0 224 221 cmpli cr0,r4,0 222 + crclr cr0*4+so 225 223 beqlr 226 224 lis r5,CLOCK_REALTIME_RES@h 227 225 ori r5,r5,CLOCK_REALTIME_RES@l
+2
arch/powerpc/kernel/vdso64/cacheflush.S
··· 35 35 subf r8,r6,r4 /* compute length */ 36 36 add r8,r8,r5 /* ensure we get enough */ 37 37 srwi. r8,r8,7 /* compute line count */ 38 + crclr cr0*4+so 38 39 beqlr /* nothing to do? */ 39 40 mtctr r8 40 41 mr r3,r6 ··· 59 58 */ 60 59 V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) 61 60 .cfi_startproc 61 + crclr cr0*4+so 62 62 sync 63 63 isync 64 64 li r3,0
+2 -1
arch/powerpc/kernel/vdso64/datapage.S
··· 54 54 .cfi_startproc 55 55 mflr r12 56 56 .cfi_register lr,r12 57 - 58 57 mr r4,r3 59 58 bl V_LOCAL_FUNC(__get_datapage) 60 59 mtlr r12 61 60 addi r3,r3,CFG_SYSCALL_MAP64 62 61 cmpli cr0,r4,0 62 + crclr cr0*4+so 63 63 beqlr 64 64 li r0,__NR_syscalls 65 65 stw r0,0(r4) ··· 80 80 bl V_LOCAL_FUNC(__get_datapage) 81 81 ld r3,CFG_TB_TICKS_PER_SEC(r3) 82 82 mtlr r12 83 + crclr cr0*4+so 83 84 blr 84 85 .cfi_endproc 85 86 V_FUNCTION_END(__kernel_get_tbfreq)
+4
arch/powerpc/kernel/vdso64/gettimeofday.S
··· 52 52 stw r4,TZONE_TZ_MINWEST(r10) 53 53 stw r5,TZONE_TZ_DSTTIME(r10) 54 54 1: mtlr r12 55 + crclr cr0*4+so 55 56 li r3,0 /* always success */ 56 57 blr 57 58 .cfi_endproc ··· 100 99 std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */ 101 100 102 101 mtlr r12 102 + crclr cr0*4+so 103 103 li r3,0 104 104 blr 105 105 ··· 161 159 std r7,TSPC64_TV_NSEC(r11) 162 160 163 161 mtlr r12 162 + crclr cr0*4+so 164 163 li r3,0 165 164 blr 166 165 ··· 196 193 197 194 li r3,0 198 195 cmpli cr0,r4,0 196 + crclr cr0*4+so 199 197 beqlr 200 198 lis r5,CLOCK_REALTIME_RES@h 201 199 ori r5,r5,CLOCK_REALTIME_RES@l
+1 -1
include/asm-powerpc/vdso.h
··· 11 11 #define VDSO32_MBASE VDSO32_LBASE 12 12 #define VDSO64_MBASE VDSO64_LBASE 13 13 14 - #define VDSO_VERSION_STRING LINUX_2.6.12 14 + #define VDSO_VERSION_STRING LINUX_2.6.15 15 15 16 16 /* Define if 64 bits VDSO has procedure descriptors */ 17 17 #undef VDS64_HAS_DESCRIPTORS