From: Haozhong Zhang Subject: Re: [PATCH 03/13] x86/hvm: Collect information of TSC scaling ratio Date: Thu, 22 Oct 2015 23:57:57 +0800 Message-ID: <20151022155757.GC16418@hzzhang-OptiPlex-9020.sh.intel.com> References: <1443424438-13404-1-git-send-email-haozhong.zhang@intel.com> <1443424438-13404-4-git-send-email-haozhong.zhang@intel.com> <5628F86702000078000AD8D1@prv-mh.provo.novell.com> <20151022144044.GA16418@hzzhang-OptiPlex-9020.sh.intel.com> <5629140102000078000AD976@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: <5629140102000078000AD976@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 Thu, Oct 22, 2015 at 08:51:13AM -0600, Jan Beulich wrote: > >>> On 22.10.15 at 16:40, wrote: > > On Thu, Oct 22, 2015 at 06:53:27AM -0600, Jan Beulich wrote: > >> >>> On 28.09.15 at 09:13, wrote: > >> > --- a/xen/include/asm-x86/hvm/svm/svm.h > >> > +++ b/xen/include/asm-x86/hvm/svm/svm.h > >> > @@ -96,6 +96,7 @@ extern u32 svm_feature_flags; > >> > > >> > /* TSC rate */ > >> > #define DEFAULT_TSC_RATIO 0x0000000100000000ULL > >> > +#define MAX_TSC_RATIO 0x000000ffffffffffULL > >> > #define TSC_RATIO_RSVD_BITS 0xffffff0000000000ULL > >> > >> How about > >> > >> #define MAX_TSC_RATIO (~TSC_RATIO_RSVD_BITS) > > > > Yes. > > > >> ? (But of course it's not really clear in which way this is to > >> be used as "maximum" without seeing the code using it. I.e. > >> it's not clear whether you don't really just mean to specify > >> all the valid bits in the MSR.) > > > > The reserved bits are used to calculate the maximum TSC ratio which is > > used in hvm_setup_tsc_scaling() in patch 4 to check the whether a TSC > > scaling ratio is legal. > > The main motivation behind the comment was to understand > whether one of the two constants wouldn't suffice. > Yes, either one itself is suffice. I'll only use the max ratio in the next version (especially that VMX TSC scaling does not reserve any bits) > Jan >