|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 7/9] x86/intel_pstate: add a booting param to select the driver to load
By default, the intel_pstate driver is loaded.a If
"intel_pstate=disable" is added to the Xen booting param list,
the old pstate driver will be loaded.
Signed-off-by: Wei Wang <wei.w.wang@xxxxxxxxx>
---
xen/arch/x86/acpi/cpufreq/cpufreq.c | 9 ++++++---
xen/arch/x86/acpi/cpufreq/intel_pstate.c | 16 ++++++++++++++++
xen/include/acpi/cpufreq/processor_perf.h | 2 ++
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c
b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index fa3678d..c4daf18 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -650,9 +650,12 @@ 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)) {
+ if (no_load_intel_pstate)
+ ret = cpufreq_register_driver(&acpi_cpufreq_driver);
+ else
+ ret = intel_pstate_init();
+ } else if ((cpufreq_controller == FREQCTL_xen) &&
(boot_cpu_data.x86_vendor == X86_VENDOR_AMD))
ret = powernow_register_driver();
diff --git a/xen/arch/x86/acpi/cpufreq/intel_pstate.c
b/xen/arch/x86/acpi/cpufreq/intel_pstate.c
index f95026f..4c71a23 100644
--- a/xen/arch/x86/acpi/cpufreq/intel_pstate.c
+++ b/xen/arch/x86/acpi/cpufreq/intel_pstate.c
@@ -757,6 +757,8 @@ static struct cpufreq_driver intel_pstate_driver = {
.name = "intel_pstate",
};
+int __initdata no_load_intel_pstate = 0;
+
static int intel_pstate_msrs_not_valid(void)
{
/* Check that all the msr's we are using are valid. */
@@ -810,6 +812,9 @@ int __init intel_pstate_init(void)
if (cpuid_ecx(6) & 0x1)
set_bit(X86_FEATURE_APERFMPERF, &boot_cpu_data.x86_capability);
+ if (no_load_intel_pstate)
+ return -ENODEV;
+
id = x86_match_cpu(intel_pstate_cpu_ids);
if (!id)
return -ENODEV;
@@ -841,3 +846,14 @@ out:
xfree(all_cpu_data);
return -ENODEV;
}
+
+static int __init intel_pstate_setup(char *str)
+{
+ if (!str)
+ return -EINVAL;
+ if (!strcmp(str, "disable"))
+ no_load_intel_pstate = 1;
+
+ return 0;
+}
+custom_param("intel_pstate", intel_pstate_setup);
diff --git a/xen/include/acpi/cpufreq/processor_perf.h
b/xen/include/acpi/cpufreq/processor_perf.h
index ebff11d..4612289 100644
--- a/xen/include/acpi/cpufreq/processor_perf.h
+++ b/xen/include/acpi/cpufreq/processor_perf.h
@@ -7,6 +7,8 @@
#define XEN_PX_INIT 0x80000000
+extern int no_load_intel_pstate;
+
int intel_pstate_init(void);
int powernow_cpufreq_init(void);
unsigned int powernow_register_driver(void);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |