All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: Yang Z Zhang <yang.z.zhang@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Keir Fraser <keir@xen.org>, Gang Wei <gang.wei@intel.com>
Subject: Re: expose MWAIT to dom0
Date: Mon, 15 Aug 2011 08:44:55 -0400	[thread overview]
Message-ID: <20110815124455.GA8183@dumpdata.com> (raw)
In-Reply-To: <4E48EEB50200007800051398@nat28.tlf.novell.com>

On Mon, Aug 15, 2011 at 09:02:29AM +0100, Jan Beulich wrote:
> >>> On 15.08.11 at 07:35, "Tian, Kevin" <kevin.tian@intel.com> wrote:
> > There're basically two methods to enter a given C-state: legacy (hlt + I/O 
> > read),
> > and native(using mwait). MWAIT is always preferred when both underlying CPU
> > and OS support, which is a more efficient way to conduct C-state transition.
> > 
> > Xen PM relies on Dom0 to parse ACPI Cx/Px information, which involves one
> > step to notify BIOS about a set of capabilities supported by OSPM. One 
> > capability
> > is about mwait support, which if true ACPI Cx entry contains entry 
> > parameters 
> > for mwait, or else I/O port information is provided. Xen PM later decides 
> > entry
> > method (i/o or mwait) based on parsed ACPI information from dom0.
> > 
> > However Xen doesn't expose MWAIT capability to dom0 due to changeset 17573:
> > 
> > This then brings a problem to Dom0 which thinks underlying CPU
> > doesn't report mwait, and thus notify BIOS to use old I/O based method.
> > 
> > Later a trick is integrated in Jeremy's pvops tree:
> > 
> > --- a/arch/x86/kernel/acpi/processor.c
> > +++ b/arch/x86/kernel/acpi/processor.c
> > @@ -60,7 +60,7 @@ static void init_intel_pdc(struct acpi_processor *pr, 
> > struct cpuinfo_x86 *c)
> >         /*
> >          * If mwait/monitor is unsupported, C2/C3_FFH will be disabled
> >          */
> > -       if (!cpu_has(c, X86_FEATURE_MWAIT))
> > +       if (!cpu_has(c, X86_FEATURE_MWAIT) && !xen_initial_domain())
> >                 buf[2] &= ~(ACPI_PDC_C_C2C3_FFH);
> >  
> >         obj->type = ACPI_TYPE_BUFFER;
> > 
> > Above trick is ugly and error-prone, since it always enable mwait regardless 
> > of actual CPU capability.
> 
> 3.x (and later 2.6.3x) don't look at the CPUID flag anymore, they just
> check boot_option_idle_override, which is being controlled from the
> command line or enforced for some particular systems based on DMI
> data.

Or in case when running under Xen (dom0):
(arch/x86/xen/setup.c)

428         disable_cpuidle();
429         boot_option_idle_override = IDLE_HALT;

Which ends up calling the xen_safe_halt which does the yield hypercall.

  parent reply	other threads:[~2011-08-15 12:44 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15  5:35 expose MWAIT to dom0 Tian, Kevin
2011-08-15  6:54 ` Keir Fraser
2011-08-15  7:13   ` Tian, Kevin
2011-08-15  7:44     ` Keir Fraser
2011-08-15  7:57       ` Tian, Kevin
2011-08-15  8:10         ` Keir Fraser
2011-08-15  8:14           ` Tian, Kevin
2011-08-15  8:41             ` Jan Beulich
2011-08-15  9:02             ` Keir Fraser
2011-08-16  5:34               ` Tian, Kevin
2011-08-16  6:31                 ` Keir Fraser
2011-08-15  8:12         ` Jan Beulich
2011-08-15  8:25           ` Tian, Kevin
2011-08-15  8:02 ` Jan Beulich
2011-08-15  8:09   ` Tian, Kevin
2011-08-15  8:18     ` Jan Beulich
2011-08-15 10:29     ` Jan Beulich
2011-08-16  6:03       ` Tian, Kevin
2011-08-16  6:42         ` Jan Beulich
2011-08-16  6:53           ` Tian, Kevin
2011-08-16  8:13             ` Jan Beulich
2011-08-16  8:29               ` Tian, Kevin
2011-08-16  8:45                 ` Jan Beulich
2011-08-16  8:50                   ` Tian, Kevin
2011-08-15 12:44   ` Konrad Rzeszutek Wilk [this message]
2011-08-18 12:35 Jan Beulich
2011-08-19  1:31 ` Tian, Kevin
2011-08-19  8:10   ` Jan Beulich
2011-08-19  8:34     ` Tian, Kevin
2011-08-19  9:32       ` Jan Beulich
2011-08-19  9:39         ` Tian, Kevin
2011-08-19 12:55           ` Jan Beulich
2011-08-19 15:01           ` Jan Beulich
2011-08-21  5:26             ` Tian, Kevin
2011-08-25 12:37               ` Jan Beulich
2011-08-26  2:18                 ` Tian, Kevin
2011-09-05  8:14                   ` Jan Beulich

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=20110815124455.GA8183@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@novell.com \
    --cc=gang.wei@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yang.z.zhang@intel.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.