All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] x86: quiesce cpuidle code
Date: Fri, 11 Nov 2011 13:13:17 +0000	[thread overview]
Message-ID: <CAE2CFED.24859%keir.xen@gmail.com> (raw)
In-Reply-To: <4EBD112F0200007800060664@nat28.tlf.novell.com>

On 11/11/2011 11:12, "Jan Beulich" <JBeulich@suse.com> 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@suse.com>

Acked-by: Keir Fraser <keir@xen.org>

> --- 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@lists.xensource.com
> http://lists.xensource.com/xen-devel

      reply	other threads:[~2011-11-11 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 11:12 [PATCH] x86: quiesce cpuidle code Jan Beulich
2011-11-11 13:13 ` Keir Fraser [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE2CFED.24859%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.