[PATCH] powerpc: vdso 64bits gettimeofday bug
authorBenjamin Herrenschmidt <[email protected]>
Sat, 25 Feb 2006 21:09:00 +0000 (08:09 +1100)
committerPaul Mackerras <[email protected]>
Tue, 28 Feb 2006 05:25:54 +0000 (16:25 +1100)
A bug in the assembly code of the vdso can cause gettimeofday() to hang
or to return incorrect results. The wrong register was used to test for
pending updates of the calibration variables and to create a dependency
for subsequent loads. This fixes it.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
arch/powerpc/kernel/vdso64/gettimeofday.S

index ccaeda5136d17e63a71c6d1d64209e2d8d515694..4ee871f1cadbc776f6c5a512f74a86b27220b2d6 100644 (file)
@@ -225,9 +225,9 @@ V_FUNCTION_BEGIN(__do_get_xsec)
   .cfi_startproc
        /* check for update count & load values */
 1:     ld      r8,CFG_TB_UPDATE_COUNT(r3)
-       andi.   r0,r4,1                 /* pending update ? loop */
+       andi.   r0,r8,1                 /* pending update ? loop */
        bne-    1b
-       xor     r0,r4,r4                /* create dependency */
+       xor     r0,r8,r8                /* create dependency */
        add     r3,r3,r0
 
        /* Get TB & offset it */