linux/arch/arm64
Will Deacon 99f66b5182 arm64/vdso: Fix nsec handling for CLOCK_MONOTONIC_RAW
commit dbb236c1ce upstream.

Recently vDSO support for CLOCK_MONOTONIC_RAW was added in
49eea433b3 ("arm64: Add support for CLOCK_MONOTONIC_RAW in
clock_gettime() vDSO"). Noticing that the core timekeeping code
never set tkr_raw.xtime_nsec, the vDSO implementation didn't
bother exposing it via the data page and instead took the
unshifted tk->raw_time.tv_nsec value which was then immediately
shifted left in the vDSO code.

Unfortunately, by accellerating the MONOTONIC_RAW clockid, it
uncovered potential 1ns time inconsistencies caused by the
timekeeping core not handing sub-ns resolution.

Now that the core code has been fixed and is actually setting
tkr_raw.xtime_nsec, we need to take that into account in the
vDSO by adding it to the shifted raw_time value, in order to
fix the user-visible inconsistency. Rather than do that at each
use (and expand the data page in the process), instead perform
the shift/addition operation when populating the data page and
remove the shift from the vDSO code entirely.

[jstultz: minor whitespace tweak, tried to improve commit
 message to make it more clear this fixes a regression]
Reported-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Tested-by: Daniel Mentz <danielmentz@google.com>
Acked-by: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Stephen Boyd <stephen.boyd@linaro.org>
Cc: Miroslav Lichvar <mlichvar@redhat.com>
Link: http://lkml.kernel.org/r/1496965462-20003-4-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-06-29 13:00:30 +02:00
..
boot arm64: dts: hi6220: Reset the mmc hosts 2017-05-25 15:44:44 +02:00
configs ZTE arm64 defconfig updates for 4.9: 2016-09-19 22:35:21 +02:00
crypto crypto: arm64/aes-blk - honour iv_out requirement in CBC and CTR modes 2017-02-09 08:08:26 +01:00
include arm64: entry: improve data abort handling of tagged pointers 2017-06-14 15:06:05 +02:00
kernel arm64/vdso: Fix nsec handling for CLOCK_MONOTONIC_RAW 2017-06-29 13:00:30 +02:00
kvm arm64: KVM: Allow unaligned accesses at EL2 2017-06-14 15:05:56 +02:00
lib Merge branch 'work.uaccess' into for-linus 2016-10-14 20:42:44 -04:00
mm arm64: mm: unaligned access by user-land should be received as SIGBUS 2017-04-12 12:41:11 +02:00
net bpf, arm64: fix faulty emission of map access in tail calls 2017-06-07 12:07:43 +02:00
xen arm/xen: add support for vm_assist hypercall 2016-07-06 10:42:14 +01:00
Kconfig irqchip/gicv3-its: Add workaround for QDF2400 ITS erratum 0065 2017-03-22 12:43:39 +01:00
Kconfig.debug arm64: always enable DEBUG_RODATA and remove the Kconfig option 2016-08-26 10:13:41 +01:00
Kconfig.platforms arm64: uniphier: select ARCH_HAS_RESET_CONTROLLER 2016-10-22 18:25:52 +09:00
Makefile arm64: kernel: force ET_DYN ELF type for CONFIG_RELOCATABLE=y 2016-10-20 11:37:25 +01:00