All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
	"Wei, Gang" <gang.wei@intel.com>,
	Jan Beulich <JBeulich@novell.com>
Subject: Re: expose MWAIT to dom0
Date: Tue, 16 Aug 2011 07:31:13 +0100	[thread overview]
Message-ID: <CA6FCD41.1F48E%keir.xen@gmail.com> (raw)
In-Reply-To: <625BA99ED14B2D499DC4E29D8138F15062DA3898FD@shsmsx502.ccr.corp.intel.com>




On 16/08/2011 06:34, "Tian, Kevin" <kevin.tian@intel.com> wrote:

>> From: Keir Fraser [mailto:keir.xen@gmail.com]
>> Sent: Monday, August 15, 2011 5:02 PM
>> 
>> On 15/08/2011 09:14, "Tian, Kevin" <kevin.tian@intel.com> wrote:
>> 
>>>> cpu_has() accesses a pre-filled capabilities bitmask, filled from cpuid,
>>>> right? And cpuid goes through a pv_ops hook?
>>>> 
>>> 
>>> I'm not quite catching you here. Do you want to prefill mwait bit from
>>> pv_ops
>>> hook unconditionally even in current situation where Xen doesn't expose
>>> mwait, or selectively under some dom0's boot option even when Xen is
>>> changed to expose mwait? The first case is not sane, while for the 2nd case
>>> I don't think any pv_ops hook is required as long as Xen can expose it,
>>> isn't
>>> it?
>> 
>> But there is a pv_ops hook, and Xen isn't going to expose it because it
>> breaks old dom0 kernels.
>> 
> 
> yes, now I understand your suggestion. Basically we discussed two approaches:
> 
> a) in current pv_ops hook (xen_cpuid):
> - use unconditional cpuid to query mwait capability on physical cpu
> - if the bit is set, and SIF_PM_MASK indicates xen pm is enabled:
> then set the bit in the ECX when leaf 1 is queried
>   this should effectively has X86_FEATURE_MWAIT set, and then _PDC method
> will notify BIOS using mwait entry method.
>   This method doesn't require Xen change, but it would only work for future
> releases which incorporates this change
> 
> b) in Xen we selectively clear MWAIT capability in pv_cpuid, based on whether
> xen_cpuidle is enabled. If there's no MWAIT available on physical CPU, or
> xen_cpuidle is disabled, MWAIT is not exposed to the guest. This approach
> doesn't break old dom0 kernel, as it's controlled by xen_cpuidle cmdline
> option.

It does require xen_cpuidle=0 to be added to the Xen command line. That's
not great.

> Basically it's not suggested to activate Cx transition by using legacy I/O
> method,
> so it's fine to disable xen cpuidle on those old dom0 kernel.
> 
> approach a) is better from the angle that we don't want non-ring0 code to
> execute MWAIT which causes invalid opcode exception, while for PM purpose
> MWAIT is purely informational.
> 
> Approach b) is better if we want existing Xen deployments to use efficient
> C-state benefit, since Xen is backward compatible and thus upgrade to a
> newer Xen release is lighter than upgrading to a newer dom0 kernel.
> 
> What's your opinion about this? If b) is not a valid concern from your side,
> we
> will go to a) as you suggested.

I think (a) is the right way to go.

 -- Keir

> Thanks
> Kevin

  reply	other threads:[~2011-08-16  6:31 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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
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=CA6FCD41.1F48E%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@novell.com \
    --cc=gang.wei@intel.com \
    --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.