Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-next/vdso' into for-next/core

* for-next/vdso:
arm64: vdso: Use __arch_counter_get_cntvct()

Will Deacon 217e3cbb 53a08704

+2 -20
+2 -20
arch/arm64/include/asm/vdso/gettimeofday.h
··· 8 8 #ifndef __ASSEMBLY__ 9 9 10 10 #include <asm/alternative.h> 11 + #include <asm/arch_timer.h> 11 12 #include <asm/barrier.h> 12 13 #include <asm/unistd.h> 13 14 #include <asm/sysreg.h> ··· 70 69 static __always_inline u64 __arch_get_hw_counter(s32 clock_mode, 71 70 const struct vdso_time_data *vd) 72 71 { 73 - u64 res; 74 - 75 72 /* 76 73 * Core checks for mode already, so this raced against a concurrent 77 74 * update. Return something. Core will do another round and then ··· 78 79 if (clock_mode == VDSO_CLOCKMODE_NONE) 79 80 return 0; 80 81 81 - /* 82 - * If FEAT_ECV is available, use the self-synchronizing counter. 83 - * Otherwise the isb is required to prevent that the counter value 84 - * is speculated. 85 - */ 86 - asm volatile( 87 - ALTERNATIVE("isb\n" 88 - "mrs %0, cntvct_el0", 89 - "nop\n" 90 - __mrs_s("%0", SYS_CNTVCTSS_EL0), 91 - ARM64_HAS_ECV) 92 - : "=r" (res) 93 - : 94 - : "memory"); 95 - 96 - arch_counter_enforce_ordering(res); 97 - 98 - return res; 82 + return __arch_counter_get_cntvct(); 99 83 } 100 84 101 85 #endif /* !__ASSEMBLY__ */