From: Wei Wang <wei.w.wang@intel.com>
To: jbeulich@suse.com, andrew.cooper3@citrix.com,
xen-devel@lists.xen.org, wei.liu2@citrix.com
Cc: Wei Wang <wei.w.wang@intel.com>
Subject: [PATCH v6 4/6] x86/intel_pstate: add a booting param to select the driver to load
Date: Wed, 28 Oct 2015 11:21:16 +0800 [thread overview]
Message-ID: <1446002478-16105-5-git-send-email-wei.w.wang@intel.com> (raw)
In-Reply-To: <1446002478-16105-1-git-send-email-wei.w.wang@intel.com>
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.
Also, adding the intel_pstate booting parameter to
xen-command-line.markdown.
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
---
changes in v6:
1) move the declaration of intel_pstate_init() to this patch.
docs/misc/xen-command-line.markdown | 7 +++++++
xen/arch/x86/acpi/cpufreq/cpufreq.c | 15 ++++++++++-----
xen/include/asm-x86/cpufreq.h | 2 ++
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 416e559..e57a23a 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -858,6 +858,13 @@ debug hypervisor only).
### idle\_latency\_factor
> `= <integer>`
+### intel\_pstate
+> `= <boolean>`
+
+> Default: `false`
+
+Enable the loading of the intel pstate driver.
+
### ioapic\_ack
> `= old | new`
diff --git a/xen/arch/x86/acpi/cpufreq/cpufreq.c b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index a2ba0db..d59f251 100644
--- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
@@ -40,6 +40,7 @@
#include <asm/processor.h>
#include <asm/percpu.h>
#include <asm/cpufeature.h>
+#include <asm/cpufreq.h>
#include <acpi/acpi.h>
#include <acpi/cpufreq/cpufreq.h>
@@ -647,11 +648,15 @@ 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_AMD))
+ 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();
return ret;
diff --git a/xen/include/asm-x86/cpufreq.h b/xen/include/asm-x86/cpufreq.h
index afc72df..3ff516d 100644
--- a/xen/include/asm-x86/cpufreq.h
+++ b/xen/include/asm-x86/cpufreq.h
@@ -22,6 +22,8 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
+extern int intel_pstate_init(void);
+
/*
* Maximum transition latency is in nanoseconds - if it's unknown,
* CPUFREQ_ETERNAL shall be used.
--
1.9.1
next prev parent reply other threads:[~2015-10-28 3:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 3:21 [PATCH v6 0/6] Porting the intel_pstate driver to Xen Wei Wang
2015-10-28 3:21 ` [PATCH v6 1/6] x86/intel_pstate: add some calculation related support Wei Wang
2015-11-17 17:36 ` Jan Beulich
2015-10-28 3:21 ` [PATCH v6 2/6] x86/intel_pstate: introduce the internal_governor struct Wei Wang
2015-11-20 11:48 ` Jan Beulich
2015-10-28 3:21 ` [PATCH v6 3/6] x86/intel_pstate: the main body of the intel_pstate driver Wei Wang
2015-11-20 14:09 ` Jan Beulich
2015-10-28 3:21 ` Wei Wang [this message]
2015-11-20 14:22 ` [PATCH v6 4/6] x86/intel_pstate: add a booting param to select the driver to load Jan Beulich
2015-10-28 3:21 ` [PATCH v6 5/6] x86/intel_pstate: support the use of intel_pstate in pmstat.c Wei Wang
2015-10-28 11:18 ` Wei Liu
2015-11-20 14:47 ` Jan Beulich
2015-10-28 3:21 ` [PATCH v6 6/6] tools: enable xenpm to control the intel_pstate driver Wei Wang
2015-10-28 11:36 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1446002478-16105-5-git-send-email-wei.w.wang@intel.com \
--to=wei.w.wang@intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).