[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-881d7bf843d7139c6dfbffdec4903b3354423c49@git.kernel.org>
Date: Mon, 6 Jul 2015 08:40:06 -0700
From: tip-bot for Andy Lutomirski <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: luto@...capital.net, ralf@...ux-mips.org, tglx@...utronix.de,
linux-kernel@...r.kernel.org, john.stultz@...aro.org,
lenb@...nel.org, bp@...en8.de, kvm@...r.kernel.org,
dvlasenk@...hat.com, torvalds@...ux-foundation.org,
brgerst@...il.com, peterz@...radead.org, hpa@...or.com,
ray.huang@....com, mingo@...nel.org, bp@...e.de, luto@...nel.org,
pbonzini@...hat.com
Subject: [tip:x86/asm] x86/asm/tsc, kvm: Remove vget_cycles()
Commit-ID: 881d7bf843d7139c6dfbffdec4903b3354423c49
Gitweb: http://git.kernel.org/tip/881d7bf843d7139c6dfbffdec4903b3354423c49
Author: Andy Lutomirski <luto@...nel.org>
AuthorDate: Thu, 25 Jun 2015 18:43:56 +0200
Committer: Ingo Molnar <mingo@...nel.org>
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 <luto@...nel.org>
Signed-off-by: Borislav Petkov <bp@...e.de>
Acked-by: Paolo Bonzini <pbonzini@...hat.com>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Huang Rui <ray.huang@....com>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Len Brown <lenb@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ralf Baechle <ralf@...ux-mips.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: kvm ML <kvm@...r.kernel.org>
Link: http://lkml.kernel.org/r/20615df14ae2eb713ea7a5f5123c1dc4c7ca993d.1434501121.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/include/asm/tsc.h | 13 -------------
arch/x86/kvm/x86.c | 2 +-
2 files changed, 1 insertion(+), 14 deletions(-)
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists