[PATCH] arm64: arch_timer: reuse arch_timer_read_cnt{p,v}ct_el0() helpers

Will Deacon will at kernel.org
Fri Jun 5 09:43:04 PDT 2026


On Sat, 23 May 2026 12:59:26 -0400, Breno Leitao wrote:
> __arch_counter_get_cntpct() and __arch_counter_get_cntvct() open-code
> the same ECV-aware ALTERNATIVE block that arch_timer_read_cntpct_el0()
> and arch_timer_read_cntvct_el0() already provide in the same header.
> The two pairs are byte-for-byte identical except for the trailing
> arch_counter_enforce_ordering() the __arch_counter_get_* variants add.
> 
> Replace the duplicated inline assembly in __arch_counter_get_cntpct()
> and __arch_counter_get_cntvct() with calls to the corresponding helpers.
> This mirrors commit 00b39d150986 ("arm64: vdso: Use
> __arch_counter_get_cntvct()"), which removed similar duplication from
> the vDSO, and keeps the system-counter read sequence in a single place,
> reducing assembly code in the kernell
> 
> [...]

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

[1/1] arm64: arch_timer: reuse arch_timer_read_cnt{p,v}ct_el0() helpers
      https://git.kernel.org/arm64/c/11c33ffb3a4e

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list