Skip to contentSkip to conversation

x86/intel_pstate: enable xenpm to control the intel_pstate driver

PATCH In review Wei Wang 2 participants 2 messages May 13, 2015 – May 26, 2015

lore
Share & tools
lore

Wei Wang

author
#0 lore raw

PATCH v2 9/9 x86/intel_pstate: enable xenpm to control the intel_pstate driver

The intel_pstate driver receives percentage values to set the performance limits. This patch adds interfaces to support the input of percentage values to control the intel_pstate driver. Also, the "get-cpufreq-para" is modified to show percentage based feedback info.

---
 tools/libxc/include/xenctrl.h |  14 +++++-
 tools/libxc/xc_pm.c           |  17 ++++---
 tools/misc/xenpm.c            | 104 ++++++++++++++++++++++++++++++++----------
 3 files changed, 103 insertions(+), 32 deletions(-)
tools/libxc/include/xenctrl.h +12 -2
index 02d0db8..5929311 100644
@@ -2216,8 +2216,18 @@ struct xc_get_cpufreq_para {
     uint32_t scaling_cur_freq;
 
     char scaling_governor[CPUFREQ_NAME_LEN];
-    uint32_t scaling_max_freq;
-    uint32_t scaling_min_freq;
+
+    union {
+        uint32_t max_freq;
+        int32_t  max_perf_pct;
+    } scaling_max;
+
+    union {
+        uint32_t min_freq;
+        int32_t  min_perf_pct;
+    } scaling_min;
+
+    int32_t scaling_turbo_pct;
 
     /* for specific governor */
     union {
tools/libxc/xc_pm.c +10 -7
index c49d1c0..df3421a 100644
@@ -261,13 +261,16 @@ int xc_get_cpufreq_para(xc_interface *xch, int cpuid,
     }
     else
     {
-        user_para->cpuinfo_cur_freq = sys_para->cpuinfo_cur_freq;
-        user_para->cpuinfo_max_freq = sys_para->cpuinfo_max_freq;
-        user_para->cpuinfo_min_freq = sys_para->cpuinfo_min_freq;
-        user_para->scaling_cur_freq = sys_para->scaling_cur_freq;
-        user_para->scaling_max_freq = sys_para->scaling_max.max_freq;
-        user_para->scaling_min_freq = sys_para->scaling_min.min_freq;
-        user_para->turbo_enabled    = sys_para->turbo_enabled;
+        user_para->cpuinfo_cur_freq             = sys_para->cpuinfo_cur_freq;
+        user_para->cpuinfo_max_freq             = sys_para->cpuinfo_max_freq;
+        user_para->cpuinfo_min_freq             = sys_para->cpuinfo_min_freq;
+        user_para->scaling_cur_freq             = sys_para->scaling_cur_freq;
+        user_para->scaling_max.max_freq         = sys_para->scaling_max.max_freq;
+        user_para->scaling_min.min_freq         = sys_para->scaling_min.min_freq;
+        user_para->scaling_max.max_perf_pct     = sys_para->scaling_max.max_perf_pct;
+        user_para->scaling_min.min_perf_pct     = sys_para->scaling_min.min_perf_pct;
+        user_para->scaling_turbo_pct            = sys_para->scaling_turbo_pct;
+        user_para->turbo_enabled                = sys_para->turbo_enabled;
 
         memcpy(user_para->scaling_driver,
                 sys_para->scaling_driver, CPUFREQ_NAME_LEN);
tools/misc/xenpm.c +81 -23

147 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 13.05.16 at 09:51, <[email protected]> wrote:

The intel_pstate driver receives percentage values to set the performance limits. This patch adds interfaces to support the input of percentage values to control the intel_pstate driver. Also, the "get-cpufreq-para" is modified to show percentage based feedback info.

Quoted 6 lines
---
 tools/libxc/include/xenctrl.h |  14 +++++-
 tools/libxc/xc_pm.c           |  17 ++++---
 tools/misc/xenpm.c            | 104 ++++++++++++++++++++++++++++++++----------
 3 files changed, 103 insertions(+), 32 deletions(-)

This should be titled "tools: ..." or some such, and be Cc-ed to the tools maintainers (all of them) rather than the hypervisor ones.

Jan