xen-devel.lists.xenproject.org archive mirror
 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 1/3] x86: Support enable CDP by boot parameter and add get CDP status
Date: Sat, 10 Oct 2015 14:04:48 +0800	[thread overview]
Message-ID: <20151010060448.GC18953@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <1444274637-6104-2-git-send-email-he.chen@linux.intel.com>

> +        if ( (ecx & PSR_CAT_CDP_CAPABILITY) && (opt_psr & PSR_CDP) &&
> +             cdp_socket_enable && !test_bit(socket, cdp_socket_enable) )
> +        {
> +            rdmsrl(MSR_IA32_PSR_L3_QOS_CFG, val);
> +            wrmsrl(MSR_IA32_PSR_L3_QOS_CFG, val | (1 << PSR_L3_QOS_CDP_ENABLE_BIT));
> +
> +            info->cos_to_cbm[0].code = (1ull << info->cbm_len) - 1;
> +            info->cos_to_cbm[0].data = (1ull << info->cbm_len) - 1;
> +
> +            /* We only write mask1 since mask0 is always all ones by default. */
> +            wrmsrl(MSR_IA32_PSR_L3_MASK(1), (1ull << info->cbm_len) - 1);

Although I think it maybe not a big deal here, I'd suggest doing this
before you actually turning CDP on (writing MSR_IA32_PSR_L3_QOS_CFG above)
as strictly speaking before we enabling CDP the data mask(mask1) for cos0
should already be initialised.

> +
> +            /* Cut half of cos_max when CDP is enabled. */
> +            info->cos_max >>= 1;
> +
> +            set_bit(socket, cdp_socket_enable);
> +        }
> +        printk(XENLOG_INFO "CAT: enabled on socket %u, cos_max:%u, cbm_len:%u, CDP:%s\n",
> +               socket, info->cos_max, info->cbm_len,
> +               cdp_is_enabled(socket) ? "on" : "off");
>      }
>  }
>  
> @@ -513,6 +551,7 @@ static void cat_cpu_fini(unsigned int cpu)
>              xfree(info->cos_to_cbm);
>              info->cos_to_cbm = NULL;
>          }
> +        clear_bit(socket, cdp_socket_enable);

Is it possible for cdp_socket_enable to be NULL? e.g. in the case when
CDP failed to initilize. You can check if it works for cat-only mode.

Chao
>          clear_bit(socket, cat_socket_enable);
>      }

  reply	other threads:[~2015-10-10  6:09 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 [this message]
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
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=20151010060448.GC18953@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).