mbox series

[v2,0/3] Use CNTVCTSS_EL0 in gettimeofday()

Message ID 20220830104833.34636-1-joey.gouly@arm.com (mailing list archive)
Headers show
Series Use CNTVCTSS_EL0 in gettimeofday() | expand

Message

Joey Gouly Aug. 30, 2022, 10:48 a.m. UTC
Hi all,

This patchset adds support for using CNTVCTSS_EL0 in gettimeofday() in the vDSO.
This can improve the accuracy and efficiency of some applications that call
gettimeofday() a lot.

This has been tested on an internal platform and a publicly available platform
that has FEAT_ECV.

Changes since v1 [1]:
  - Tidy up asm() statement in gettimeofday.h
  - Move vdso patching before __apply_alternatives_multi_stop

Thanks,
Joey

[1]: https://lore.kernel.org/linux-arm-kernel/20220825102025.53916-1-joey.gouly@arm.com/

Joey Gouly (3):
  arm64: module: move find_section to header
  arm64: alternative: patch alternatives in the vDSO
  arm64: vdso: use SYS_CNTVCTSS_EL0 for gettimeofday

 arch/arm64/include/asm/module.h            | 15 ++++++++++++
 arch/arm64/include/asm/vdso.h              |  3 +++
 arch/arm64/include/asm/vdso/gettimeofday.h | 19 +++++++++++----
 arch/arm64/kernel/alternative.c            | 28 ++++++++++++++++++++++
 arch/arm64/kernel/module.c                 | 15 ------------
 arch/arm64/kernel/vdso.c                   |  3 ---
 arch/arm64/kernel/vdso/vdso.lds.S          |  7 ++++++
 7 files changed, 68 insertions(+), 22 deletions(-)

Comments

Catalin Marinas Sept. 9, 2022, 6:07 p.m. UTC | #1
On Tue, 30 Aug 2022 11:48:30 +0100, Joey Gouly wrote:
> This patchset adds support for using CNTVCTSS_EL0 in gettimeofday() in the vDSO.
> This can improve the accuracy and efficiency of some applications that call
> gettimeofday() a lot.
> 
> This has been tested on an internal platform and a publicly available platform
> that has FEAT_ECV.
> 
> [...]

Applied to arm64 (for-next/gettimeofday), thanks!

[1/3] arm64: module: move find_section to header
      https://git.kernel.org/arm64/c/b3adc3844e1d
[2/3] arm64: alternative: patch alternatives in the vDSO
      https://git.kernel.org/arm64/c/4e3bca8f7cdd
[3/3] arm64: vdso: use SYS_CNTVCTSS_EL0 for gettimeofday
      https://git.kernel.org/arm64/c/9025cebf12d1