]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arm64: vdso: Use __arch_counter_get_cntvct()
authorBreno Leitao <leitao@debian.org>
Mon, 7 Apr 2025 11:33:25 +0000 (04:33 -0700)
committerWill Deacon <will@kernel.org>
Tue, 29 Apr 2025 12:58:38 +0000 (13:58 +0100)
commit00b39d150986c769fe52f9092b6e775a787d5d69
treecf745913939f58b37961a5e3378474138b9b5972
parent0af2f6be1b4281385b618cb86ad946eded089ac8
arm64: vdso: Use __arch_counter_get_cntvct()

While reading how `cntvct_el0` was read in the kernel, I found that
__arch_get_hw_counter() is doing something very similar to what
__arch_counter_get_cntvct() is already doing.

Use the existing __arch_counter_get_cntvct() function instead of
duplicating similar inline assembly code in __arch_get_hw_counter().

Both functions were performing nearly identical operations to read the
cntvct_el0 register. The only difference was that
__arch_get_hw_counter() included a memory clobber in its inline
assembly, which appears unnecessary in this context.

This change simplifies the code by eliminating duplicate functionality
and improves maintainability by centralizing the counter access logic in
a single implementation.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20250407-arm-vdso-v1-1-7012de25b195@debian.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/vdso/gettimeofday.h