aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-15 21:54:32 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-15 22:05:11 -0500
commit5d66da3d71e6aeca80ca08dbebd8a1cd72e6ee1f (patch)
tree1bdc54e617fc209925f33118f414ce0a4ebb62ac
parentd3ed65832029dcaf5fe086670a2f2c25600b51e9 (diff)
[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>
-rw-r--r--arch/powerpc/kernel/vdso32/cacheflush.S2
-rw-r--r--arch/powerpc/kernel/vdso32/datapage.S3
-rw-r--r--arch/powerpc/kernel/vdso32/gettimeofday.S4
-rw-r--r--arch/powerpc/kernel/vdso64/cacheflush.S2
-rw-r--r--arch/powerpc/kernel/vdso64/datapage.S3
-rw-r--r--arch/powerpc/kernel/vdso64/gettimeofday.S4
-rw-r--r--include/asm-powerpc/vdso.h2
7 files changed, 17 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/vdso32/cacheflush.S b/arch/powerpc/kernel/vdso32/cacheflush.S
index c8db993574ee..09629aea3e47 100644
--- a/arch/powerpc/kernel/vdso32/cacheflush.S
+++ b/arch/powerpc/kernel/vdso32/cacheflush.S
@@ -35,6 +35,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache)
35 subf r8,r6,r4 /* compute length */ 35 subf r8,r6,r4 /* compute length */
36 add r8,r8,r5 /* ensure we get enough */ 36 add r8,r8,r5 /* ensure we get enough */
37 srwi. r8,r8,7 /* compute line count */ 37 srwi. r8,r8,7 /* compute line count */
38 crclr cr0*4+so
38 beqlr /* nothing to do? */ 39 beqlr /* nothing to do? */
39 mtctr r8 40 mtctr r8
40 mr r3,r6 41 mr r3,r6
@@ -58,6 +59,7 @@ V_FUNCTION_END(__kernel_sync_dicache)
58 */ 59 */
59V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) 60V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
60 .cfi_startproc 61 .cfi_startproc
62 crclr cr0*4+so
61 sync 63 sync
62 isync 64 isync
63 li r3,0 65 li r3,0
diff --git a/arch/powerpc/kernel/vdso32/datapage.S b/arch/powerpc/kernel/vdso32/datapage.S
index f6b38472318d..4709f1d9542c 100644
--- a/arch/powerpc/kernel/vdso32/datapage.S
+++ b/arch/powerpc/kernel/vdso32/datapage.S
@@ -54,7 +54,6 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
54 .cfi_startproc 54 .cfi_startproc
55 mflr r12 55 mflr r12
56 .cfi_register lr,r12 56 .cfi_register lr,r12
57
58 mr r4,r3 57 mr r4,r3
59 bl __get_datapage@local 58 bl __get_datapage@local
60 mtlr r12 59 mtlr r12
@@ -63,6 +62,7 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
63 beqlr 62 beqlr
64 li r0,__NR_syscalls 63 li r0,__NR_syscalls
65 stw r0,0(r4) 64 stw r0,0(r4)
65 crclr cr0*4+so
66 blr 66 blr
67 .cfi_endproc 67 .cfi_endproc
68V_FUNCTION_END(__kernel_get_syscall_map) 68V_FUNCTION_END(__kernel_get_syscall_map)
@@ -80,6 +80,7 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq)
80 lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3) 80 lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3)
81 lwz r3,CFG_TB_TICKS_PER_SEC(r3) 81 lwz r3,CFG_TB_TICKS_PER_SEC(r3)
82 mtlr r12 82 mtlr r12
83 crclr cr0*4+so
83 blr 84 blr
84 .cfi_endproc 85 .cfi_endproc
85V_FUNCTION_END(__kernel_get_tbfreq) 86V_FUNCTION_END(__kernel_get_tbfreq)
diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S
index 0a32a41d50b0..7eebff03a041 100644
--- a/arch/powerpc/kernel/vdso32/gettimeofday.S
+++ b/arch/powerpc/kernel/vdso32/gettimeofday.S
@@ -59,6 +59,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday)
59 stw r5,TZONE_TZ_DSTTIME(r11) 59 stw r5,TZONE_TZ_DSTTIME(r11)
60 60
611: mtlr r12 611: mtlr r12
62 crclr cr0*4+so
62 li r3,0 63 li r3,0
63 blr 64 blr
64 65
@@ -117,6 +118,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
117 mulli r5,r5,1000 118 mulli r5,r5,1000
118 stw r5,TSPC32_TV_NSEC(r11) 119 stw r5,TSPC32_TV_NSEC(r11)
119 mtlr r12 120 mtlr r12
121 crclr cr0*4+so
120 li r3,0 122 li r3,0
121 blr 123 blr
122 124
@@ -185,6 +187,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
185 stw r4,TSPC32_TV_NSEC(r11) 187 stw r4,TSPC32_TV_NSEC(r11)
186 188
187 mtlr r12 189 mtlr r12
190 crclr cr0*4+so
188 li r3,0 191 li r3,0
189 blr 192 blr
190 193
@@ -219,6 +222,7 @@ V_FUNCTION_BEGIN(__kernel_clock_getres)
219 222
220 li r3,0 223 li r3,0
221 cmpli cr0,r4,0 224 cmpli cr0,r4,0
225 crclr cr0*4+so
222 beqlr 226 beqlr
223 lis r5,CLOCK_REALTIME_RES@h 227 lis r5,CLOCK_REALTIME_RES@h
224 ori r5,r5,CLOCK_REALTIME_RES@l 228 ori r5,r5,CLOCK_REALTIME_RES@l
diff --git a/arch/powerpc/kernel/vdso64/cacheflush.S b/arch/powerpc/kernel/vdso64/cacheflush.S
index d4a0ad28d534..cb4ae0a5edd0 100644
--- a/arch/powerpc/kernel/vdso64/cacheflush.S
+++ b/arch/powerpc/kernel/vdso64/cacheflush.S
@@ -35,6 +35,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache)
35 subf r8,r6,r4 /* compute length */ 35 subf r8,r6,r4 /* compute length */
36 add r8,r8,r5 /* ensure we get enough */ 36 add r8,r8,r5 /* ensure we get enough */
37 srwi. r8,r8,7 /* compute line count */ 37 srwi. r8,r8,7 /* compute line count */
38 crclr cr0*4+so
38 beqlr /* nothing to do? */ 39 beqlr /* nothing to do? */
39 mtctr r8 40 mtctr r8
40 mr r3,r6 41 mr r3,r6
@@ -58,6 +59,7 @@ V_FUNCTION_END(__kernel_sync_dicache)
58 */ 59 */
59V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) 60V_FUNCTION_BEGIN(__kernel_sync_dicache_p5)
60 .cfi_startproc 61 .cfi_startproc
62 crclr cr0*4+so
61 sync 63 sync
62 isync 64 isync
63 li r3,0 65 li r3,0
diff --git a/arch/powerpc/kernel/vdso64/datapage.S b/arch/powerpc/kernel/vdso64/datapage.S
index 6393e4137bc7..3b2dd7d0c1eb 100644
--- a/arch/powerpc/kernel/vdso64/datapage.S
+++ b/arch/powerpc/kernel/vdso64/datapage.S
@@ -54,12 +54,12 @@ V_FUNCTION_BEGIN(__kernel_get_syscall_map)
54 .cfi_startproc 54 .cfi_startproc
55 mflr r12 55 mflr r12
56 .cfi_register lr,r12 56 .cfi_register lr,r12
57
58 mr r4,r3 57 mr r4,r3
59 bl V_LOCAL_FUNC(__get_datapage) 58 bl V_LOCAL_FUNC(__get_datapage)
60 mtlr r12 59 mtlr r12
61 addi r3,r3,CFG_SYSCALL_MAP64 60 addi r3,r3,CFG_SYSCALL_MAP64
62 cmpli cr0,r4,0 61 cmpli cr0,r4,0
62 crclr cr0*4+so
63 beqlr 63 beqlr
64 li r0,__NR_syscalls 64 li r0,__NR_syscalls
65 stw r0,0(r4) 65 stw r0,0(r4)
@@ -80,6 +80,7 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq)
80 bl V_LOCAL_FUNC(__get_datapage) 80 bl V_LOCAL_FUNC(__get_datapage)
81 ld r3,CFG_TB_TICKS_PER_SEC(r3) 81 ld r3,CFG_TB_TICKS_PER_SEC(r3)
82 mtlr r12 82 mtlr r12
83 crclr cr0*4+so
83 blr 84 blr
84 .cfi_endproc 85 .cfi_endproc
85V_FUNCTION_END(__kernel_get_tbfreq) 86V_FUNCTION_END(__kernel_get_tbfreq)
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S
index 1a89094715cc..ccaeda5136d1 100644
--- a/arch/powerpc/kernel/vdso64/gettimeofday.S
+++ b/arch/powerpc/kernel/vdso64/gettimeofday.S
@@ -52,6 +52,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday)
52 stw r4,TZONE_TZ_MINWEST(r10) 52 stw r4,TZONE_TZ_MINWEST(r10)
53 stw r5,TZONE_TZ_DSTTIME(r10) 53 stw r5,TZONE_TZ_DSTTIME(r10)
541: mtlr r12 541: mtlr r12
55 crclr cr0*4+so
55 li r3,0 /* always success */ 56 li r3,0 /* always success */
56 blr 57 blr
57 .cfi_endproc 58 .cfi_endproc
@@ -99,6 +100,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
99 std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */ 100 std r0,TSPC64_TV_NSEC(r11) /* store nsec in tp */
100 101
101 mtlr r12 102 mtlr r12
103 crclr cr0*4+so
102 li r3,0 104 li r3,0
103 blr 105 blr
104 106
@@ -159,6 +161,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
159 std r7,TSPC64_TV_NSEC(r11) 161 std r7,TSPC64_TV_NSEC(r11)
160 162
161 mtlr r12 163 mtlr r12
164 crclr cr0*4+so
162 li r3,0 165 li r3,0
163 blr 166 blr
164 167
@@ -193,6 +196,7 @@ V_FUNCTION_BEGIN(__kernel_clock_getres)
193 196
194 li r3,0 197 li r3,0
195 cmpli cr0,r4,0 198 cmpli cr0,r4,0
199 crclr cr0*4+so
196 beqlr 200 beqlr
197 lis r5,CLOCK_REALTIME_RES@h 201 lis r5,CLOCK_REALTIME_RES@h
198 ori r5,r5,CLOCK_REALTIME_RES@l 202 ori r5,r5,CLOCK_REALTIME_RES@l
diff --git a/include/asm-powerpc/vdso.h b/include/asm-powerpc/vdso.h
index 85d8a7be25c4..b9f9118b1607 100644
--- a/include/asm-powerpc/vdso.h
+++ b/include/asm-powerpc/vdso.h
@@ -11,7 +11,7 @@
11#define VDSO32_MBASE VDSO32_LBASE 11#define VDSO32_MBASE VDSO32_LBASE
12#define VDSO64_MBASE VDSO64_LBASE 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/* Define if 64 bits VDSO has procedure descriptors */ 16/* Define if 64 bits VDSO has procedure descriptors */
17#undef VDS64_HAS_DESCRIPTORS 17#undef VDS64_HAS_DESCRIPTORS