]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390/vdso: fix clock_gettime for CLOCK_THREAD_CPUTIME_ID, -2 and -3
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 27 Jan 2015 14:15:13 +0000 (15:15 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 12 Feb 2015 08:37:21 +0000 (09:37 +0100)
Git commit 8d8f2e18a6dbd3d09dd918788422e6ac8c878e96
"s390/vdso: ectg gettime support for CLOCK_THREAD_CPUTIME_ID"
broke clock_gettime for CLOCK_THREAD_CPUTIME_ID.

Git commit c742b31c03f37c5c499178f09f57381aa6c70131
"fast vdso implementation for CLOCK_THREAD_CPUTIME_ID"
introduced the ECTG for clock id -2. Correct would have been
clock id -3.

Fix the whole mess, CLOCK_THREAD_CPUTIME_ID is based on
CPUCLOCK_SCHED and can not be speed up by the vdso. A speedup
is only available for clock id -3 which is CPUCLOCK_VIRT for
the task currently running on the CPU.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/vdso64/clock_gettime.S

index 7699e735ae28ed726f4725ee97619119e1aa5e1e..61541fb93dc63e0f4673dcfe12e9d69681eb0993 100644 (file)
@@ -25,9 +25,7 @@ __kernel_clock_gettime:
        je      4f
        cghi    %r2,__CLOCK_REALTIME
        je      5f
-       cghi    %r2,__CLOCK_THREAD_CPUTIME_ID
-       je      9f
-       cghi    %r2,-2          /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
+       cghi    %r2,-3          /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
        je      9f
        cghi    %r2,__CLOCK_MONOTONIC_COARSE
        je      3f
@@ -106,7 +104,7 @@ __kernel_clock_gettime:
        aghi    %r15,16
        br      %r14
 
-       /* CLOCK_THREAD_CPUTIME_ID for this thread */
+       /* CPUCLOCK_VIRT for this thread */
 9:     icm     %r0,15,__VDSO_ECTG_OK(%r5)
        jz      12f
        ear     %r2,%a4