From: Boris Ostrovsky Date: Tue, 6 Mar 2012 14:51:33 +0000 (+0100) Subject: x86: Use deep C states for off-lined CPUs X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a8c276790d4f3e7936ef80892c991c0ab10505eb;p=xen.git 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 Committed-by: Jan Beulich --- diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c index 0102b6329e..90168548bc 100644 --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -602,6 +602,23 @@ static void acpi_dead_idle(void) __mwait(cx->address, 0); } } + else if ( current_cpu_data.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); + } + } default_halt: for ( ; ; )