[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/3] vpmu intel: Use PMU defines instead of numerals and bit masks


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxx>
  • Date: Thu, 28 Mar 2013 13:50:14 +0100
  • Cc: Eddie Dong <eddie.dong@xxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, suravee.suthikulpanit@xxxxxxx, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
  • Delivery-date: Thu, 28 Mar 2013 12:50:36 +0000
  • Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:From:To:Cc:Subject:Date:Message-ID: User-Agent:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type; b=XVJ3aJNejqpCpFLoPa0BGpIhu3abewAGABfruskwFS4Yx7MwzhXB7A3L gO1FYgamoPZnAJ5tr/JY3BwooT6C0aSDWYJpYXpsRDxGf2zxSH+w3MMT8 Gt1XBNQ3oOmLqc5/yCoCx+0vlzjqY90xVUGvJnu2aBoREuV2NdBgYrYZx 2KOhT9KsWH+TChUFMTDtRGXXxtn2LZigFG1hK0mwXheoVAXctm4f8iZe6 W1t6OvAS7zvAZQHYlvAYHXJyZnzp9;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Am Mittwoch 27 MÃrz 2013, 11:25:41 schrieb Konrad Rzeszutek Wilk:
> On Wed, Mar 27, 2013 at 03:13:13PM +0100, Dietmar Hahn wrote:

> >  
> >  /*
> > + * See Intel SDM Vol 2a Instruction Set Referenc for CPUID instruction.
> > + * cpuid 0xa - Architectural Performance Monitoring Leaf
> 
> Chapter ?

OK.

> 
> > + * Register eax
> > + */
> > +#define X86_FEATURE_PMU_VER_OFF   0  /* Version ID */
> > +#define FEATURE_PMU_VER_BITS      8  /* 8 bits 0..7 */
> > +#define X86_FEATURE_NUM_GEN_OFF   8  /* Number of general pmu registers */
> > +#define FEATURE_NUM_GEN_BITS      8  /* 8 bits 8..15 */
> > +#define X86_FEATURE_GEN_WIDTH_OFF 16 /* Width of general pmu registers */
> > +#define FEATURE_GEN_WIDTH_BITS    8  /* 8 bits 16..23 */
> > +/* Register edx */
> > +#define X86_FEATURE_NUM_FIX_OFF   0  /* Number of fixed pmu registers */
> > +#define FEATURE_NUM_FIX_BITS      5  /* 5 bits 0..4 */
> > +#define X86_FEATURE_FIX_WIDTH_OFF 5  /* Width of fixed pmu registers */
> > +#define FEATURE_FIX_WIDTH_BITS    8  /* 8 bits 5..12 */
> 
> I think the 'X86_FEATURE' and 'FEATURE' could be just chopped off?
> Then it is 'PMU_VER_BITS' or 'NUM_GEN_OFF'.  Perhaps also have the
> mask in there?
> 
> That way you can could do:
> 
> PMU_VERSION_SHIFT
> PMU_VERSION_MASK
> 
> And just use those in the logic below.
> 
> And for the other:
> 
> PMU_GENERAL_NR_SHIFT
> PMU_GENERAL_NR_MASK
> and
> PMU_FIXED_NR_SHIFT
> PMU_FIXED_NR_MASK?
> 
> PMU_FIXED_WIDTH_SHIFT
> ... and so on.

Yes, this is much better. Will send another version.
Thanks.

Dietmar


-- 
Company details: http://ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.