From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v6 3/3] tools & docs: add tools and docs support for Intel CDP Date: Thu, 8 Oct 2015 11:48:41 +0100 Message-ID: <1444301321.1410.144.camel@citrix.com> References: <1444274637-6104-1-git-send-email-he.chen@linux.intel.com> <1444274637-6104-4-git-send-email-he.chen@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 1Zk8kk-00084G-AL for xen-devel@lists.xenproject.org; Thu, 08 Oct 2015 10:48:50 +0000 In-Reply-To: <1444274637-6104-4-git-send-email-he.chen@linux.intel.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: He Chen , xen-devel@lists.xenproject.org Cc: wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com, chao.p.peng@linux.intel.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2015-10-08 at 11:23 +0800, He Chen wrote: > This is the xl/xc changes to support Intel Code/Data Prioritization. > CAT xl commands to set/get CBMs are extended to support CDP. > Add new CDP options with CAT commands in xl interface man page. > Add description of CDP in xl-psr.markdown. > > Signed-off-by: He Chen > --- > Changes in v6: > * separate CBM headings in the output of xl psr-cat-show > * revert the numbers of SDM chapter in xl-psr.markdown > * XC_PSR_CAT_L3_CODE (DATA) => XC_PSR_CAT_L3_CBM_CODE (DATA) In this comment on v5 I mentioned that it was more important for libxl than libxc, I'm afraid that what I was trying to say was that the libxl names needed changing as well. Sorry for not clearly saying so. > +For more detailed information please refer to Intel SDM chapter > +"17.15 - Platform Shared Resource Control: Cache Allocation Technology". Looks like you missed deleting this section number. > @@ -8454,20 +8457,30 @@ static void psr_cat_print_one_domain_cbm(uint32_t domid, uint32_t socketid) > printf("%5d%25s", domid, domain_name); > free(domain_name); > > - if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_CBM, > - socketid, &cbm)) > - printf("%#16"PRIx64, cbm); > + if (!cdp_enabled) { > + if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_CBM, > + socketid, &cbm)) > + printf("%#16"PRIx64, cbm); > + } else { > + if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_CODE, > + socketid, &cbm)) > + printf("%#16"PRIx64, cbm); If this libxl_psr_cat_get_cbm(CODE) fails for some reason then this prints nothing, meaning that the following libxl_psr_cat_get_cbm(DATA) will actually print into the code column. I think you should add an: else printf("%16s", "error") (or perhaps "%-16s" for alignment, please check which looks best and decide) Please also refactor all three of these nearly identical: if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_???, socketid, &cbm)) printf("%#16"PRIx64, cbm); blocks into a helper which takes the PSR_CBM_TYPE as an argument and prints either the result or the error string with the appropriate width. > + if (!libxl_psr_cat_get_cbm(ctx, domid, LIBXL_PSR_CBM_TYPE_L3_DATA, > + socketid, &cbm)) > + printf("%#16"PRIx64, cbm); > + } >