From patchwork Mon Jul 6 15:40:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot for Kobe Wu X-Patchwork-Id: 6725681 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6A8BAC05AC for ; Mon, 6 Jul 2015 15:41:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6FBA4206DB for ; Mon, 6 Jul 2015 15:41:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D42FF20497 for ; Mon, 6 Jul 2015 15:41:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752846AbbGFPlM (ORCPT ); Mon, 6 Jul 2015 11:41:12 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49266 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753530AbbGFPlH (ORCPT ); Mon, 6 Jul 2015 11:41:07 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.14.8/8.14.7) with ESMTP id t66Fe7Rk009899; Mon, 6 Jul 2015 08:40:12 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.14.8/8.14.7/Submit) id t66Fe6tr009896; Mon, 6 Jul 2015 08:40:06 -0700 Date: Mon, 6 Jul 2015 08:40:06 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Andy Lutomirski Message-ID: Cc: luto@amacapital.net, ralf@linux-mips.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, john.stultz@linaro.org, lenb@kernel.org, bp@alien8.de, kvm@vger.kernel.org, dvlasenk@redhat.com, torvalds@linux-foundation.org, brgerst@gmail.com, peterz@infradead.org, hpa@zytor.com, ray.huang@amd.com, mingo@kernel.org, bp@suse.de, luto@kernel.org, pbonzini@redhat.com Reply-To: tglx@linutronix.de, ralf@linux-mips.org, luto@amacapital.net, john.stultz@linaro.org, lenb@kernel.org, linux-kernel@vger.kernel.org, dvlasenk@redhat.com, kvm@vger.kernel.org, torvalds@linux-foundation.org, bp@alien8.de, mingo@kernel.org, luto@kernel.org, bp@suse.de, pbonzini@redhat.com, peterz@infradead.org, brgerst@gmail.com, hpa@zytor.com, ray.huang@amd.com In-Reply-To: <20615df14ae2eb713ea7a5f5123c1dc4c7ca993d.1434501121.git.luto@kernel.org> References: <20615df14ae2eb713ea7a5f5123c1dc4c7ca993d.1434501121.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/asm/tsc, kvm: Remove vget_cycles() Git-Commit-ID: 881d7bf843d7139c6dfbffdec4903b3354423c49 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit-ID: 881d7bf843d7139c6dfbffdec4903b3354423c49 Gitweb: http://git.kernel.org/tip/881d7bf843d7139c6dfbffdec4903b3354423c49 Author: Andy Lutomirski AuthorDate: Thu, 25 Jun 2015 18:43:56 +0200 Committer: Ingo Molnar CommitDate: Mon, 6 Jul 2015 15:23:25 +0200 x86/asm/tsc, kvm: Remove vget_cycles() The only caller was KVM's read_tsc(). The only difference between vget_cycles() and native_read_tsc() was that vget_cycles() returned zero instead of crashing on TSC-less systems. KVM already checks vclock_mode() before calling that function, so the extra check is unnecessary. Also, KVM (host-side) requires the TSC to exist. Signed-off-by: Andy Lutomirski Signed-off-by: Borislav Petkov Acked-by: Paolo Bonzini Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Huang Rui Cc: John Stultz Cc: Len Brown Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Ralf Baechle Cc: Thomas Gleixner Cc: kvm ML Link: http://lkml.kernel.org/r/20615df14ae2eb713ea7a5f5123c1dc4c7ca993d.1434501121.git.luto@kernel.org Signed-off-by: Ingo Molnar --- arch/x86/include/asm/tsc.h | 13 ------------- arch/x86/kvm/x86.c | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h index fd11128..3da1cc1 100644 --- a/arch/x86/include/asm/tsc.h +++ b/arch/x86/include/asm/tsc.h @@ -32,19 +32,6 @@ static inline cycles_t get_cycles(void) return ret; } -static __always_inline cycles_t vget_cycles(void) -{ - /* - * We only do VDSOs on TSC capable CPUs, so this shouldn't - * access boot_cpu_data (which is not VDSO-safe): - */ -#ifndef CONFIG_X86_TSC - if (!cpu_has_tsc) - return 0; -#endif - return (cycles_t)native_read_tsc(); -} - extern void tsc_init(void); extern void mark_tsc_unstable(char *reason); extern int unsynchronized_tsc(void); diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index bbaf44e..f771058 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1455,7 +1455,7 @@ static cycle_t read_tsc(void) * but no one has ever seen it happen. */ rdtsc_barrier(); - ret = (cycle_t)vget_cycles(); + ret = (cycle_t)native_read_tsc(); last = pvclock_gtod_data.clock.cycle_last;