Re: [PATCH 06/12] KVM: x86: Move TSC scaling logic out of call-back adjust_tsc_offset()

2015-09-28 Thread Haozhong Zhang
On Mon, Sep 28, 2015 at 10:14:19PM +0200, Paolo Bonzini wrote: > > > On 28/09/2015 07:38, Haozhong Zhang wrote: > > + > > +static inline void adjust_tsc_offset_guest(struct kvm_vcpu *vcpu, > > + s64 adjustment) > > +{ > > + kvm_x86_ops->adjust_tsc_offset(vcp

Re: [PATCH 06/12] KVM: x86: Move TSC scaling logic out of call-back adjust_tsc_offset()

2015-09-28 Thread Paolo Bonzini
On 28/09/2015 07:38, Haozhong Zhang wrote: > + > +static inline void adjust_tsc_offset_guest(struct kvm_vcpu *vcpu, > +s64 adjustment) > +{ > + kvm_x86_ops->adjust_tsc_offset(vcpu, adjustment, false); > +} > + > +static inline void adjust_tsc_offset_hos

[PATCH 06/12] KVM: x86: Move TSC scaling logic out of call-back adjust_tsc_offset()

2015-09-27 Thread Haozhong Zhang
For both VMX and SVM, if the 2nd argument of call-back adjust_tsc_offset() is the host TSC, then adjust_tsc_offset() will scale it first. This patch moves this common TSC scaling logic to its caller adjust_tsc_offset_host(). Signed-off-by: Haozhong Zhang --- arch/x86/include/asm/kvm_host.h | 13