Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753800AbeAFVLa (ORCPT + 1 other); Sat, 6 Jan 2018 16:11:30 -0500 Received: from terminus.zytor.com ([65.50.211.136]:41713 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753234AbeAFVL2 (ORCPT ); Sat, 6 Jan 2018 16:11:28 -0500 Date: Sat, 6 Jan 2018 13:06:00 -0800 From: tip-bot for Tom Lendacky Message-ID: Cc: hpa@zytor.com, tim.c.chen@linux.intel.com, peterz@infradead.org, dave.hansen@intel.com, torvalds@linux-foundation.org, bp@alien8.de, dwmw@amazon.co.uk, tglx@linutronix.de, mingo@kernel.org, pjt@google.com, thomas.lendacky@amd.com, gregkh@linux-foundation.org, linux-kernel@vger.kernel.org Reply-To: tglx@linutronix.de, bp@alien8.de, dwmw@amazon.co.uk, gregkh@linux-foundation.org, thomas.lendacky@amd.com, pjt@google.com, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tim.c.chen@linux.intel.com, torvalds@linux-foundation.org, peterz@infradead.org, dave.hansen@intel.com In-Reply-To: <20180105160756.23786.4220.stgit@tlendack-t1.amdoffice.net> References: <20180105160756.23786.4220.stgit@tlendack-t1.amdoffice.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC Git-Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Commit-ID: 0bf17c102177d5da9363bf8b1e4704b9996d5079 Gitweb: https://git.kernel.org/tip/0bf17c102177d5da9363bf8b1e4704b9996d5079 Author: Tom Lendacky AuthorDate: Fri, 5 Jan 2018 10:07:56 -0600 Committer: Thomas Gleixner CommitDate: Sat, 6 Jan 2018 21:57:40 +0100 x86/cpu/AMD: Use LFENCE_RDTSC instead of MFENCE_RDTSC With LFENCE now a serializing instruction, set the LFENCE_RDTSC feature since the LFENCE instruction has less overhead than the MFENCE instruction. Signed-off-by: Tom Lendacky Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov Cc: Peter Zijlstra Cc: Linus Torvalds Cc: Dave Hansen Cc: Tim Chen Cc: Greg Kroah-Hartman Cc: David Woodhouse Cc: Paul Turner Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180105160756.23786.4220.stgit@tlendack-t1.amdoffice.net --- arch/x86/kernel/cpu/amd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index fbd439e..b221fe5 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -838,8 +838,8 @@ static void init_amd(struct cpuinfo_x86 *c) msr_set_bit(MSR_F10H_DECFG, MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT); - /* MFENCE stops RDTSC speculation */ - set_cpu_cap(c, X86_FEATURE_MFENCE_RDTSC); + /* A serializing LFENCE stops RDTSC speculation */ + set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); } /*