From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v2 06/13] x86/PMU: Add public xenpmu.h Date: Mon, 23 Sep 2013 10:00:14 -0400 Message-ID: <5240496E.9000801@oracle.com> References: <1379670132-1748-1-git-send-email-boris.ostrovsky@oracle.com> <1379670132-1748-7-git-send-email-boris.ostrovsky@oracle.com> <1397205.lPPPHghazJ@amur.mch.fsc.net> <52405B3802000078000F588B@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VO6eW-0001xN-So for xen-devel@lists.xenproject.org; Mon, 23 Sep 2013 13:58:17 +0000 In-Reply-To: <52405B3802000078000F588B@nat28.tlf.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: jun.nakajima@intel.com, George.Dunlap@eu.citrix.com, jacob.shin@amd.com, eddie.dong@intel.com, Dietmar Hahn , suravee.suthikulpanit@amd.com, xen-devel List-Id: xen-devel@lists.xenproject.org On 09/23/2013 09:16 AM, Jan Beulich wrote: >>>> On 23.09.13 at 15:04, Dietmar Hahn wrote: >> Am Freitag 20 September 2013, 05:42:05 schrieb Boris Ostrovsky: >>> + uint64_t fix_counters[XENPMU_CORE2_MAX_FIXED_PMCS]; >>> + struct { >>> + uint64_t counter; >>> + uint64_t control; >>> + } arch_msr_pair[XENPMU_CORE2_MAX_ARCH_PMCS]; >>> +}; >>> + >>> +#define MAX(x, y) ((x) > (y) ? (x) : (y)) >> Maybe using MAX() from xen/kernel.h ? > Certainly not - this is a public header; a definition of MAX() is as > misplaced here. > Since I use MAX only once and only here I will just drop it and change XENPMU_MAX_CTXT_SZ which is #define XENPMU_MAX_CTXT_SZ MAX(sizeof(struct amd_vpmu_context),\ sizeof(struct core2_vpmu_context)) into #define XENPMU_MAX_CTXT_SZ (sizeof(struct amd_vpmu_context) >\ sizeof(struct core2_vpmu_context) ?\ sizeof(struct amd_vpmu_context) :\ sizeof(struct core2_vpmu_context)) -boris