From: Haozhong Zhang Subject: Re: [PATCH 10/13] vmx: Detect and initialize VMX RDTSC(P) scaling Date: Wed, 28 Oct 2015 00:17:44 +0800 Message-ID: <20151027161744.GA26716@hzzhang-OptiPlex-9020.sh.intel.com> References: <1443424438-13404-1-git-send-email-haozhong.zhang@intel.com> <1443424438-13404-11-git-send-email-haozhong.zhang@intel.com> <562F87D802000078000AF225@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <562F87D802000078000AF225@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Kevin Tian , Wei Liu , Ian Campbell , Stefano Stabellini , Jun Nakajima , Andrew Cooper , Ian Jackson , xen-devel@lists.xen.org, Aravind Gopalakrishnan , Suravee Suthikulpanit , Keir Fraser , Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org On Tue, Oct 27, 2015 at 07:19:04AM -0600, Jan Beulich wrote: > >>> On 28.09.15 at 09:13, wrote: > > @@ -1805,6 +1810,8 @@ void vmcs_dump_vcpu(struct vcpu *v) > > printk("IDTVectoring: info=%08x errcode=%08x\n", > > vmr32(IDT_VECTORING_INFO), vmr32(IDT_VECTORING_ERROR_CODE)); > > printk("TSC Offset = 0x%016lx\n", vmr(TSC_OFFSET)); > > + if ( v->arch.hvm_vmx.secondary_exec_control & SECONDARY_EXEC_TSC_SCALING ) > > + printk("TSC Multiplier = 0x%016lx\n", vmr(TSC_MULTIPLIER)); > > Please make this a single output line together with "TSC Offset = ..." > (vmr() can safely be used on non-existent VMCS fields). > OK. > > --- a/xen/arch/x86/hvm/vmx/vmx.c > > +++ b/xen/arch/x86/hvm/vmx/vmx.c > > @@ -151,6 +151,8 @@ static int vmx_vcpu_initialise(struct vcpu *v) > > if ( v->vcpu_id == 0 ) > > v->arch.user_regs.eax = 1; > > > > + v->arch.tsc_scaling_ratio = VMX_TSC_MULTIPLIER_DEFAULT; > > + > > return 0; > > } > > If you did this earlier in the function, then construct_vmcs() could > (more naturally) use the value from the field instead of the constant. > Yes, I'll move it before calling vmx_create_vmcs(). Thanks, Haozhong > Jan >