projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d146870
)
arm64: ensure CPU clock retrieval issues isb()
author
Jens Axboe
<axboe@kernel.dk>
Thu, 22 Sep 2022 16:03:51 +0000
(10:03 -0600)
committer
Jens Axboe
<axboe@kernel.dk>
Thu, 22 Sep 2022 16:03:51 +0000
(10:03 -0600)
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>
arch/arch-aarch64.h
patch
|
blob
|
blame
|
history
diff --git
a/arch/arch-aarch64.h
b/arch/arch-aarch64.h
index 951d1718cfabfbe59469c3421b67d4bc8fb5e103..919e57967609b4b077c50396c5aaf0cc6f4a1d05 100644
(file)
--- 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;
}