Re: [Xen-devel] [PATCH v6 04/24] x86: refactor psr: implement CPU init and free flow.

2017-02-09 Thread Yi Sun
On 17-02-08 14:03:15, Konrad Rzeszutek Wilk wrote: > > > +static void cpu_fini_work(unsigned int cpu) > > > +{ > > > +unsigned int socket = cpu_to_socket(cpu); > > > + > > > +if ( !socket_cpumask[socket] || > > > cpumask_empty(socket_cpumask[socket]) ) > > > > I fear I don't understand

Re: [Xen-devel] [PATCH v6 04/24] x86: refactor psr: implement CPU init and free flow.

2017-02-09 Thread Yi Sun
On 17-02-08 11:34:16, Konrad Rzeszutek Wilk wrote: > > +/* No valid value so do not enable feature. */ > > +if ( !regs.a || !regs.b ) > > You use regs.d below. Would it make sense to check for that value as > well? > > Or is a value of 0 for cox_max OK? I would think so, but not exactly

Re: [Xen-devel] [PATCH v6 04/24] x86: refactor psr: implement CPU init and free flow.

2017-02-08 Thread Konrad Rzeszutek Wilk
> > +static void cpu_fini_work(unsigned int cpu) > > +{ > > +unsigned int socket = cpu_to_socket(cpu); > > + > > +if ( !socket_cpumask[socket] || cpumask_empty(socket_cpumask[socket]) ) > > I fear I don't understand this. > > Looking at 65a399ac it says: > > +.notifier_call =

Re: [Xen-devel] [PATCH v6 04/24] x86: refactor psr: implement CPU init and free flow.

2017-02-08 Thread Konrad Rzeszutek Wilk
.snip.. > +static void free_feature(struct psr_socket_info *info) > +{ > +struct feat_node *feat, *next; > + > +if ( !info ) > +return; > + > +/* > + * Free resources of features. But we do not free global feature list > + * entry, like feat_l3_cat. Although it may

[Xen-devel] [PATCH v6 04/24] x86: refactor psr: implement CPU init and free flow.

2017-02-08 Thread Yi Sun
This patch implements the CPU init and free flow including L3 CAT initialization and feature list free. Signed-off-by: Yi Sun --- v6: - use 'struct cpuid_leaf' in x86_emulate.h. - move cpuid_{,count}_leaf() helpers from cpuid.c to processor.h for external