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

Re: [Xen-devel] [PATCH] x86: quiesce cpuidle code

To: Jan Beulich <JBeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] x86: quiesce cpuidle code
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Fri, 11 Nov 2011 13:13:17 +0000
Cc:
Delivery-date: Fri, 11 Nov 2011 05:14:14 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=M50GkyQU3wC/EirKa8J6NfEaAEACJ4gb8xvC/IdfAkA=; b=jW4RVinYGXCzjZdJZy9BXPizjdlbyBjkfGrI3Z7PaKxhO93mdHLVNc3e8QpA2uol8y CCpZCftVwEntL/kZxZ0TGbl1g8JxULRKe6Z3j67BIqYr49skUTNF8utaUaEyHCKRnaro EWjsNWNWk1Osof8aivInlS95X+yIJEdMIwmpo=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4EBD112F0200007800060664@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acygc6zwEl8sumpCLE+yCcws9462Ig==
Thread-topic: [Xen-devel] [PATCH] x86: quiesce cpuidle code
User-agent: Microsoft-Entourage/12.31.0.110725
On 11/11/2011 11:12, "Jan Beulich" <JBeulich@xxxxxxxx> wrote:

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

> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -664,6 +664,8 @@ static int acpi_processor_ffh_cstate_pro
>      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 )
>      {
> @@ -672,8 +674,9 @@ static int acpi_processor_ffh_cstate_pro
>      }
>  
>      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;
> @@ -681,15 +684,16 @@ static int acpi_processor_ffh_cstate_pro
>      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-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

<Prev in Thread] Current Thread [Next in Thread>