All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weidong Han <weidong.han@intel.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: Xen-devel <xen-devel@lists.xensource.com>,
	Jan Beulich <JBeulich@novell.com>
Subject: Re: [PATCH 0/3 v2] XSAVE/XRSTOR fixes and enhancements
Date: Wed, 01 Sep 2010 09:53:44 +0800	[thread overview]
Message-ID: <4C7DB228.30709@intel.com> (raw)
In-Reply-To: <C8A2D6CF.218D6%keir.fraser@eu.citrix.com>

Keir Fraser wrote:
> On 31/08/2010 15:52, "Han, Weidong" <weidong.han@intel.com> wrote:
>
>   
>> Change logs from v1 -> v2:
>> Due to not guarantee backward compatibility, drop the guest save/restore patch
>> here. Will re-implement it later. In addition, split the original fix frozen
>> states patch into XSAVE/XRSTOR cleanup patch and fix frozen state patch.
>>
>> Patch 1/3: XSAVE/XRSTOR: some cleanups
>> Replace xfeature_low and xfeature_high with a u64 variable xfeature_mask.
>> In structure hvm_vcpu, rename xfeature_mask to xcr0
>> Provide EDX:EAX with all bits set to 1 for XSAVE and XRSTOR as spec
>> recommends.
>>
>> Patch 2/3: Fix frozen states
>> If a guest sets a state and dirties the state, but later temporarily clears
>> the state, and at this time if this vcpu is scheduled out, then other vcpus
>> may corrupt the state before the vcpu is scheduled in again, thus the state
>> cannot be restored correctly. To solve this issue, this patch save/restore all
>> states unconditionally on vcpu context switch.
>>     
>
> Performance overhead of this fix? Is there no other lazy save technique that
> can work?
>   
I think the cost of set_xcr0 which just changes some bits in XCR0 
register should be little.  I don't have any optimization for it now.
>   
>> Patch 3/3. Enable guest AVX
>> This patch enables Intel(R) Advanced Vector Extension (AVX) for guest.
>>     
>
> If we enable this but don't implement save/restore then don't guests lose
> state across s/r with unpredictable results?
>   
Yes. As I said in another email, actually it already breaks hvm guests 
save/restore on platforms which supports XSAVE/XRSTOR.

Regards,
Weidong
>
>
>
>   

  reply	other threads:[~2010-09-01  1:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-31 14:52 [PATCH 0/3 v2] XSAVE/XRSTOR fixes and enhancements Han, Weidong
2010-08-31 14:56 ` Tim Deegan
2010-09-01  1:17   ` Weidong Han
2010-08-31 14:57 ` Keir Fraser
2010-09-01  1:53   ` Weidong Han [this message]
2010-09-01  7:26     ` Keir Fraser
2010-09-01  7:39       ` Keir Fraser
2010-09-01  7:56         ` Weidong Han
2010-09-01  8:09           ` Keir Fraser
2010-09-01  8:26             ` Weidong Han
2010-09-01  7:45       ` Weidong Han

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=4C7DB228.30709@intel.com \
    --to=weidong.han@intel.com \
    --cc=JBeulich@novell.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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.