All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Yi Sun <yi.y.sun@linux.intel.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>,
	Chao Peng <chao.p.peng@linux.intel.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v5 04/16] x86: a few optimizations to psr codes
Date: Fri, 6 Oct 2017 17:59:28 +0100	[thread overview]
Message-ID: <20171006165928.yqnxcogmrqbw74vt@MacBook-Pro-de-Roger.local> (raw)
In-Reply-To: <1506735566-5706-5-git-send-email-yi.y.sun@linux.intel.com>

On Sat, Sep 30, 2017 at 01:39:14AM +0000, Yi Sun wrote:
> This patch refines psr codes:
> 1. Change type of 'cat_init_feature' to 'bool' to remove the pointless
>    returning of error code.
> 2. Move printk in 'cat_init_feature' to reduce a return path.
> 3. Define a local variable 'ebx' in 'psr_cpu_init' to reduce calling of
>    'cpuid_count_leaf()'.
> 4. Change type of 'write_msr()' to 'uint32_t'. This is needed by later patch:
>    "x86: implement set value flow for MBA".
> 
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

You can keep my RB if the changes in the new version are the ones I
mention below.

> ---
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Chao Peng <chao.p.peng@linux.intel.com>
> 
> v1:
>     - create this patch to make codes clearer.
>       (suggested by Jan Beulich and Roger Pau Monné)
> ---
>  xen/arch/x86/psr.c | 55 +++++++++++++++++++++++++++++-------------------------
>  1 file changed, 30 insertions(+), 25 deletions(-)
> 
> diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
> index ac2ae32..c8db0c1 100644
> --- a/xen/arch/x86/psr.c
> +++ b/xen/arch/x86/psr.c
> @@ -117,7 +117,7 @@ static const struct feat_props {
>                            uint32_t data[], unsigned int array_len);
>  
>      /* write_msr is used to write out feature MSR register. */
> -    void (*write_msr)(unsigned int cos, uint32_t val, enum psr_type type);
> +    uint32_t (*write_msr)(unsigned int cos, uint32_t val, enum psr_type type);

With what Jan has requested (adjusting the value before writing it),
do you still need write_msr to return a value?

>  static const struct feat_props l2_cat_props = {
> @@ -1410,6 +1414,7 @@ static void psr_cpu_init(void)
>      unsigned int socket, cpu = smp_processor_id();
>      struct feat_node *feat;
>      struct cpuid_leaf regs;
> +    uint32_t ebx;

IIRC Jan also had some comments on the name of this variable.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-10-06 16:59 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-30  1:39 [PATCH v5 00/16] Enable Memory Bandwidth Allocation in Xen Yi Sun
2017-09-30  1:39 ` [PATCH v5 01/16] docs: create Memory Bandwidth Allocation (MBA) feature document Yi Sun
2017-10-06 14:59   ` Roger Pau Monné
2017-09-30  1:39 ` [PATCH v5 02/16] Rename PSR sysctl/domctl interfaces and xsm policy to make them be general Yi Sun
2017-10-05 11:36   ` Wei Liu
2017-10-06 16:53   ` Roger Pau Monné
2017-10-09  8:12     ` Jan Beulich
2017-09-30  1:39 ` [PATCH v5 03/16] x86: rename 'cbm_type' to 'psr_type' to make it general Yi Sun
2017-09-30  1:39 ` [PATCH v5 04/16] x86: a few optimizations to psr codes Yi Sun
2017-10-06 16:59   ` Roger Pau Monné [this message]
2017-09-30  1:39 ` [PATCH v5 05/16] x86: implement data structure and CPU init flow for MBA Yi Sun
2017-10-06 17:13   ` Roger Pau Monné
2017-09-30  1:39 ` [PATCH v5 06/16] x86: implement get hw info " Yi Sun
2017-10-06 17:16   ` Roger Pau Monné
2017-09-30  1:39 ` [PATCH v5 07/16] x86: implement get value interface " Yi Sun
2017-09-30  1:39 ` [PATCH v5 08/16] x86: implement set value flow " Yi Sun
2017-10-06 17:18   ` Roger Pau Monné
2017-09-30  1:39 ` [PATCH v5 09/16] tools: create general interfaces to support psr allocation features Yi Sun
2017-10-05 11:31   ` Wei Liu
2017-10-06 17:20   ` Roger Pau Monné
2017-09-30  1:39 ` [PATCH v5 10/16] tools: implement the new libxc get hw info interface Yi Sun
2017-10-05 11:31   ` Wei Liu
2017-10-06 17:25   ` Roger Pau Monné
2017-09-30  1:39 ` [PATCH v5 11/16] tools: implement the new libxl " Yi Sun
2017-10-05 11:31   ` Wei Liu
2017-09-30  1:39 ` [PATCH v5 12/16] tools: implement the new xl " Yi Sun
2017-10-05 11:31   ` Wei Liu
2017-09-30  1:39 ` [PATCH v5 13/16] tools: rename 'xc_psr_cat_type' to 'xc_psr_type' Yi Sun
2017-09-30  1:39 ` [PATCH v5 14/16] tools: implement new generic get value interface and MBA get value command Yi Sun
2017-10-06 17:30   ` Roger Pau Monné
2017-09-30  1:39 ` [PATCH v5 15/16] tools: implement new generic set value interface and MBA set " Yi Sun
2017-10-05 11:31   ` Wei Liu
2017-10-06 17:33   ` Roger Pau Monné
2017-09-30  1:39 ` [PATCH v5 16/16] docs: add MBA description in docs Yi Sun
2017-10-05 11:27 ` [PATCH v5 00/16] Enable Memory Bandwidth Allocation in Xen Wei Liu

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=20171006165928.yqnxcogmrqbw74vt@MacBook-Pro-de-Roger.local \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=jbeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yi.y.sun@linux.intel.com \
    /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.