From: Shuai Ruan <shuai.ruan@linux.intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: andrew.cooper3@citrix.com, keir@xen.org, xen-devel@lists.xen.org
Subject: Re: [PATCH V6 1/2] x86/xsaves: calculate the comp_offsets base on xcomp_bv
Date: Wed, 30 Mar 2016 13:48:51 +0800 [thread overview]
Message-ID: <48294.2395647571$1459317164@news.gmane.org> (raw)
In-Reply-To: <56FAAED602000078000E0EF2@prv-mh.provo.novell.com>
On Tue, Mar 29, 2016 at 08:35:34AM -0600, Jan Beulich wrote:
> >>> On 24.03.16 at 09:29, <shuai.ruan@linux.intel.com> wrote:
> > static void *get_xsave_addr(struct xsave_struct *xsave,
> > - unsigned int xfeature_idx)
> > + const uint16_t *comp_offsets,
> > + unsigned int xfeature_idx)
> > {
> > if ( !((1ul << xfeature_idx) & xsave->xsave_hdr.xstate_bv) )
> > return NULL;
>
> While not a problem in this patch, I think this being at least
> questionable now becomes more obvious: With XSAVEC and
> XSAVES this field may have clear bits just because the
> component was in init state. Yet I don't think this should be
> fixed here - instead the consumer(s) should better deal with
> NULL coming back here (i.e. expand_xsave_states() should
> probably memset() the area in an "else" to the if() leading to
> memcpy(), whereas compress_xsave_states() is fine as is).
>
> That's a 3rd patch, though.
>
I will add code only in expand_xsave_states() to deal with NULL
returned by get_xsave_addr().
> > + return (void *)xsave + (xsave_area_compressed(xsave) ?
> > + comp_offsets[xfeature_idx] :
> > + xstate_offsets[xfeature_idx]);
>
> This function doesn't ever get called when
> !xsave_area_compressed(xsave), so I don't really see why this
> conditional expression ever got added. Yet another follow-up
> patch I would say.
I will drop this.
>
> The patch here looks okay to me now.
>
Thanks
> Jan
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-03-30 5:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 8:29 [PATCH V6 0/2] xsaves bug fix Shuai Ruan
2016-03-24 8:29 ` [PATCH V6 1/2] x86/xsaves: calculate the comp_offsets base on xcomp_bv Shuai Ruan
2016-03-29 14:35 ` Jan Beulich
2016-03-30 5:48 ` Shuai Ruan [this message]
2016-03-24 8:29 ` [PATCH V6 2/2] x86/xsaves: fix overwriting between non-lazy/lazy xsaves Shuai Ruan
2016-03-29 15:00 ` Jan Beulich
2016-03-30 5:46 ` Shuai Ruan
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='48294.2395647571$1459317164@news.gmane.org' \
--to=shuai.ruan@linux.intel.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=keir@xen.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).