[Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-05-13 Thread Wei Wang
The intel_pstate driver is ported following its kernel code logic (commit: 93f0822d). In the kernel, a user can adjust the limits via sysfs (limits.min_sysfs_pct/max_sysfs_pct). In Xen, the policy->min_perf_pct/max_perf_pct acts as the transit station. A user interacts with it via xenpm. Signed-o

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-01 Thread Wang, Wei W
On 29/05/2015 16:46, Jan Beulich wrote > >>> On 29.05.15 at 10:19, wrote: > > On 26/05/2015 21:58, Jan Beulich wrote > >> >>> On 13.05.16 at 09:50, wrote: > >> > +static int intel_pstate_verify_policy(struct cpufreq_policy > >> > +*policy) { > >> > +cpufreq_verify_within_limits(policy, policy

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-01 Thread Jan Beulich
>>> On 01.06.15 at 11:12, wrote: > On 29/05/2015 16:46, Jan Beulich wrote >> >>> On 29.05.15 at 10:19, wrote: >> > On 26/05/2015 21:58, Jan Beulich wrote >> >> >>> On 13.05.16 at 09:50, wrote: >> >> > +static int intel_pstate_verify_policy(struct cpufreq_policy >> >> > +*policy) { >> >> > +c

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-01 Thread Wang, Wei W
On 26/05/2015 21:58, Jan Beulich wrote > >>> On 13.05.16 at 09:50, wrote: > > +id = x86_match_cpu(intel_pstate_cpu_ids); > > +if (!id) > > +return -ENODEV; > > + > > +cpu_info = (struct cpu_defaults *)id->driver_data; > > + > > +copy_pid_params(&cpu_info->pid_policy); > > +

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-01 Thread Jan Beulich
>>> On 02.06.15 at 05:23, wrote: > On 26/05/2015 21:58, Jan Beulich wrote >> >>> On 13.05.16 at 09:50, wrote: >> > +id = x86_match_cpu(intel_pstate_cpu_ids); >> > +if (!id) >> > +return -ENODEV; >> > + >> > +cpu_info = (struct cpu_defaults *)id->driver_data; >> > + >> > +c

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-07 Thread Wang, Wei W
On 26/05/2015 21:58, Jan Beulich wrote > >>> On 13.05.16 at 09:50, wrote: > > +static int byt_get_min_pstate(void) > > +{ > > +u64 value; > > + > > +rdmsrl(BYT_RATIOS, value); > > +return (value >> 8) & 0x7F; > > +} > > + > > +static int byt_get_max_pstate(void) > > +{ > > +u64 val

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-07 Thread Jan Beulich
>>> On 08.06.15 at 03:47, wrote: > On 26/05/2015 21:58, Jan Beulich wrote >> >>> On 13.05.16 at 09:50, wrote: >> > +static int byt_get_min_pstate(void) >> > +{ >> > +u64 value; >> > + >> > +rdmsrl(BYT_RATIOS, value); >> > +return (value >> 8) & 0x7F; >> > +} >> > + >> > +static int by

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-08 Thread Wang, Wei W
On 08/06/2015 14:50, Jan Beulich wrote: > >>> On 08.06.15 at 03:47, wrote: > > On 26/05/2015 21:58, Jan Beulich wrote > >> >>> On 13.05.16 at 09:50, wrote: > >> > +static int byt_get_min_pstate(void) { > >> > +u64 value; > >> > + > >> > +rdmsrl(BYT_RATIOS, value); > >> > +return (valu

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-08 Thread Jan Beulich
>>> On 08.06.15 at 10:18, wrote: > Regarding the self-documenting related comment here, which of the following > do you think is better? > 1) > #define BYT_MIN_PSTATE_SHIFT8 > #define BYT_MAX_PSTATE_SHIFT 16 > #define BYT_PSTATE_MASK 0x7f > #define BYT

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-09 Thread Wang, Wei W
On 26/05/2015 21:58, Jan Beulich wrote > >>> On 13.05.16 at 09:50, wrote: > > +if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) { > > +limits.no_turbo = 0; > > +limits.max_perf_pct = 100; > > +limits.max_perf = int_tofp(1); > > +limits.min_perf_pct = 100; > > +

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-06-09 Thread Jan Beulich
>>> On 10.06.15 at 07:20, wrote: > On 26/05/2015 21:58, Jan Beulich wrote >> >>> On 13.05.16 at 09:50, wrote: >> > +if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) { >> > +limits.no_turbo = 0; >> > +limits.max_perf_pct = 100; >> > +limits.max_perf = int_tofp(1); >> >

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-05-26 Thread Jan Beulich
>>> On 13.05.16 at 09:50, wrote: > +static inline int ceiling_fp(int32_t x) > +{ > +int mask, ret; Please here and below, consider whether types really need to be signed. One exception: If you intend to import the Linux source file with minimal modifications, and if that indeed results in onl

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-05-29 Thread Wang, Wei W
On 26/05/2015 21:58, Jan Beulich wrote > >>> On 13.05.16 at 09:50, wrote: > > +static inline int ceiling_fp(int32_t x) { > > +int mask, ret; > > Please here and below, consider whether types really need to be signed. > One exception: If you intend to import the Linux source file with minimal

Re: [Xen-devel] [PATCH v2 6/9] x86/intel_pstate: the main boby of the intel_pstate driver

2015-05-29 Thread Jan Beulich
>>> On 29.05.15 at 10:19, wrote: > On 26/05/2015 21:58, Jan Beulich wrote >> >>> On 13.05.16 at 09:50, wrote: >> > +static int intel_pstate_verify_policy(struct cpufreq_policy *policy) >> > +{ >> > +cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, >> > +