ia64/linux-2.6.18-xen.hg

changeset 719:2fb13b8cbe13

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@intel.com>
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@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: Wei Gang <gang.wei@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Oct 30 13:34:43 2008 +0000 (2008-10-30)
parents ac9a6209c679
children 61d1f2810617 be9555ea5512
files drivers/acpi/processor_idle.c
line diff
     1.1 --- a/drivers/acpi/processor_idle.c	Thu Oct 30 13:18:07 2008 +0000
     1.2 +++ b/drivers/acpi/processor_idle.c	Thu Oct 30 13:34:43 2008 +0000
     1.3 @@ -654,7 +654,7 @@ static int acpi_processor_get_power_info
     1.4  	if (nocst)
     1.5  		return -ENODEV;
     1.6  
     1.7 -	current_count = 1;
     1.8 +	current_count = 0;
     1.9  
    1.10  	/* Zero initialize C2 onwards and prepare for fresh CST lookup */
    1.11  	for (i = 2; i < ACPI_PROCESSOR_MAX_POWER; i++)
    1.12 @@ -728,15 +728,19 @@ static int acpi_processor_get_power_info
    1.13  
    1.14  		cx.type = obj->integer.value;
    1.15  
    1.16 +		/*
    1.17 +		 * Some buggy BIOSes won't list C1 in _CST -
    1.18 +		 * Let acpi_processor_get_power_info_default() handle them later
    1.19 +		 */
    1.20 +		if (i == 1 && cx.type != ACPI_STATE_C1)
    1.21 +			current_count++;
    1.22 +
    1.23  		/* Following check doesn't apply to external control case */
    1.24  		if (!processor_pm_external() &&
    1.25  		    (cx.type != ACPI_STATE_C1) &&
    1.26  		    (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO))
    1.27  			continue;
    1.28  
    1.29 -		if ((cx.type < ACPI_STATE_C2) || (cx.type > ACPI_STATE_C3))
    1.30 -			continue;
    1.31 -
    1.32  		obj = (union acpi_object *)&(element->package.elements[2]);
    1.33  		if (obj->type != ACPI_TYPE_INTEGER)
    1.34  			continue;