Skip to contentSkip to conversation

x86/intel_pstate: add a booting param to select the driver to load

PATCH Superseded Wei Wang 2 participants 2 messages Jun 11, 2015 – Jun 18, 2015

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Wei Wang

author
#0 lore raw

PATCH v3 8/11 x86/intel_pstate: add a booting param to select the driver to load

By default, the old P-state driver (acpi-freq) is used. Adding "intel_pstate" to the Xen booting param list to enable the use of intel_pstate. However, if intel_pstate is enabled on a machine which does not support the driver (e.g. Nehalem), the old P-state driver will be loaded due to the failure loading of intel_pstate.

---
 xen/arch/x86/acpi/cpufreq/cpufreq.c      | 8 +++++---
 xen/arch/x86/acpi/cpufreq/intel_pstate.c | 6 ++++++
 2 files changed, 11 insertions(+), 3 deletions(-)
xen/arch/x86/acpi/cpufreq/cpufreq.c +5 -3
index fa3678d..3765fc4 100644
@@ -650,9 +650,11 @@ static int __init cpufreq_driver_init(void)
     int ret = 0;
 
     if ((cpufreq_controller == FREQCTL_xen) &&
-        (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
-        ret = cpufreq_register_driver(&acpi_cpufreq_driver);
-    else if ((cpufreq_controller == FREQCTL_xen) &&
+        (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)) {
+            ret = intel_pstate_init();
+            if (ret)
+                ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+    } else if ((cpufreq_controller == FREQCTL_xen) &&
         (boot_cpu_data.x86_vendor == X86_VENDOR_AMD))
         ret = powernow_register_driver();
 
xen/arch/x86/acpi/cpufreq/intel_pstate.c +6 -0
index 48bbc30..d1a6056 100644
@@ -749,6 +749,9 @@ static struct cpufreq_driver intel_pstate_driver = {
     .name         = "intel_pstate",
 };
 
+static bool_t __initdata load_intel_pstate;
+boolean_param("intel_pstate", load_intel_pstate);
+
 static int intel_pstate_msrs_not_valid(void)
 {
     if (!pstate_funcs.get_max() ||
@@ -785,6 +788,9 @@ int __init intel_pstate_init(void)
     const struct x86_cpu_id *id;
     struct cpu_defaults *cpu_info;
 
+    if (!load_intel_pstate)
+         return -ENODEV;
+
     id = x86_match_cpu(intel_pstate_cpu_ids);
     if (!id)
         return -ENODEV;
Signature · 1 line
1.9.1
Acked-by on v3 8/11
#1 lore raw

xen/arch/x86/acpi/cpufreq/intel_pstate.c static struct cpufreq_driver intel_pstate_driver = { · line 757

Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 11.06.15 at 10:28, <[email protected]> wrote:
xen/arch/x86/acpi/cpufreq/intel_pstate.c +3 -0
@@ -749,6 +749,9 @@ static struct cpufreq_driver intel_pstate_driver = {
     .name         = "intel_pstate",
 };
 
+static bool_t __initdata load_intel_pstate;
+boolean_param("intel_pstate", load_intel_pstate);
+
 static int intel_pstate_msrs_not_valid(void)
 {
     if (!pstate_funcs.get_max() ||

Please move this immediately ahead of the (only) function you need it in, or even inside that function. With that and with patch 9 folded into this one