From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 1/2] mwait_idle: Disable Baytrail Core and Module C6 auto-demotion
Date: Mon, 8 Sep 2014 13:42:06 +0100 [thread overview]
Message-ID: <1410180127-4812-1-git-send-email-ross.lagerwall@citrix.com> (raw)
From: Len Brown <len.brown@intel.com>
Power efficiency improves on Baytrail (Intel Atom Processor E3000)
when C6 auto-demotion is disabled.
Based on work by Srinidhi Kasagar <srinidhi.kasagar@intel.com>.
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
xen/arch/x86/cpu/mwait-idle.c | 7 +++++++
xen/include/asm-x86/msr-index.h | 3 +++
2 files changed, 10 insertions(+)
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index c2c8889..2c5864e 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -88,6 +88,7 @@ struct idle_cpu {
* Indicate which enable bits to clear here.
*/
unsigned long auto_demotion_disable_flags;
+ bool_t byt_auto_demotion_disable_flag;
bool_t disable_promotion_to_c1e;
};
@@ -569,6 +570,7 @@ static const struct idle_cpu idle_cpu_snb = {
static const struct idle_cpu idle_cpu_byt = {
.state_table = byt_cstates,
.disable_promotion_to_c1e = 1,
+ .byt_auto_demotion_disable_flag = 1,
};
static const struct idle_cpu idle_cpu_ivb = {
@@ -767,6 +769,11 @@ static int mwait_idle_cpu_init(struct notifier_block *nfb,
if (icpu->auto_demotion_disable_flags)
on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
+ if (icpu->byt_auto_demotion_disable_flag) {
+ wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0);
+ wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0);
+ }
+
if (icpu->disable_promotion_to_c1e)
on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 2056501..7e13742 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -102,6 +102,9 @@
#define CMCI_EN (1UL<<30)
#define CMCI_THRESHOLD_MASK 0x7FFF
+#define MSR_CC6_DEMOTION_POLICY_CONFIG 0x00000668
+#define MSR_MC6_DEMOTION_POLICY_CONFIG 0x00000669
+
#define MSR_AMD64_MC0_MASK 0xc0010044
#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x))
--
1.9.3
next reply other threads:[~2014-09-08 12:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 12:42 Ross Lagerwall [this message]
2014-09-08 12:42 ` [PATCH 2/2] mwait_idle: Broadwell support Ross Lagerwall
2014-09-08 13:24 ` Jan Beulich
2014-10-16 12:54 ` Chen, Tiejun
2014-10-16 14:06 ` Jan Beulich
2014-10-17 1:22 ` Chen, Tiejun
2014-10-17 8:40 ` Jan Beulich
2014-10-24 3:02 ` Chen, Tiejun
2014-10-17 1:00 ` Chen, Tiejun
2014-09-08 13:22 ` [PATCH 1/2] mwait_idle: Disable Baytrail Core and Module C6 auto-demotion Jan Beulich
2014-09-08 14:02 ` Ross Lagerwall
2014-09-08 14:20 ` Jan Beulich
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=1410180127-4812-1-git-send-email-ross.lagerwall@citrix.com \
--to=ross.lagerwall@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--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).