All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Wu, Feng" <feng.wu@intel.com>
Cc: "Nakajima, Jun" <jun.nakajima@intel.com>,
	"Dong, Eddie" <eddie.dong@intel.com>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Is: alternative_asm as dependency for STAC/CLAC/new features? Was:Re: [PATCH v1 1/6] x86: Add support for STAC/CLAC instructions
Date: Wed, 23 Apr 2014 10:52:00 -0400	[thread overview]
Message-ID: <20140423145200.GD2777@phenom.dumpdata.com> (raw)
In-Reply-To: <E959C4978C3B6342920538CF579893F001F362C6@SHSMSX104.ccr.corp.intel.com>

On Wed, Apr 23, 2014 at 01:43:35PM +0000, Wu, Feng wrote:
> 
> 
> > -----Original Message-----
> > From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com]
> > Sent: Tuesday, April 22, 2014 9:10 PM
> > To: Wu, Feng
> > Cc: Jan Beulich; Dong, Eddie; Ian.Campbell@citrix.com; Nakajima, Jun;
> > xen-devel@lists.xen.org
> > Subject: Re: [Xen-devel] [PATCH v1 1/6] x86: Add support for STAC/CLAC
> > instructions
> > 
> > On Tue, Apr 22, 2014 at 12:19:48PM +0000, Wu, Feng wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Jan Beulich [mailto:JBeulich@suse.com]
> > > > Sent: Tuesday, April 22, 2014 5:17 PM
> > > > To: Wu, Feng
> > > > Cc: Ian.Campbell@citrix.com; Dong, Eddie; Nakajima, Jun;
> > > > xen-devel@lists.xen.org
> > > > Subject: RE: [PATCH v1 1/6] x86: Add support for STAC/CLAC instructions
> > > >
> > > > >>> On 22.04.14 at 10:46, <feng.wu@intel.com> wrote:
> > > > >> From: Jan Beulich [mailto:JBeulich@suse.com]
> > > > >> >>> On 22.04.14 at 09:41, <feng.wu@intel.com> wrote:
> > > > >> > BTW, from the Linux implementation, I think we don't need to check
> > the
> > > > 'cr4'
> > > > >> > for the macros, we just need
> > > > >> > to check whether the feature exists in the CPU. So is it acceptable to
> > use
> > > > >> > the original code by eliminating the cr4 check?
> > > > >>
> > > > >> That _might_ be acceptable if you bring it down to just the three
> > > > >> really necessary instructions: BT, JNC, CLAC/STAC. But the "might"
> > > > >> has to stand - this, after all, remains an addition of a conditional
> > > > >> branch (and for the performance of STAC/CLAC I haven't seen any
> > > > >> documentation so far either) to several fast paths, and hence the
> > > > >> patching alternative can't be discarded as the potentially better one.
> > > > >>
> > > > >
> > > > > Since the alternatives mechanism in Linux is something common and
> > > > > independent and needs
> > > > > a bit more efforts to be ported to Xen, can we use the method I
> > mentioned
> > > > > above
> > > > > at the current stage. After that I will have a fully think about how to port
> > > > > the
> > > > > alternatives mechanism Xen.
> > > > >
> > > > > What do you think about this?
> > > >
> > > > Generally this would seem acceptable (as long as you give at least a
> > > > rough estimate on when to expect that second step), but then we
> > > > have this sad experience with promises by Intel engineers to work
> > > > on certain things...
> > > >
> > >
> > > Thanks a lot!
> > > I think I can work on the alternative mechanism after this SMAP patch is
> > finished.
> > 
> > Any time estimates when the alternative patching mechanism would be done?
> > Asking
> > because it seems to me that we would want that in Xen 4.5 - so need to figure
> > out
> > your timeline to fold it in the release time-frame.
> 
> I am sorry I feel it is a little hard for me to say when the patch will be done, since I am not
> quite clear about how big the effort would be right now. But I can start porting it ASAP
> after SMAP is done. BTW, do you know when will Xen 4.5 be released? About 4~5 months later?

The 4.5 roadmap is not yet clear. I hope that at the Xen Hackathon
it will be discussed by the release manager.

I think that without this runtime patching the hypervisor will
suffer a performance penalty on hosts that don't support this.

I say *think* becuase I don't have any hard numbers. And as such
this argument might be completly wrong if testing shows otherwise
(say, running this on AMD hardware with and without these
patches).

Bearing that in mind if I this patching is not done by the time Xen 4.5
hits feature freeze window it might be neccessary to:
 - #ifdef out the code so that it only is compiled in for folks
   who really want this and are OK with the potential performance
   setback.
 - But this #ifdef is a maintaince nightmare - code often bitrots,
   another QA matrix row, etc.
   In which case reverting the code is a better option and then
   it can be targetted for Xen 4.6

Perhaps reorganizing your deliverables would be better. As in,
focus on getting alternative_asm first in, and _then_ on this feature.

Aka, alternative_asm is a dependency and this work requires
that in addition.

Or all of this pointless and testing on AMD/Intel hardware with or
without these patches (and with / without the CPU feature) shows
no performance degradation.

  reply	other threads:[~2014-04-23 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 13:01 [PATCH v1 1/6] x86: Add support for STAC/CLAC instructions Feng Wu
2014-04-15  8:40 ` Jan Beulich
2014-04-22  7:41   ` Wu, Feng
2014-04-22  8:07     ` Jan Beulich
2014-04-22  8:46       ` Wu, Feng
2014-04-22  9:17         ` Jan Beulich
2014-04-22 12:19           ` Wu, Feng
2014-04-22 13:09             ` Konrad Rzeszutek Wilk
2014-04-23 13:43               ` Wu, Feng
2014-04-23 14:52                 ` Konrad Rzeszutek Wilk [this message]
2014-04-23 15:59                   ` Is: alternative_asm as dependency for STAC/CLAC/new features? Jan Beulich
2014-04-22  9:43       ` [PATCH v1 1/6] x86: Add support for STAC/CLAC instructions Andrew Cooper
2014-04-22  9:48         ` 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=20140423145200.GD2777@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=eddie.dong@intel.com \
    --cc=feng.wu@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=xen-devel@lists.xen.org \
    /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.