summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/vdso.c
diff options
context:
space:
mode:
authorNathan Lynch <nathan_lynch@mentor.com>2014-02-05 05:53:04 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2014-02-05 11:55:30 +0000
commit069b918623e1510e58dacf178905a72c3baa3ae4 (patch)
treea76629dc5124be49adcba5425381687ea9e9c9a3 /arch/arm64/kernel/vdso.c
parent883d50a0ed403446437444a495356ce31e1197a3 (diff)
downloadop-kernel-dev-069b918623e1510e58dacf178905a72c3baa3ae4.zip
op-kernel-dev-069b918623e1510e58dacf178905a72c3baa3ae4.tar.gz
arm64: vdso: fix coarse clock handling
When __kernel_clock_gettime is called with a CLOCK_MONOTONIC_COARSE or CLOCK_REALTIME_COARSE clock id, it returns incorrectly to whatever the caller has placed in x2 ("ret x2" to return from the fast path). Fix this by saving x30/LR to x2 only in code that will call __do_get_tspec, restoring x30 afterward, and using a plain "ret" to return from the routine. Also: while the resulting tv_nsec value for CLOCK_REALTIME and CLOCK_MONOTONIC must be computed using intermediate values that are left-shifted by cs_shift (x12, set by __do_get_tspec), the results for coarse clocks should be calculated using unshifted values (xtime_coarse_nsec is in units of actual nanoseconds). The current code shifts intermediate values by x12 unconditionally, but x12 is uninitialized when servicing a coarse clock. Fix this by setting x12 to 0 once we know we are dealing with a coarse clock id. Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com> Acked-by: Will Deacon <will.deacon@arm.com> Cc: <stable@vger.kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/vdso.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud