diff options
author | Will Deacon <will@kernel.org> | 2021-03-18 17:07:37 +0000 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2021-03-24 16:48:41 +0000 |
commit | 77ec462536a13d4b428a1eead725c4818a49f0b1 (patch) | |
tree | 85563cf866233aaa24c0ea0961da46c17362e724 /arch/arm64/include/asm/vdso | |
parent | 7adbf10e29c2323f5eb6d6bdd13050c70900b993 (diff) |
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>
Diffstat (limited to 'arch/arm64/include/asm/vdso')
-rw-r--r-- | arch/arm64/include/asm/vdso/gettimeofday.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/arm64/include/asm/vdso/gettimeofday.h b/arch/arm64/include/asm/vdso/gettimeofday.h index 631ab1281633..4b4c0dac0e14 100644 --- a/arch/arm64/include/asm/vdso/gettimeofday.h +++ b/arch/arm64/include/asm/vdso/gettimeofday.h @@ -83,11 +83,7 @@ static __always_inline u64 __arch_get_hw_counter(s32 clock_mode, */ isb(); asm volatile("mrs %0, cntvct_el0" : "=r" (res) :: "memory"); - /* - * This isb() is required to prevent that the seq lock is - * speculated.# - */ - isb(); + arch_counter_enforce_ordering(res); return res; } |