xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]ACPI: re-enable mwait for xen cpuidle
@ 2010-04-02  2:38 Wei, Gang
  2010-04-02  5:40 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 13+ messages in thread
From: Wei, Gang @ 2010-04-02  2:38 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com; +Cc: Jeremy Fitzhardinge, Keir Fraser, Yu, Ke

[-- Attachment #1: Type: text/plain, Size: 1712 bytes --]

I suggest including this patch in Xen 4.0 release. It is quite straightforward, and make sure the better and widely equipped cpu idle entry method MWAIT is used by xen if available.

BTW, can we consider re-open MWAIT freature for dom0 in xen hypervisor? We can discuss it post 4.0. 

Jimmy

ACPI: re-enable mwait for xen cpuidle

Xen hypervisor doesn't export mwait feature to dom0, but latest Linux kernel start to check this feature while initializing _PDC object. Bypass such check in pv-ops case to re-enable mwait for xen cpuidle.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Yu Ke <ke.yu@intel.com>

diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
index 8c9526d..d88866c 100644
--- a/arch/x86/kernel/acpi/processor.c
+++ b/arch/x86/kernel/acpi/processor.c
@@ -60,7 +60,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
 	/*
 	 * If mwait/monitor is unsupported, C2/C3_FFH will be disabled
 	 */
-	if (!cpu_has(c, X86_FEATURE_MWAIT))
+	if (!cpu_has(c, X86_FEATURE_MWAIT) && !xen_initial_domain())
 		buf[2] &= ~(ACPI_PDC_C_C2C3_FFH);
 
 	obj->type = ACPI_TYPE_BUFFER;
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 22baf4c..0a81637 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -419,7 +419,8 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
 				cx.entry_method = ACPI_CSTATE_HALT;
 				snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI HLT");
 			} else {
-				continue;
+				if (!xen_initial_domain())
+					continue;
 			}
 			if (cx.type == ACPI_STATE_C1 &&
 					(idle_halt || idle_nomwait)) {

[-- Attachment #2: re-enable-mwait_pv-ops-dom0.patch --]
[-- Type: application/octet-stream, Size: 1382 bytes --]

ACPI: re-enable mwait for xen cpuidle

Xen hypervisor doesn't export mwait feature to dom0, but latest Linux kernel start to check this feature while initializing _PDC object. Bypass such check in pv-ops case to re-enable mwait for xen cpuidle.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Yu Ke <ke.yu@intel.com>

diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
index 8c9526d..d88866c 100644
--- a/arch/x86/kernel/acpi/processor.c
+++ b/arch/x86/kernel/acpi/processor.c
@@ -60,7 +60,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
 	/*
 	 * If mwait/monitor is unsupported, C2/C3_FFH will be disabled
 	 */
-	if (!cpu_has(c, X86_FEATURE_MWAIT))
+	if (!cpu_has(c, X86_FEATURE_MWAIT) && !xen_initial_domain())
 		buf[2] &= ~(ACPI_PDC_C_C2C3_FFH);
 
 	obj->type = ACPI_TYPE_BUFFER;
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 22baf4c..0a81637 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -419,7 +419,8 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
 				cx.entry_method = ACPI_CSTATE_HALT;
 				snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI HLT");
 			} else {
-				continue;
+				if (!xen_initial_domain())
+					continue;
 			}
 			if (cx.type == ACPI_STATE_C1 &&
 					(idle_halt || idle_nomwait)) {

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

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

end of thread, other threads:[~2010-04-06  1:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-02  2:38 [PATCH]ACPI: re-enable mwait for xen cpuidle Wei, Gang
2010-04-02  5:40 ` Jeremy Fitzhardinge
2010-04-02  6:32   ` Wei, Gang
2010-04-02  9:34     ` Wei, Gang
2010-04-02 13:41       ` Wei, Gang
2010-04-02 14:27         ` Keir Fraser
2010-04-02 14:46           ` Keir Fraser
2010-04-02 15:18             ` Wei, Gang
2010-04-02 16:27       ` Wei, Gang
2010-04-02 18:33         ` Jeremy Fitzhardinge
2010-04-03 14:07           ` Wei, Gang
2010-04-05 18:30             ` Jeremy Fitzhardinge
2010-04-06  1:46               ` Wei, Gang

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