linux/arch/arm64/lib
Marc Zyngier e5cb94ba5f arm64: Fix sampling the "stable" virtual counter in preemptible section
Ben reports that when running with CONFIG_DEBUG_PREEMPT, using
__arch_counter_get_cntvct_stable() results in well deserves warnings,
as we access a per-CPU variable without preemption disabled.

Fix the issue by disabling preemption on reading the counter. We can
probably do a lot better by not disabling preemption on systems that
do not require horrible workarounds to return a valid counter value,
but this plugs the issue for the time being.

Fixes: 29cc0f3aa7 ("arm64: Force the use of CNTVCT_EL0 in __delay()")
Reported-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/aZw3EGs4rbQvbAzV@e134344.arm.com
Tested-by: Ben Horgan <ben.horgan@arm.com>
Tested-by: André Draszik <andre.draszik@linaro.org>
Signed-off-by: Will Deacon <will@kernel.org>
2026-02-26 18:12:48 +00:00
..
.gitignore lib/crypto: arm64: Move arch/arm64/lib/crypto/ into lib/crypto/ 2025-06-30 09:26:20 -07:00
Makefile Crypto library updates for 6.17 2025-07-28 17:58:52 -07:00
clear_page.S
clear_user.S
copy_from_user.S
copy_page.S
copy_template.S
copy_to_user.S
csum.c
delay.c arm64: Fix sampling the "stable" virtual counter in preemptible section 2026-02-26 18:12:48 +00:00
error-inject.c
insn.c arm64: Unconditionally enable LSE support 2026-01-22 10:16:41 +00:00
kasan_sw_tags.S
memchr.S
memcmp.S
memcpy.S
memset.S
mte.S
strchr.S
strcmp.S
strlen.S
strncmp.S
strnlen.S
strrchr.S
tishift.S
uaccess_flushcache.c
xor-neon.c