From 5c7ee5d6a0444f785a96811b88e604954a1f1ef4 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Mon, 7 Jan 2019 15:35:56 -0200 Subject: [PATCH] queuelat: use mfence for rdtsc ordering cpuid is causing register corruption: use mfence instead. Signed-off-by: Marcelo Tosatti v2: fix signed-off-by line Signed-off-by: John Kacur --- src/queuelat/queuelat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/queuelat/queuelat.c b/src/queuelat/queuelat.c index 2230d04bf391..3b291f168768 100644 --- a/src/queuelat/queuelat.c +++ b/src/queuelat/queuelat.c @@ -265,7 +265,7 @@ static inline unsigned long long __rdtscll(void) { DECLARE_ARGS(val, low, high); - asm volatile("cpuid; rdtsc" : EAX_EDX_RET(val, low, high)); + asm volatile("mfence; rdtsc" : EAX_EDX_RET(val, low, high)); return EAX_EDX_VAL(val, low, high); } -- 2.20.1