All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Yi Sun <yi.y.sun@linux.intel.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org, "Wei Liu" <wei.liu2@citrix.com>,
	"Chao Peng" <chao.p.peng@linux.intel.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH v6 08/16] x86: implement set value flow for MBA
Date: Fri, 13 Oct 2017 00:56:35 -0600	[thread overview]
Message-ID: <59E07FC30200007800185E9E@prv-mh.provo.novell.com> (raw)
In-Reply-To: <20171013020204.GR11006@yi.y.sun>

>>> On 13.10.17 at 04:02, <yi.y.sun@linux.intel.com> wrote:
> On 17-10-12 03:43:26, Jan Beulich wrote:
>> >>> On 12.10.17 at 06:33, <yi.y.sun@linux.intel.com> wrote:
>> > On 17-10-11 07:38:52, Jan Beulich wrote:
>> >> >>> On 08.10.17 at 09:23, <yi.y.sun@linux.intel.com> wrote:
>> >> > --- a/xen/arch/x86/psr.c
>> >> > +++ b/xen/arch/x86/psr.c
>> >> > @@ -138,6 +138,12 @@ static const struct feat_props {
>> >> >  
>> >> >      /* write_msr is used to write out feature MSR register. */
>> >> >      void (*write_msr)(unsigned int cos, uint32_t val, enum psr_type type);
>> >> > +
>> >> > +    /*
>> >> > +     * check_val is used to check if input val fulfills SDM requirement.
>> >> > +     * Change it to valid value if SDM allows.
>> >> > +     */
>> >> > +    bool (*check_val)(const struct feat_node *feat, unsigned long *val);
>> >> 
>> >> I'm pretty sure I've said so before - "check" to me implies all r/o
>> >> inputs. Perhaps sanitize_val() or even just sanitize()?
>> >> 
>> >> And why unsigned long when the only caller has a uint32_t in its
>> >> hands?
>> >> 
>> > To be compatible with cat_check_cbm (old name is 'psr_check_cbm' in L2 series),
>> > the last parameter type is 'unsigned long'. We have discussed it in L2 patch set
>> > v9, patch 10.
>> 
>> Iirc (without checking the old thread) this was for calculations to
>> be done as unsigned long ones. If that's the only aspect here,
>> then imo this is not a valid reason for the hook's parameter type
>> to be unsigned long *.
>> 
> Because below macros used in cat_check_cbm require the input addr to be 
> unsigned
> long, we define the last parameter of cat_check_cbm to be unsigned long.
>     find_first_bit
>     find_next_zero_bit
>     find_next_bit
> 
> If you think the unsigned long is not appropriate for 'check_val', I think I
> have to define a local variable in cat_check_cbm to do the convertion.

Exactly - the use of unsigned long is specific to this function, not
generic for all implementations of the hook. The parameter type
change back then was only a simple way to avoid defining another
local variable.

Jan


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

  reply	other threads:[~2017-10-13  6:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-08  7:23 [PATCH v6 00/16] Enable Memory Bandwidth Allocation in Xen Yi Sun
2017-10-08  7:23 ` [PATCH v6 01/16] docs: create Memory Bandwidth Allocation (MBA) feature document Yi Sun
2017-10-08  7:23 ` [PATCH v6 02/16] Rename PSR sysctl/domctl interfaces and xsm policy to make them be general Yi Sun
2017-10-10 14:59   ` Jan Beulich
2017-10-08  7:23 ` [PATCH v6 03/16] x86: rename 'cbm_type' to 'psr_type' to make it general Yi Sun
2017-10-08  7:23 ` [PATCH v6 04/16] x86: a few optimizations to psr codes Yi Sun
2017-10-10 15:01   ` Jan Beulich
2017-10-08  7:23 ` [PATCH v6 05/16] x86: implement data structure and CPU init flow for MBA Yi Sun
2017-10-10 15:26   ` Jan Beulich
2017-10-08  7:23 ` [PATCH v6 06/16] x86: implement get hw info " Yi Sun
2017-10-11 13:12   ` Jan Beulich
2017-10-08  7:23 ` [PATCH v6 07/16] x86: implement get value interface " Yi Sun
2017-10-08  7:23 ` [PATCH v6 08/16] x86: implement set value flow " Yi Sun
2017-10-11 13:38   ` Jan Beulich
2017-10-12  4:33     ` Yi Sun
2017-10-12  9:43       ` Jan Beulich
2017-10-13  2:02         ` Yi Sun
2017-10-13  6:56           ` Jan Beulich [this message]
2017-10-08  7:23 ` [PATCH v6 09/16] tools: create general interfaces to support psr allocation features Yi Sun
2017-10-08  7:23 ` [PATCH v6 10/16] tools: implement the new libxc get hw info interface Yi Sun
2017-10-08  7:23 ` [PATCH v6 11/16] tools: implement the new libxl " Yi Sun
2017-10-08  7:23 ` [PATCH v6 12/16] tools: implement the new xl " Yi Sun
2017-10-08  7:23 ` [PATCH v6 13/16] tools: rename 'xc_psr_cat_type' to 'xc_psr_type' Yi Sun
2017-10-08  7:23 ` [PATCH v6 14/16] tools: implement new generic get value interface and MBA get value command Yi Sun
2017-10-08  7:24 ` [PATCH v6 15/16] tools: implement new generic set value interface and MBA set " Yi Sun
2017-10-08  7:24 ` [PATCH v6 16/16] docs: add MBA description in docs Yi Sun

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=59E07FC30200007800185E9E@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=roger.pau@citrix.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.