[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/3] CPUIDLE: DOM0, enable C1 FFH



Get C1 info from acpi table and pass it to Xen. It is partially backported from 
below kernel commit:

commit 991528d7348667924176f3e29addea0675298944
Author: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
Date:   Mon Sep 25 16:28:13 2006 -0700

    ACPI: Processor native C-states using MWAIT

    Intel processors starting with the Core Duo support
    support processor native C-state using the MWAIT instruction.
    Refer: Intel Architecture Software Developer's Manual
    http://www.intel.com/design/Pentium4/manuals/253668.htm

    Platform firmware exports the support for Native C-state to OS using
    ACPI _PDC and _CST methods.
    Refer: Intel Processor Vendor-Specific ACPI: Interface Specification
    http://www.intel.com/technology/iapc/acpi/downloads/302223.htm

    With Processor Native C-state, we use 'MWAIT' instruction on the processor
    to enter different C-states (C1, C2, C3).  We won't use the special IO
    ports to enter C-state and no SMM mode etc required to enter C-state.
    Overall this will mean better C-state support.

    One major advantage of using MWAIT for all C-states is, with this and
    "treat interrupt as break event" feature of MWAIT, we can now get accurate
    timing for the time spent in C1, C2, ..  states.

    Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
    Signed-off-by: Len Brown <len.brown@xxxxxxxxx>

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>

diff -r a71e987e15fc drivers/acpi/processor_idle.c
--- a/drivers/acpi/processor_idle.c     Wed Oct 29 10:12:14 2008 +0000
+++ b/drivers/acpi/processor_idle.c     Thu Oct 30 11:31:13 2008 +0800
@@ -654,7 +654,7 @@ static int acpi_processor_get_power_info
        if (nocst)
                return -ENODEV;
 
-       current_count = 1;
+       current_count = 0;
 
        /* Zero initialize C2 onwards and prepare for fresh CST lookup */
        for (i = 2; i < ACPI_PROCESSOR_MAX_POWER; i++)
@@ -728,13 +728,17 @@ static int acpi_processor_get_power_info
 
                cx.type = obj->integer.value;
 
+               /*
+                * Some buggy BIOSes won't list C1 in _CST -
+                * Let acpi_processor_get_power_info_default() handle them later
+                */
+               if (i == 1 && cx.type != ACPI_STATE_C1)
+                       current_count++;
+
                /* Following check doesn't apply to external control case */
                if (!processor_pm_external() &&
                    (cx.type != ACPI_STATE_C1) &&
                    (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO))
-                       continue;
-
-               if ((cx.type < ACPI_STATE_C2) || (cx.type > ACPI_STATE_C3))
                        continue;
 
                obj = (union acpi_object *)&(element->package.elements[2]);

Attachment: dom0-C1-FFH-20081030.patch
Description: dom0-C1-FFH-20081030.patch

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.