From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751975AbbI2EDe (ORCPT ); Tue, 29 Sep 2015 00:03:34 -0400 Received: from mga01.intel.com ([192.55.52.88]:24584 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942AbbI2EDc (ORCPT ); Tue, 29 Sep 2015 00:03:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,606,1437462000"; d="scan'208";a="654075542" Date: Tue, 29 Sep 2015 12:03:28 +0800 From: Haozhong Zhang To: Eric Northup Cc: KVM , Gleb Natapov , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , Joerg Roedel , Wanpeng Li , Xiao Guangrong , Mihai =?utf-8?B?RG9uyJt1?= , Andy Lutomirski , Kai Huang , Linux Kernel Mailing List Subject: Re: [PATCH 00/12] KVM: x86: add support for VMX TSC scaling Message-ID: <20150929040328.GL3583@hzzhang-OptiPlex-9020.sh.intel.com> Mail-Followup-To: Eric Northup , KVM , Gleb Natapov , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , Joerg Roedel , Wanpeng Li , Xiao Guangrong , Mihai =?utf-8?B?RG9uyJt1?= , Andy Lutomirski , Kai Huang , Linux Kernel Mailing List References: <1443418691-24050-1-git-send-email-haozhong.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 09:00:39PM -0700, Eric Northup wrote: > On Sun, Sep 27, 2015 at 10:37 PM, Haozhong Zhang > wrote: > > This patchset adds support for VMX TSC scaling feature which is > > available on Intel Skylake CPU. The specification of VMX TSC scaling > > can be found at > > http://www.intel.com/content/www/us/en/processors/timestamp-counter-scaling-virtualization-white-paper.html > > > > VMX TSC scaling allows guest TSC which is read by guest rdtsc(p) > > instructions increases in a rate that is customized by the hypervisor > > and can be different than the host TSC rate. Basically, VMX TSC > > scaling adds a 64-bit field called TSC multiplier in VMCS so that, if > > VMX TSC scaling is enabled, TSC read by guest rdtsc(p) instructions > > will be calculated by the following formula: > > > > guest EDX:EAX = (Host TSC * TSC multiplier) >> 48 + VMX TSC Offset > > > > where, Host TSC = Host MSR_IA32_TSC + Host MSR_IA32_TSC_ADJUST. > > > > This patchset, when cooperating with another QEMU patchset (sent in > > another email "target-i386: save/restore vcpu's TSC rate during > > migration"), allows guest programs observe a consistent TSC rate even > > though they are migrated among machines with different host TSC rates. > > > > VMX TSC scaling shares some common logics with SVM TSC scaling which > > is already supported by KVM. Patch 1 ~ 8 move those common logics from > > SVM code to the common code. Upon them, patch 9 ~ 12 add VMX-specific > > support for VMX TSC scaling. > > reviewed-by: Eric Northup > Thank you for the review! > > > > Haozhong Zhang (12): > > KVM: x86: Collect information for setting TSC scaling ratio > > KVM: x86: Add a common TSC scaling ratio field in kvm_vcpu_arch > > KVM: x86: Add a common TSC scaling function > > KVM: x86: Replace call-back set_tsc_khz() with a common function > > KVM: x86: Replace call-back compute_tsc_offset() with a common function > > KVM: x86: Move TSC scaling logic out of call-back adjust_tsc_offset() > > KVM: x86: Move TSC scaling logic out of call-back read_l1_tsc() > > KVM: x86: Use the correct vcpu's TSC rate to compute time scale > > KVM: VMX: Enable and initialize VMX TSC scaling > > KVM: VMX: Setup TSC scaling ratio when a vcpu is loaded > > KVM: VMX: Use a scaled host TSC for guest readings of MSR_IA32_TSC > > KVM: VMX: Dump TSC multiplier in dump_vmcs() > > > > arch/x86/include/asm/kvm_host.h | 24 +++---- > > arch/x86/include/asm/vmx.h | 4 +- > > arch/x86/kvm/lapic.c | 5 +- > > arch/x86/kvm/svm.c | 113 +++-------------------------- > > arch/x86/kvm/vmx.c | 60 ++++++++-------- > > arch/x86/kvm/x86.c | 154 +++++++++++++++++++++++++++++++++++++--- > > include/linux/kvm_host.h | 21 +++++- > > 7 files changed, 221 insertions(+), 160 deletions(-) > > > > -- > > 2.4.8 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe kvm" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html