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
clear_page.S arm64: lib: Use MOPS for copy_page() and clear_page() 2024-10-17 16:42:51 +01:00
clear_user.S arm64: lib: Use MOPS for usercopy routines 2025-03-07 18:30:16 +00:00
copy_from_user.S arm64: lib: Use MOPS for usercopy routines 2025-03-07 18:30:16 +00:00
copy_page.S arm64: lib: Use MOPS for copy_page() and clear_page() 2024-10-17 16:42:51 +01:00
copy_template.S arm64: lib: Use MOPS for usercopy routines 2025-03-07 18:30:16 +00:00
copy_to_user.S arm64: lib: Use MOPS for usercopy routines 2025-03-07 18:30:16 +00:00
csum.c arm64: csum: Fix OoB access in IP checksum code for negative lengths 2023-09-07 10:15:20 +01:00
delay.c arm64: Fix sampling the "stable" virtual counter in preemptible section 2026-02-26 18:12:48 +00:00
error-inject.c arm64: Add support for function error injection 2019-08-07 13:53:09 +01:00
insn.c arm64: Unconditionally enable LSE support 2026-01-22 10:16:41 +00:00
kasan_sw_tags.S arm64: Use BTI C directly and unconditionally 2021-12-14 18:12:58 +00:00
Makefile Crypto library updates for 6.17 2025-07-28 17:58:52 -07:00
memchr.S arm64: clean up symbol aliasing 2022-02-22 16:21:34 +00:00
memcmp.S arm64: clean up symbol aliasing 2022-02-22 16:21:34 +00:00
memcpy.S arm64: lib: Use MOPS for memcpy() routines 2024-10-17 16:42:51 +01:00
memset.S arm64: lib: Use MOPS for memcpy() routines 2024-10-17 16:42:51 +01:00
mte.S arm64/sysreg: Remove duplicate definitions from asm/sysreg.h 2022-12-01 17:31:12 +00:00
strchr.S arm64: clean up symbol aliasing 2022-02-22 16:21:34 +00:00
strcmp.S Merge branch 'for-next/strings' into for-next/core 2022-03-14 19:02:52 +00:00
strlen.S arm64: clean up symbol aliasing 2022-02-22 16:21:34 +00:00
strncmp.S Merge branch 'for-next/strings' into for-next/core 2022-03-14 19:02:52 +00:00
strnlen.S arm64: clean up symbol aliasing 2022-02-22 16:21:34 +00:00
strrchr.S arm64: clean up symbol aliasing 2022-02-22 16:21:34 +00:00
tishift.S arm64: lib: Use modern annotations for assembly functions 2020-01-08 12:23:02 +00:00
uaccess_flushcache.c arm: uaccess: Remove memcpy_page_flushcache() 2023-03-27 16:26:19 +01:00
xor-neon.c arm64: drop binutils version checks 2025-04-30 21:55:06 +02:00