All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Peng <chao.p.peng@linux.intel.com>
To: He Chen <he.chen@linux.intel.com>
Cc: wei.liu2@citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, jbeulich@suse.com,
	xen-devel@lists.xenproject.org, keir@xen.org
Subject: Re: [PATCH v6 2/3] x86: add domctl cmd to set/get CDP code/data CBM
Date: Sat, 10 Oct 2015 14:11:53 +0800	[thread overview]
Message-ID: <20151010061153.GD18953@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <1444274637-6104-3-git-send-email-he.chen@linux.intel.com>

On Thu, Oct 08, 2015 at 11:23:56AM +0800, He Chen wrote:
> CDP extends CAT and provides the capacity to control L3 code & data
> cache. With CDP, one COS corresponds to two CMBs(code & data). cbm_type
> is added to distinguish different CBM operations. Besides, new domctl
> cmds are introdunced to support set/get CDP CBM. Some CAT functions to
> operation CBMs are extended to support CDP.
> 
> Signed-off-by: He Chen <he.chen@linux.intel.com>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> Changes in v6:
> * remove variable need_write and restruct code in psr_set_l3_cbm
> * remove redundant type == PSR_CBM_TYPE_L3 in psr_get_l3_cbm

Looks good to me. Just several coding style issues. With that fixed:
Reviewed-by: Chao Peng <chao.p.peng@linux.intel.com>

> +static int find_cos(struct psr_cat_cbm *map, unsigned int cos_max,
> +                    uint64_t cbm_code, uint64_t cbm_data, bool_t cdp_enabled)
> +{
> +    unsigned int cos;
> +
> +    for ( cos = 0; cos <= cos_max; cos++ )
> +    {
> +        if( map[cos].ref &&
            ^ space

> +            ((!cdp_enabled && map[cos].cbm == cbm_code) ||
> +             (cdp_enabled && map[cos].code == cbm_code &&
> +                             map[cos].data == cbm_data)))
                                                          ^space
> +            return cos;
> +    }
> +
> +    return -ENOENT;
> +}

> @@ -371,53 +450,71 @@ int psr_set_l3_cbm(struct domain *d, unsigned int socket, uint64_t cbm)
>      if ( !psr_check_cbm(info->cbm_len, cbm) )
>          return -EINVAL;
>  
> +    if ( !cdp_enabled && (type == PSR_CBM_TYPE_L3_CODE ||
> +                          type == PSR_CBM_TYPE_L3_DATA) )
> +        return -ENXIO;
> +
> +    cos_max = info->cos_max;
>      old_cos = d->arch.psr_cos_ids[socket];
>      map = info->cos_to_cbm;
>  
> -    spin_lock(&info->cbm_lock);
> -
> -    for ( cos = 0; cos <= info->cos_max; cos++ )
> +    switch( type )
            ^ space

> +
> +        /* We try to avoid writing MSR. */
> +        if ( (cdp_enabled &&
> +             (map[cos].code != cbm_code || map[cos].data != cbm_data)) ||
> +             (!cdp_enabled && map[cos].cbm != cbm_code))
                                                         ^ space 
> +        {

  reply	other threads:[~2015-10-10  6:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08  3:23 [PATCH v6 0/3] detect and initialize CDP (Code/Data Prioritization) feature He Chen
2015-10-08  3:23 ` [PATCH v6 1/3] x86: Support enable CDP by boot parameter and add get CDP status He Chen
2015-10-10  6:04   ` Chao Peng
2015-10-08  3:23 ` [PATCH v6 2/3] x86: add domctl cmd to set/get CDP code/data CBM He Chen
2015-10-10  6:11   ` Chao Peng [this message]
2015-10-08  3:23 ` [PATCH v6 3/3] tools & docs: add tools and docs support for Intel CDP He Chen
2015-10-08 10:34   ` Ian Jackson
2015-10-08 10:48   ` 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=20151010061153.GD18953@pengc-linux.bj.intel.com \
    --to=chao.p.peng@linux.intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=he.chen@linux.intel.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.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.