aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2015-06-25 12:44:07 -0400
committerIngo Molnar <mingo@kernel.org>2015-07-06 09:23:28 -0400
commit4ea1636b04dbd66536fa387bae2eea463efc705b (patch)
tree02067d97d1f200b280df8df114b77f26ff1b8e89 /arch/x86/kvm/x86.c
parentfe47ae6e1a5005b2e82f7eab57b5c3820453293a (diff)
x86/asm/tsc: Rename native_read_tsc() to rdtsc()
Now that there is no paravirt TSC, the "native" is inappropriate. The function does RDTSC, so give it the obvious name: rdtsc(). Suggested-by: Borislav Petkov <bp@suse.de> Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Huang Rui <ray.huang@amd.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Len Brown <lenb@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: kvm ML <kvm@vger.kernel.org> Link: http://lkml.kernel.org/r/fd43e16281991f096c1e4d21574d9e1402c62d39.1434501121.git.luto@kernel.org [ Ported it to v4.2-rc1. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f771058cfb5c..dfa97139282d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1455,7 +1455,7 @@ static cycle_t read_tsc(void)
1455 * but no one has ever seen it happen. 1455 * but no one has ever seen it happen.
1456 */ 1456 */
1457 rdtsc_barrier(); 1457 rdtsc_barrier();
1458 ret = (cycle_t)native_read_tsc(); 1458 ret = (cycle_t)rdtsc();
1459 1459
1460 last = pvclock_gtod_data.clock.cycle_last; 1460 last = pvclock_gtod_data.clock.cycle_last;
1461 1461
@@ -1646,7 +1646,7 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
1646 return 1; 1646 return 1;
1647 } 1647 }
1648 if (!use_master_clock) { 1648 if (!use_master_clock) {
1649 host_tsc = native_read_tsc(); 1649 host_tsc = rdtsc();
1650 kernel_ns = get_kernel_ns(); 1650 kernel_ns = get_kernel_ns();
1651 } 1651 }
1652 1652
@@ -2810,7 +2810,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
2810 2810
2811 if (unlikely(vcpu->cpu != cpu) || check_tsc_unstable()) { 2811 if (unlikely(vcpu->cpu != cpu) || check_tsc_unstable()) {
2812 s64 tsc_delta = !vcpu->arch.last_host_tsc ? 0 : 2812 s64 tsc_delta = !vcpu->arch.last_host_tsc ? 0 :
2813 native_read_tsc() - vcpu->arch.last_host_tsc; 2813 rdtsc() - vcpu->arch.last_host_tsc;
2814 if (tsc_delta < 0) 2814 if (tsc_delta < 0)
2815 mark_tsc_unstable("KVM discovered backwards TSC"); 2815 mark_tsc_unstable("KVM discovered backwards TSC");
2816 if (check_tsc_unstable()) { 2816 if (check_tsc_unstable()) {
@@ -2838,7 +2838,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
2838{ 2838{
2839 kvm_x86_ops->vcpu_put(vcpu); 2839 kvm_x86_ops->vcpu_put(vcpu);
2840 kvm_put_guest_fpu(vcpu); 2840 kvm_put_guest_fpu(vcpu);
2841 vcpu->arch.last_host_tsc = native_read_tsc(); 2841 vcpu->arch.last_host_tsc = rdtsc();
2842} 2842}
2843 2843
2844static int kvm_vcpu_ioctl_get_lapic(struct kvm_vcpu *vcpu, 2844static int kvm_vcpu_ioctl_get_lapic(struct kvm_vcpu *vcpu,
@@ -6623,7 +6623,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
6623 hw_breakpoint_restore(); 6623 hw_breakpoint_restore();
6624 6624
6625 vcpu->arch.last_guest_tsc = kvm_x86_ops->read_l1_tsc(vcpu, 6625 vcpu->arch.last_guest_tsc = kvm_x86_ops->read_l1_tsc(vcpu,
6626 native_read_tsc()); 6626 rdtsc());
6627 6627
6628 vcpu->mode = OUTSIDE_GUEST_MODE; 6628 vcpu->mode = OUTSIDE_GUEST_MODE;
6629 smp_wmb(); 6629 smp_wmb();
@@ -7437,7 +7437,7 @@ int kvm_arch_hardware_enable(void)
7437 if (ret != 0) 7437 if (ret != 0)
7438 return ret; 7438 return ret;
7439 7439
7440 local_tsc = native_read_tsc(); 7440 local_tsc = rdtsc();
7441 stable = !check_tsc_unstable(); 7441 stable = !check_tsc_unstable();
7442 list_for_each_entry(kvm, &vm_list, vm_list) { 7442 list_for_each_entry(kvm, &vm_list, vm_list) {
7443 kvm_for_each_vcpu(i, vcpu, kvm) { 7443 kvm_for_each_vcpu(i, vcpu, kvm) {