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] x86: quiesce cpuidle code

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: quiesce cpuidle code
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 11 Nov 2011 21:11:09 +0000
Delivery-date: Fri, 11 Nov 2011 13:11:43 -0800
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 Jan Beulich <jbeulich@xxxxxxxx>
# Date 1321017916 -3600
# Node ID 8b08b2166aa82e7df0b1fa620ed57078810f8c12
# Parent  4699decb8424a00447c466205be3cb4d0fb95a76
x86: quiesce cpuidle code

So far these messages got pointlessly (as the code in other places
assumes symmetric configuration) emitted once per CPU. Hide the debug
one behind opt_cpu_info, and issue the info one just once (if the code
gets adjusted to support assymtric configurations, this would need to
be revisited, but ideally without producing per-CPU messages again).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 4699decb8424 -r 8b08b2166aa8 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c      Fri Nov 11 12:06:01 2011 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c      Fri Nov 11 14:25:16 2011 +0100
@@ -663,6 +663,8 @@
     unsigned int edx_part;
     unsigned int cstate_type; /* C-state type and not ACPI C-state type */
     unsigned int num_cstate_subtype;
+    int ret = 0;
+    static unsigned long printed;
 
     if ( c->cpuid_level < CPUID_MWAIT_LEAF )
     {
@@ -671,8 +673,9 @@
     }
 
     cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx);
-    printk(XENLOG_DEBUG "cpuid.MWAIT[.eax=%x, .ebx=%x, .ecx=%x, .edx=%x]\n",
-           eax, ebx, ecx, edx);
+    if ( opt_cpu_info )
+        printk(XENLOG_DEBUG "cpuid.MWAIT[eax=%x ebx=%x ecx=%x edx=%x]\n",
+               eax, ebx, ecx, edx);
 
     /* Check whether this particular cx_type (in CST) is supported or not */
     cstate_type = (cx->reg.address >> MWAIT_SUBSTATE_SIZE) + 1;
@@ -680,15 +683,16 @@
     num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK;
 
     if ( num_cstate_subtype < (cx->reg.address & MWAIT_SUBSTATE_MASK) )
-        return -EFAULT;
-
+        ret = -ERANGE;
     /* mwait ecx extensions INTERRUPT_BREAK should be supported for C2/C3 */
-    if ( !(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) ||
-         !(ecx & CPUID5_ECX_INTERRUPT_BREAK) )
-        return -EFAULT;
-
-    printk(XENLOG_INFO "Monitor-Mwait will be used to enter C-%d state\n", 
cx->type);
-    return 0;
+    else if ( !(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) ||
+              !(ecx & CPUID5_ECX_INTERRUPT_BREAK) )
+        ret = -ENODEV;
+    else if ( opt_cpu_info || cx->type >= BITS_PER_LONG ||
+              !test_and_set_bit(cx->type, &printed) )
+        printk(XENLOG_INFO "Monitor-Mwait will be used to enter C%d state\n",
+               cx->type);
+    return ret;
 }
 
 /*

_______________________________________________
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] x86: quiesce cpuidle code, Xen patchbot-unstable <=