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-changelog

[Xen-changelog] [xen-unstable] CPUIDLE: Handle C2 LAPIC timer & TSC stop

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] CPUIDLE: Handle C2 LAPIC timer & TSC stop
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Sep 2008 07:30:47 -0700
Delivery-date: Mon, 22 Sep 2008 07:30:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1222079042 -3600
# Node ID e61c7833dc9d87eb7fb41f47d2377370aa9a0b46
# Parent  9cc4cebee50bbf3869b54899919feb899220ad2a
CPUIDLE: Handle C2 LAPIC timer & TSC stop

ACPI C2 is quite possible mapped to CPU C3 or deeper state, so
thinking from worst cases, enable C3 like entry/exit handling for C2
by default. Option 'lapic_timer_c2_ok' can be used to select simple C2
entry/exit only if the user make sure that LAPIC tmr & TSC will not be
stop during C2.

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
---
 xen/arch/x86/acpi/cpu_idle.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff -r 9cc4cebee50b -r e61c7833dc9d xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c      Mon Sep 22 11:21:31 2008 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c      Mon Sep 22 11:24:02 2008 +0100
@@ -63,6 +63,8 @@ static void (*pm_idle_save) (void) __rea
 static void (*pm_idle_save) (void) __read_mostly;
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
 integer_param("max_cstate", max_cstate);
+static int local_apic_timer_c2_ok __read_mostly = 0;
+boolean_param("lapic_timer_c2_ok", local_apic_timer_c2_ok);
 
 static struct acpi_processor_power processor_powers[NR_CPUS];
 
@@ -267,18 +269,21 @@ static void acpi_processor_idle(void)
         break;
 
     case ACPI_STATE_C2:
-        /* Get start time (ticks) */
-        t1 = inl(pmtmr_ioport);
-        /* Invoke C2 */
-        acpi_idle_do_entry(cx);
-        /* Get end time (ticks) */
-        t2 = inl(pmtmr_ioport);
-
-        /* Re-enable interrupts */
-        local_irq_enable();
-        /* Compute time (ticks) that we were actually asleep */
-        sleep_ticks = ticks_elapsed(t1, t2);
-        break;
+        if ( local_apic_timer_c2_ok )
+        {
+            /* Get start time (ticks) */
+            t1 = inl(pmtmr_ioport);
+            /* Invoke C2 */
+            acpi_idle_do_entry(cx);
+            /* Get end time (ticks) */
+            t2 = inl(pmtmr_ioport);
+
+            /* Re-enable interrupts */
+            local_irq_enable();
+            /* Compute time (ticks) that we were actually asleep */
+            sleep_ticks = ticks_elapsed(t1, t2);
+            break;
+        }
 
     case ACPI_STATE_C3:
         /*

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] CPUIDLE: Handle C2 LAPIC timer & TSC stop, Xen patchbot-unstable <=