summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-09-22 10:03:51 -0600
committerJens Axboe <axboe@kernel.dk>2022-09-22 10:03:51 -0600
commit0574e8c3b2b47e1e2564c2f50ea0b6f2629f2e48 (patch)
treeff3fa05199b77eafb40944ad8128b7042ab0bd44
parentd14687025c0c61d047e4252036d1b024d62cb0a6 (diff)
downloadfio-master.tar.gz
fio-master.tar.bz2
arm64: ensure CPU clock retrieval issues isb()HEADmaster
This prevents counter value speculation, which will otherwise cause issues with the CPU clock. Link: https://github.com/axboe/fio/issues/1472 Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--arch/arch-aarch64.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arch-aarch64.h b/arch/arch-aarch64.h
index 951d1718..919e5796 100644
--- a/arch/arch-aarch64.h
+++ b/arch/arch-aarch64.h
@@ -27,10 +27,13 @@ static inline int arch_ffz(unsigned long bitmask)
#define ARCH_HAVE_FFZ
+#define isb() asm volatile("isb" : : : "memory")
+
static inline unsigned long long get_cpu_clock(void)
{
unsigned long val;
+ isb();
asm volatile("mrs %0, cntvct_el0" : "=r" (val));
return val;
}