Skip to content

ARM: vdso gettimeofday using generic timer architecture

Stephen Boyd linux-arm-kernel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest posting 2/20 of 6 patches 0 repliesNew
  2. v6 posting 1/20 of 6 patches 0 repliesSuperseded

Patches in v6 posting 2/2 No applies recorded yet

None of the 6 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH v6 0/6] ARM: vdso gettimeofday using generic timer architecture
Quoted 20 lines · Nathan Lynch
Quoted 19 lines · Stephen Boyd
Quoted 18 lines · Nathan Lynch

Provide fast userspace implementations of gettimeofday and clock_gettime on systems that implement the generic timers extension defined in ARMv7. This follows the example of arm64 in conception but significantly differs in some aspects of the implementation (C vs assembly, mainly).

Clocks supported:
- CLOCK_REALTIME
- CLOCK_MONOTONIC
- CLOCK_REALTIME_COARSE
- CLOCK_MONOTONIC_COARSE

This also provides clock_getres (as arm64 does).

Note that while the high-precision realtime and monotonic clock support depends on the generic timers extension, support for clock_getres and coarse clocks is independent of the timer implementation and is provided unconditionally.

Quoted 5 lines
Quoted 2 lines

I think we'll need to rename the clocksource in arch_timer.c if we only have an mmio architected timer to something like arch_mem_counter.

I guess ARMv7 would allow you to have mmio without cp15 (AFAIK ARMv8 does not). I don't see any dts in arch/arm that contains an arm,armv7-timer-mem node without an arm,armv7-timer node, though.

I only know of an ARMv7 device that is like this but the support for it isn't in linus' tree.

Quoted 5 lines

If this is a practical concern, I think using CONFIG_ARCH_CLOCKSOURCE_DATA is perhaps a better way to communicate whether cp15 access is available. That's how the x86 vdso, for example, decides between using HPET vs TSC etc.

I don't quite follow why it's any better than changing the string because we only really care about using cp15. If we cared about using cp15 vs mmio it might make sense.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation