All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Radim Krcmar <rkrcmar@redhat.com>,
	Alan Jenkins <alan.christopher.jenkins@gmail.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
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	[thread overview]
Message-ID: <20160621012829.626422070@redhat.com> (raw)
In-Reply-To: 20160621012801.145630514@redhat.com

[-- Attachment #1: move-nsecs-to-cycles --]
[-- Type: text/plain, Size: 1229 bytes --]

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 <mtosatti@redhat.com>

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



  reply	other threads:[~2016-06-21  1:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  1:28 [patch 0/2] fix lapic_timer_advance_ns guest triggerable unlimited delays Marcelo Tosatti
2016-06-21  1:28 ` Marcelo Tosatti [this message]
2016-06-21  1:28 ` [patch 2/2] KVM: LAPIC: cap __delay at lapic_timer_advance_ns Marcelo Tosatti
2016-06-21  1:33   ` [patch 2/2 V2] " Marcelo Tosatti
2016-06-21 12:13     ` Alan Jenkins
2016-06-21  7:53 ` [patch 0/2] fix lapic_timer_advance_ns guest triggerable unlimited delays Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160621012829.626422070@redhat.com \
    --to=mtosatti@redhat.com \
    --cc=alan.christopher.jenkins@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.