From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [patch 1/2] KVM: x86: move nsec_to_cycles from x86.c to x86.h Date: Mon, 20 Jun 2016 22:28:02 -0300 Message-ID: <20160621012829.626422070@redhat.com> References: <20160621012801.145630514@redhat.com> Cc: Paolo Bonzini , Radim Krcmar , Alan Jenkins , Marcelo Tosatti To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50387 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753618AbcFUB37 (ORCPT ); Mon, 20 Jun 2016 21:29:59 -0400 Content-Disposition: inline; filename=move-nsecs-to-cycles Sender: kvm-owner@vger.kernel.org List-ID: Move the inline function nsec_to_cycles from x86.c to x86.h, as the next patch uses it from lapic.c. Signed-off-by: Marcelo Tosatti Index: kvm/arch/x86/kvm/x86.c =================================================================== --- kvm.orig/arch/x86/kvm/x86.c +++ kvm/arch/x86/kvm/x86.c @@ -1205,12 +1205,6 @@ static atomic_t kvm_guest_has_master_clo static DEFINE_PER_CPU(unsigned long, cpu_tsc_khz); static unsigned long max_tsc_khz; -static inline u64 nsec_to_cycles(struct kvm_vcpu *vcpu, u64 nsec) -{ - return pvclock_scale_delta(nsec, vcpu->arch.virtual_tsc_mult, - vcpu->arch.virtual_tsc_shift); -} - static u32 adjust_tsc_khz(u32 khz, s32 ppm) { u64 v = (u64)khz * (1000000 + ppm); Index: kvm/arch/x86/kvm/x86.h =================================================================== --- kvm.orig/arch/x86/kvm/x86.h +++ kvm/arch/x86/kvm/x86.h @@ -174,4 +174,10 @@ extern unsigned int min_timer_period_us; extern unsigned int lapic_timer_advance_ns; extern struct static_key kvm_no_apic_vcpu; + +static inline u64 nsec_to_cycles(struct kvm_vcpu *vcpu, u64 nsec) +{ + return pvclock_scale_delta(nsec, vcpu->arch.virtual_tsc_mult, + vcpu->arch.virtual_tsc_shift); +} #endif