arm64: vdso: Avoid ISB after reading from cntvct_el0
authorWill Deacon <will@kernel.org>
Thu, 18 Mar 2021 17:07:37 +0000 (17:07 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 24 Mar 2021 16:48:41 +0000 (16:48 +0000)
commit77ec462536a13d4b428a1eead725c4818a49f0b1
tree85563cf866233aaa24c0ea0961da46c17362e724
parent7adbf10e29c2323f5eb6d6bdd13050c70900b993
arm64: vdso: Avoid ISB after reading from cntvct_el0

We can avoid the expensive ISB instruction after reading the counter in
the vDSO gettime functions by creating a fake address hazard against a
dummy stack read, just like we do inside the kernel.

Signed-off-by: Will Deacon <will@kernel.org>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210318170738.7756-5-will@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/arch_timer.h
arch/arm64/include/asm/barrier.h
arch/arm64/include/asm/vdso/gettimeofday.h