Skip to content

Commit 1f5b62f

Browse files
Marc Zyngierwildea01
authored andcommitted
ARM: vdso: Remove dependency with the arch_timer driver internals
The VDSO code uses the kernel helper that was originally designed to abstract the access between 32 and 64bit systems. It worked so far because this function is declared as 'inline'. As we're about to revamp that part of the code, the VDSO would break. Let's fix it by doing what should have been done from the start, a proper system register access. Reviewed-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 6989303 commit 1f5b62f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎arch/arm/include/asm/cp15.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
#define BPIALL __ACCESS_CP15(c7, 0, c5, 6)
6969
#define ICIALLU __ACCESS_CP15(c7, 0, c5, 0)
7070

71+
#define CNTVCT __ACCESS_CP15_64(1, c14)
72+
7173
extern unsigned long cr_alignment; /* defined in entry-armv.S */
7274

7375
static inline unsigned long get_cr(void)

‎arch/arm/vdso/vgettimeofday.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
#include <linux/compiler.h>
1919
#include <linux/hrtimer.h>
2020
#include <linux/time.h>
21-
#include <asm/arch_timer.h>
2221
#include <asm/barrier.h>
2322
#include <asm/bug.h>
23+
#include <asm/cp15.h>
2424
#include <asm/page.h>
2525
#include <asm/unistd.h>
2626
#include <asm/vdso_datapage.h>
@@ -123,7 +123,8 @@ static notrace u64 get_ns(struct vdso_data *vdata)
123123
u64 cycle_now;
124124
u64 nsec;
125125

126-
cycle_now = arch_counter_get_cntvct();
126+
isb();
127+
cycle_now = read_sysreg(CNTVCT);
127128

128129
cycle_delta = (cycle_now - vdata->cs_cycle_last) & vdata->cs_mask;
129130

0 commit comments

Comments
 (0)