From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755242AbdGKLoM (ORCPT ); Tue, 11 Jul 2017 07:44:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50226 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752303AbdGKLoK (ORCPT ); Tue, 11 Jul 2017 07:44:10 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6024F334594 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mpatocka@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6024F334594 Date: Tue, 11 Jul 2017 07:44:05 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86/kernel/cpu/amd.c: use indirect call Message-ID: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 11 Jul 2017 11:44:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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();