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

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

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, wei.w.w...@intel.com 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-08 Thread Jan Beulich
On 08.06.15 at 03:47, wei.w.w...@intel.com wrote: On 26/05/2015 21:58, Jan Beulich wrote On 13.05.16 at 09:50, wei.w.w...@intel.com wrote: +static int byt_get_min_pstate(void) +{ +u64 value; + +rdmsrl(BYT_RATIOS, value); +return (value 8) 0x7F; +} + +static int

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, wei.w.w...@intel.com wrote: On 26/05/2015 21:58, Jan Beulich wrote On 13.05.16 at 09:50, wei.w.w...@intel.com wrote: +static int byt_get_min_pstate(void) { +u64 value; + +rdmsrl(BYT_RATIOS, value); +

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, wei.w.w...@intel.com 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

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, wei.w.w...@intel.com 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 value; +

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

2015-06-02 Thread Jan Beulich
On 02.06.15 at 05:23, wei.w.w...@intel.com wrote: On 26/05/2015 21:58, Jan Beulich wrote On 13.05.16 at 09:50, wei.w.w...@intel.com wrote: +id = x86_match_cpu(intel_pstate_cpu_ids); +if (!id) +return -ENODEV; + +cpu_info = (struct cpu_defaults *)id-driver_data;

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, wei.w.w...@intel.com wrote: On 29/05/2015 16:46, Jan Beulich wrote On 29.05.15 at 10:19, wei.w.w...@intel.com wrote: On 26/05/2015 21:58, Jan Beulich wrote On 13.05.16 at 09:50, wei.w.w...@intel.com wrote: +static int intel_pstate_verify_policy(struct

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, wei.w.w...@intel.com wrote: On 26/05/2015 21:58, Jan Beulich wrote On 13.05.16 at 09:50, wei.w.w...@intel.com wrote: +static int intel_pstate_verify_policy(struct cpufreq_policy +*policy) { +

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, wei.w.w...@intel.com 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-05-29 Thread Wang, Wei W
On 26/05/2015 21:58, Jan Beulich wrote On 13.05.16 at 09:50, wei.w.w...@intel.com 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

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, wei.w.w...@intel.com wrote: On 26/05/2015 21:58, Jan Beulich wrote On 13.05.16 at 09:50, wei.w.w...@intel.com wrote: +static int intel_pstate_verify_policy(struct cpufreq_policy *policy) +{ +cpufreq_verify_within_limits(policy, policy-cpuinfo.min_freq, +

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, wei.w.w...@intel.com 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

[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.