WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH]ACPI: re-enable mwait for xen cpuidle

To: "Wei, Gang" <gang.wei@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH]ACPI: re-enable mwait for xen cpuidle
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Thu, 01 Apr 2010 22:40:35 -0700
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Yu, Ke" <ke.yu@xxxxxxxxx>
Delivery-date: Thu, 01 Apr 2010 22:41:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E6467867A6B05E4FA831B7DF29925F5C40E677DD@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E6467867A6B05E4FA831B7DF29925F5C40E677DD@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3
On 04/01/2010 07:38 PM, Wei, Gang wrote:
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.

Why not just set or clear the MWAIT feature flag in xen_cpuid?

    J

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

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


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


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