Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-03-14 Thread Jan Beulich
>>> Yi Sun 03/14/17 3:20 AM >>> >On 17-03-13 06:37:41, Jan Beulich wrote: >> >>> On 13.03.17 at 03:43, wrote: >> > On 17-03-10 02:15:20, Jan Beulich wrote: >> >> >>> On 10.03.17 at 04:21, wrote: >> >> > On 17-03-08

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-03-13 Thread Yi Sun
On 17-03-13 06:37:41, Jan Beulich wrote: > >>> On 13.03.17 at 03:43, wrote: > > On 17-03-10 02:15:20, Jan Beulich wrote: > >> >>> On 10.03.17 at 04:21, wrote: > >> > On 17-03-08 09:54:04, Jan Beulich wrote: > >> >> >>> On 15.02.17 at 09:49,

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-03-13 Thread Jan Beulich
>>> On 13.03.17 at 03:43, wrote: > On 17-03-10 02:15:20, Jan Beulich wrote: >> >>> On 10.03.17 at 04:21, wrote: >> > On 17-03-08 09:54:04, Jan Beulich wrote: >> >> >>> On 15.02.17 at 09:49, wrote: >> >> > @@ -207,6

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-03-12 Thread Yi Sun
On 17-03-10 02:15:20, Jan Beulich wrote: > >>> On 10.03.17 at 04:21, wrote: > > On 17-03-08 09:54:04, Jan Beulich wrote: > >> >>> On 15.02.17 at 09:49, wrote: > >> > @@ -207,6 +233,29 @@ static enum psr_feat_type > >> >

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-03-10 Thread Jan Beulich
>>> On 10.03.17 at 04:21, wrote: > On 17-03-08 09:54:04, Jan Beulich wrote: >> >>> On 15.02.17 at 09:49, wrote: >> > @@ -207,6 +233,29 @@ static enum psr_feat_type >> > psr_cbm_type_to_feat_type(enum cbm_type type) >> > return feat_type;

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-03-09 Thread Yi Sun
On 17-03-08 09:54:04, Jan Beulich wrote: > >>> On 15.02.17 at 09:49, wrote: [...] > > +/* > > + * get_old_val and set_new_val are a pair of functions called in order. > > + * The caller will traverse all features in the list and call both > > + *

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-03-08 Thread Jan Beulich
>>> On 15.02.17 at 09:49, wrote: > --- a/xen/arch/x86/psr.c > +++ b/xen/arch/x86/psr.c > @@ -119,6 +119,32 @@ struct feat_ops { > /* get_val is used to get feature COS register value. */ > bool (*get_val)(const struct feat_node *feat, unsigned int cos, >

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-02-27 Thread Wei Liu
On Mon, Feb 27, 2017 at 03:11:35PM +0800, Yi Sun wrote: > On 17-02-26 17:43:04, Wei Liu wrote: > > On Wed, Feb 15, 2017 at 04:49:24PM +0800, Yi Sun wrote: > > [...] > > > > > > +static unsigned int l3_cat_get_cos_num(const struct feat_node *feat) > > > +{ > > > +return 1; > > > +} > > > + >

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-02-26 Thread Yi Sun
On 17-02-26 17:43:04, Wei Liu wrote: > On Wed, Feb 15, 2017 at 04:49:24PM +0800, Yi Sun wrote: > [...] > > > > +static unsigned int l3_cat_get_cos_num(const struct feat_node *feat) > > +{ > > +return 1; > > +} > > + > > +static int l3_cat_get_old_val(uint64_t val[], > > And the length of

Re: [Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-02-26 Thread Wei Liu
On Wed, Feb 15, 2017 at 04:49:24PM +0800, Yi Sun wrote: [...] > > +static unsigned int l3_cat_get_cos_num(const struct feat_node *feat) > +{ > +return 1; > +} > + > +static int l3_cat_get_old_val(uint64_t val[], And the length of val is? How can you bound-check the access? But I *think*

[Xen-devel] [PATCH v8 09/24] x86: refactor psr: set value: assemble features value array.

2017-02-15 Thread Yi Sun
Only can one COS ID be used by one domain at one time. That means all enabled features' COS registers at this COS ID are valid for this domain at that time. When user updates a feature's value, we need make sure all other features' values are not affected. So, we firstly need assemble an array