From baba66789823b73f50b850b24cdafb7f01ba9e3f Mon Sep 17 00:00:00 2001
From: mlanger <mlanger@nvidia.com>
Date: Sat, 5 Apr 2025 05:33:51 +0000
Subject: [PATCH] Allow AARCH64 checkasm code to run benchmarks in user-mode.

---
 tools/checkasm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/checkasm.c b/tools/checkasm.c
index 09288a62..5b883028 100644
--- a/tools/checkasm.c
+++ b/tools/checkasm.c
@@ -113,7 +113,7 @@ static inline uint32_t read_time(void)
     asm volatile( "mrc p15, 0, %0, c9, c13, 0" : "=r"(a) :: "memory" );
 #elif ARCH_AARCH64
     uint64_t b = 0;
-    asm volatile( "mrs %0, pmccntr_el0" : "=r"(b) :: "memory" );
+    asm volatile( "isb; mrs %0, cntvct_el0" : "=r"(b) :: "memory" );
     a = b;
 #elif ARCH_MIPS
     asm volatile( "rdhwr %0, $2" : "=r"(a) :: "memory" );
-- 
GitLab