aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authorBoris Ostrovsky <boris.ostrovsky@amd.com>2012-03-07 07:30:30 +0000
committerBoris Ostrovsky <boris.ostrovsky@amd.com>2012-03-07 07:30:30 +0000
commit92ba85ec925abeb25b7176d4963b3d7d4126e898 (patch)
tree875efe33230ae56437a41cda9210e4b01fb80a47 /xen
parent520cc68bac404b374596a550dbf5cf54beb30b8b (diff)
downloadxen-92ba85ec925abeb25b7176d4963b3d7d4126e898.tar.gz
xen-92ba85ec925abeb25b7176d4963b3d7d4126e898.tar.bz2
xen-92ba85ec925abeb25b7176d4963b3d7d4126e898.zip
x86: Use deep C states for off-lined CPUs
Currently when a core is taken off-line it is placed in C1 state (unless MONITOR/MWAIT is used). This patch allows a core to go to deeper C states resulting in significantly higher power savings. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen')
-rw-r--r--xen/arch/x86/acpi/cpu_idle.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index a675867f24..75593d146a 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -566,6 +566,7 @@ static void acpi_dead_idle(void)
{
struct acpi_processor_power *power;
struct acpi_processor_cx *cx;
+ struct cpuinfo_x86 *c = &current_cpu_data;
if ( (power = processor_powers[smp_processor_id()]) == NULL )
goto default_halt;
@@ -601,6 +602,23 @@ static void acpi_dead_idle(void)
mb();
__mwait(cx->address, 0);
}
+ }
+ else if ( c->x86_vendor == X86_VENDOR_AMD &&
+ cx->entry_method == ACPI_CSTATE_EM_SYSIO )
+ {
+ /* Intel prefers not to use SYSIO */
+
+ /* Avoid references to shared data after the cache flush */
+ u32 address = cx->address;
+ u32 pmtmr_ioport_local = pmtmr_ioport;
+
+ wbinvd();
+
+ while ( 1 )
+ {
+ inb(address);
+ inl(pmtmr_ioport_local);
+ }
}
else if ( current_cpu_data.x86_vendor == X86_VENDOR_AMD &&
cx->entry_method == ACPI_CSTATE_EM_SYSIO )