[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.1707110737530.8746@file01.intranet.prod.int.rdu2.redhat.com>
Date: Tue, 11 Jul 2017 07:44:05 -0400 (EDT)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>
cc: x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] x86/kernel/cpu/amd.c: use indirect call
This old piece of code is supposed to measure the performance of indirect
calls to determine if the processor is buggy or not, however the compiler
optimizer turns it into a direct call.
Use the macro OPTIMIZER_HIDE_VAR to thwart the optimization, so that real
indirect call is generated.
Signed-off-by: Mikulas Patocka <mpatocka@...hat.com>
---
arch/x86/kernel/cpu/amd.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-2.6/arch/x86/kernel/cpu/amd.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/amd.c
+++ linux-2.6/arch/x86/kernel/cpu/amd.c
@@ -134,6 +134,7 @@ static void init_amd_k6(struct cpuinfo_x
n = K6_BUG_LOOP;
f_vide = vide;
+ OPTIMIZER_HIDE_VAR(f_vide);
d = rdtsc();
while (n--)
f_vide();
Powered by blists - more mailing lists