xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mwait_idle: Disable Baytrail Core and Module C6 auto-demotion
@ 2014-09-08 12:42 Ross Lagerwall
  2014-09-08 12:42 ` [PATCH 2/2] mwait_idle: Broadwell support Ross Lagerwall
  2014-09-08 13:22 ` [PATCH 1/2] mwait_idle: Disable Baytrail Core and Module C6 auto-demotion Jan Beulich
  0 siblings, 2 replies; 12+ messages in thread
From: Ross Lagerwall @ 2014-09-08 12:42 UTC (permalink / raw)
  To: Xen-devel; +Cc: Keir Fraser, Jan Beulich

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-10-24  3:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-08 12:42 [PATCH 1/2] mwait_idle: Disable Baytrail Core and Module C6 auto-demotion Ross Lagerwall
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

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).