From: He Chen <he.chen@linux.intel.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: wei.liu2@citrix.com, ian.campbell@citrix.com,
stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com,
jbeulich@suse.com, xen-devel@lists.xenproject.org, keir@xen.org
Subject: Re: [PATCH 3/5] x86: add domctl cmd to set/get CDP code/data CBM
Date: Sun, 6 Sep 2015 15:15:12 +0800 [thread overview]
Message-ID: <20150906071512.GB29010@HE> (raw)
In-Reply-To: <55E6E48B.5060305@citrix.com>
On Wed, Sep 02, 2015 at 12:59:07PM +0100, Andrew Cooper wrote:
> On 02/09/15 09:28, He Chen wrote:
> > CDP extends CAT and provides the capacity to control L3 code & data
> > cache. With CDP, one COS correspond to two CMBs(code & data). cbm_type
> > is added to support distinguish different CBM operation. 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>
> > ---
> > xen/arch/x86/domctl.c | 33 +++++++++-
> > xen/arch/x86/psr.c | 142 ++++++++++++++++++++++++++++++++------------
> > xen/include/asm-x86/psr.h | 12 +++-
> > xen/include/public/domctl.h | 4 ++
> > 4 files changed, 150 insertions(+), 41 deletions(-)
> >
> > diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
> > index 26596dd..8e92d24 100644
> > --- a/xen/arch/x86/psr.c
> > +++ b/xen/arch/x86/psr.c
> > +static int pick_avail_cos(struct psr_cat_cbm *map, int cos_max, int old_cos)
> > +{
> > + int cos;
> > +
> > + /* If old cos is referred only by the domain, then use it. */
> > + if ( map[old_cos].ref == 1 )
> > + return old_cos;
> > +
> > + /* Then we pick an unused one, never pick 0 */
> > + for ( cos = 1; cos <= cos_max; cos++ )
> > + if ( map[cos].ref == 0 )
> > + return cos;
> > +
> > + return -EOVERFLOW;
>
> ENOENT surely, or use EOVERFLOW consistently.
>
I am not sure I got your point here. pick_avail_cos is to get an unused
COS, if succeed, it returns a positive number which means COS, but
when fail, it should return a negative number to indicate an error.
As far as I know, ENOENT is 2 and EOVERFLOW is 75, if I return ENOENT
directly, the function which call pick_avail_cos could not tell the
value is a valid COS or an error number.
Would you mind explaining in more detail for me and thanks.
next prev parent reply other threads:[~2015-09-06 7:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 8:27 [PATCH 0/5] Intel Code/Data Prioritization(CDP) feature enabling He Chen
2015-09-02 8:27 ` [PATCH 1/5] x86: detect Intel CDP feature He Chen
2015-09-02 11:12 ` Andrew Cooper
2015-09-02 8:27 ` [PATCH 2/5] x86: Support enable/disable CDP dynamically and get CDP status He Chen
2015-09-02 11:39 ` Andrew Cooper
2015-09-02 14:07 ` Jan Beulich
2015-09-02 8:28 ` [PATCH 3/5] x86: add domctl cmd to set/get CDP code/data CBM He Chen
2015-09-02 11:59 ` Andrew Cooper
2015-09-06 7:15 ` He Chen [this message]
2015-09-06 16:29 ` Andrew Cooper
2015-09-02 8:28 ` [PATCH 4/5] tools: add tools support for Intel CDP He Chen
2015-09-02 13:32 ` Wei Liu
2015-09-02 8:28 ` [PATCH 5/5] docs: add document to introduce CDP command He Chen
2015-09-02 13:32 ` Wei Liu
2015-09-02 12:08 ` [PATCH 0/5] Intel Code/Data Prioritization(CDP) feature enabling Andrew Cooper
2015-09-06 1:18 ` Chao Peng
2015-09-06 6:49 ` He Chen
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=20150906071512.GB29010@HE \
--to=he.chen@linux.intel.com \
--cc=andrew.cooper3@citrix.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).