From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753337AbbI1UO0 (ORCPT ); Mon, 28 Sep 2015 16:14:26 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37548 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288AbbI1UOY (ORCPT ); Mon, 28 Sep 2015 16:14:24 -0400 Subject: Re: [PATCH 06/12] KVM: x86: Move TSC scaling logic out of call-back adjust_tsc_offset() To: Haozhong Zhang , kvm@vger.kernel.org References: <1443418691-24050-1-git-send-email-haozhong.zhang@intel.com> <1443418691-24050-7-git-send-email-haozhong.zhang@intel.com> Cc: Gleb Natapov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Joerg Roedel , Wanpeng Li , Xiao Guangrong , =?UTF-8?Q?Mihai_Don=c8=9bu?= , Andy Lutomirski , Kai Huang , linux-kernel@vger.kernel.org From: Paolo Bonzini Message-ID: <56099F9B.5090904@redhat.com> Date: Mon, 28 Sep 2015 22:14:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1443418691-24050-7-git-send-email-haozhong.zhang@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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