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

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>

authored by

Marc Zyngier and committed by
Will Deacon
1f5b62f0 6989303a

+5 -2
+2
arch/arm/include/asm/cp15.h
··· 68 68 #define BPIALL __ACCESS_CP15(c7, 0, c5, 6) 69 69 #define ICIALLU __ACCESS_CP15(c7, 0, c5, 0) 70 70 71 + #define CNTVCT __ACCESS_CP15_64(1, c14) 72 + 71 73 extern unsigned long cr_alignment; /* defined in entry-armv.S */ 72 74 73 75 static inline unsigned long get_cr(void)
+3 -2
arch/arm/vdso/vgettimeofday.c
··· 18 18 #include <linux/compiler.h> 19 19 #include <linux/hrtimer.h> 20 20 #include <linux/time.h> 21 - #include <asm/arch_timer.h> 22 21 #include <asm/barrier.h> 23 22 #include <asm/bug.h> 23 + #include <asm/cp15.h> 24 24 #include <asm/page.h> 25 25 #include <asm/unistd.h> 26 26 #include <asm/vdso_datapage.h> ··· 123 123 u64 cycle_now; 124 124 u64 nsec; 125 125 126 - cycle_now = arch_counter_get_cntvct(); 126 + isb(); 127 + cycle_now = read_sysreg(CNTVCT); 127 128 128 129 cycle_delta = (cycle_now - vdata->cs_cycle_last) & vdata->cs_mask; 129 130