From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932164AbbI2Bry (ORCPT ); Mon, 28 Sep 2015 21:47:54 -0400 Received: from mga11.intel.com ([192.55.52.93]:54018 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754858AbbI2Brw (ORCPT ); Mon, 28 Sep 2015 21:47:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,605,1437462000"; d="scan'208";a="570193788" Date: Tue, 29 Sep 2015 09:47:49 +0800 From: Haozhong Zhang To: Paolo Bonzini Cc: kvm@vger.kernel.org, Gleb Natapov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Joerg Roedel , Wanpeng Li , Xiao Guangrong , Mihai =?utf-8?B?RG9uyJt1?= , Andy Lutomirski , Kai Huang , linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/12] KVM: x86: Move TSC scaling logic out of call-back adjust_tsc_offset() Message-ID: <20150929014749.GF3583@hzzhang-OptiPlex-9020.sh.intel.com> Mail-Followup-To: Paolo Bonzini , kvm@vger.kernel.org, Gleb Natapov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Joerg Roedel , Wanpeng Li , Xiao Guangrong , Mihai =?utf-8?B?RG9uyJt1?= , Andy Lutomirski , Kai Huang , linux-kernel@vger.kernel.org References: <1443418691-24050-1-git-send-email-haozhong.zhang@intel.com> <1443418691-24050-7-git-send-email-haozhong.zhang@intel.com> <56099F9B.5090904@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56099F9B.5090904@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(vcpu, adjustment, false); > > +} > > + > > +static inline void adjust_tsc_offset_host(struct kvm_vcpu *vcpu, s64 adjustment) > > +{ > > + if (vcpu->arch.tsc_scaling_ratio != kvm_default_tsc_scaling_ratio) > > + WARN_ON(adjustment < 0); > > + adjustment = kvm_scale_tsc(vcpu, (u64) adjustment); > > + kvm_x86_ops->adjust_tsc_offset(vcpu, adjustment, true); > > +} > > You can remove the final argument to the callback (and possibly change > the callback's name to adjust_tsc_offset_guest), because it is now unused. > > Paolo Thanks! will do it. - Haozhong