linux-stable/arch/arm64
Nathan Lynch 069b918623 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>
2014-02-05 11:55:30 +00:00
..
boot arm64: dts: Reduce size of virtio block device for foundation model 2013-12-20 16:20:21 +00:00
configs arm64: defconfig: Enable CONFIG_PREEMPT by default 2013-11-05 10:03:53 +00:00
include arm64: fix typo: s/SERRROR/SERROR/ 2014-02-05 10:42:32 +00:00
kernel arm64: vdso: fix coarse clock handling 2014-02-05 11:55:30 +00:00
kvm First round of KVM updates for 3.14; PPC parts will come next week. 2014-01-22 21:40:43 -08:00
lib arm64: use generic strnlen_user and strncpy_from_user functions 2013-12-19 17:43:06 +00:00
mm arm64: simplify pgd_alloc 2014-02-05 10:45:07 +00:00
xen xen/arm,arm64: enable SWIOTLB_XEN 2013-10-10 13:40:44 +00:00
Kconfig arm64, jump label: optimize jump label implementation 2014-01-08 15:23:53 +00:00
Kconfig.debug arm64: Remove duplicate DEBUG_STACK_USAGE config 2013-10-02 18:03:26 +01:00
Makefile arm64: big-endian: add big-endian support to top-level arch Makefile 2013-10-25 15:59:31 +01:00