All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Peng <chao.p.peng@linux.intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: wei.liu2@citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com,
	He Chen <he.chen@linux.intel.com>,
	ian.jackson@eu.citrix.com, xen-devel@lists.xenproject.org,
	keir@xen.org
Subject: Re: [PATCH v2 3/4] tools: add tools support for Intel CDP
Date: Wed, 9 Sep 2015 17:17:57 +0800	[thread overview]
Message-ID: <20150909091757.GR19417@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <55F00BF002000078000A1244@prv-mh.provo.novell.com>

On Wed, Sep 09, 2015 at 02:37:36AM -0600, Jan Beulich wrote:
> >>> On 09.09.15 at 10:10, <he.chen@linux.intel.com> wrote:
> > On Wed, Sep 09, 2015 at 03:32:11PM +0800, Chao Peng wrote:
> >> On Wed, Sep 09, 2015 at 01:16:47PM +0800, He Chen wrote:
> >> > @@ -304,14 +305,41 @@ int libxl_psr_cat_set_cbm(libxl_ctx *ctx, uint32_t domid,
> >> >          goto out;
> >> >      }
> >> >  
> >> > +    rc = libxl_psr_cat_get_l3_info(ctx, &info, &nr_sockets);
> >> > +    if (rc) {
> >> > +        LOGE(ERROR, "Failed to get cat info");
> >> > +        goto out;
> >> > +    }
> >> > +
> >> > +    if (!info->cdp_enabled &&
> >> > +       (type == LIBXL_PSR_CBM_TYPE_L3_CODE ||
> >> > +        type == LIBXL_PSR_CBM_TYPE_L3_DATA))
> >> > +    {
> >> > +            LOGE(ERROR, "Unable to set Code/Data CBM with CDP disabled");
> >> > +            rc = EINVAL;
> >> > +            free(info);
> >> > +            goto out;
> >> > +    }
> >> > +
> >> >      libxl_for_each_set_bit(socketid, *target_map) {
> >> >          if (socketid >= nr_sockets)
> >> >              break;
> >> > -        if (xc_psr_cat_set_domain_data(ctx->xch, domid, type, socketid, cbm)) {
> >> > +        if (info->cdp_enabled && type == LIBXL_PSR_CBM_TYPE_L3_CBM)
> >> > +        {
> >> > +            if(xc_psr_cat_set_domain_data(ctx->xch, domid,
> >> > +               LIBXL_PSR_CBM_TYPE_L3_CODE, socketid, cbm) ||
> >> > +               xc_psr_cat_set_domain_data(ctx->xch, domid,
> >> > +               LIBXL_PSR_CBM_TYPE_L3_DATA, socketid, cbm))
> >> > +            {
> >> > +                libxl__psr_cat_log_err_msg(gc, errno);
> >> > +                rc = ERROR_FAIL;
> >> > +            }
> >> 
> >> Will you merge the two if's?
> > 
> > Surely.
> 
> Surely not you mean, or else how will this ...
> 
> >> > +        } else if (xc_psr_cat_set_domain_data(ctx->xch, domid, type, socketid, cbm)) {
> 
> ... work?

Indeed. Then just ignore it.

> 
> Looking at this I'm surprised though that consumers is required to do
> two calls (and know whether CDP is enabled) when they want to set
> things up without caring for the code/data distinction. I think this
> should be taken care of in the hypervisor.

Agreed, hypervisor should take care of it for this case.

Chao

  reply	other threads:[~2015-09-09  9:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09  5:16 [PATCH v2 0/4] Intel Code/Data Prioritization(CDP) feature enabling He Chen
2015-09-09  5:16 ` [PATCH v2 1/4] x86: Support enable CDP by boot parameter and add get CDP status He Chen
2015-09-09  7:04   ` Chao Peng
2015-09-09  7:44     ` He Chen
2015-09-09  5:16 ` [PATCH v2 2/4] x86: add domctl cmd to set/get CDP code/data CBM He Chen
2015-09-09  7:24   ` Chao Peng
2015-09-09  7:35     ` Jan Beulich
2015-09-09  5:16 ` [PATCH v2 3/4] tools: add tools support for Intel CDP He Chen
2015-09-09  7:32   ` Chao Peng
2015-09-09  8:10     ` He Chen
2015-09-09  8:37       ` Jan Beulich
2015-09-09  9:17         ` Chao Peng [this message]
2015-09-09  5:16 ` [PATCH v2 4/4] docs: add document to introduce CDP command He Chen
2015-09-09  7:37 ` [PATCH v2 0/4] Intel Code/Data Prioritization(CDP) feature enabling Chao Peng
2015-09-09 12:36   ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150909091757.GR19417@pengc-linux.bj.intel.com \
    --to=chao.p.peng@linux.intel.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=he.chen@linux.intel.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.