From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/xsave: Expose xsave_cntxt_size to avoid reloading xcr0 Date: Wed, 4 Jun 2014 13:39:41 +0100 Message-ID: <538F138D.4050001@citrix.com> References: <1401883002-5481-1-git-send-email-andrew.cooper3@citrix.com> <538F2DFC0200007800017C1A@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <538F2DFC0200007800017C1A@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org On 04/06/14 13:32, Jan Beulich wrote: >>>> On 04.06.14 at 13:56, wrote: >> xstate_ctxt_size(xfeature_mask) is runtime constant after boot. There is no >> need to reload xcr0 twice for this basic bounds check. > Honestly I'm not in favor of exposing this variable for a not > performance critical code path. If we really care about saving a few > cycles here, how about having xstate_ctxt_size() check its argument > against xfeature_mask and return xsave_cntxt_size if equal? > Admittedly that'll need some extra care for the uses of the function > in xstate_init(), but it's not horribly difficult to make the current > function an internal one, and the global one be a wrapper with that > check done first. > > Jan > Personally, I think that is less pleasant than exposing xsave_cntxt_size, but I will see about doing it. It turns out I also need this value for other correctness fixes elsewhere in xsave domctl code. ~Andrew