xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Shuai Ruan <shuai.ruan@linux.intel.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: Tue, 29 Mar 2016 08:35:34 -0600	[thread overview]
Message-ID: <56FAAED602000078000E0EF2@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1458808173-23279-2-git-send-email-shuai.ruan@linux.intel.com>

>>> 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.

> +    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.

The patch here looks okay to me now.


Xen-devel mailing list

  reply	other threads:[~2016-03-29 14:35 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 [this message]
2016-03-30  5:48     ` Shuai Ruan
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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56FAAED602000078000E0EF2@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=shuai.ruan@linux.intel.com \
    --cc=xen-devel@lists.xen.org \


* 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).