From: Weidong Han <weidong.han@intel.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: Tim Deegan <Tim.Deegan@eu.citrix.com>,
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 15:45:57 +0800 [thread overview]
Message-ID: <4C7E04B5.7030902@intel.com> (raw)
In-Reply-To: <C8A3BE99.219CA%keir.fraser@eu.citrix.com>
Keir Fraser wrote:
> On 01/09/2010 02:53, "Weidong Han" <weidong.han@intel.com> wrote:
>
>
>>> 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.
>>
>
> I obviously don't mean that. What about the increased cost of XSAVE and
> XRSTOR s/r'ing more state unconditionally? At least it is conditional on
> v->fpu_dirtied I suppose?
>
One possible optimization is that only save/restore legacy states (FPU
and SSE) for guests which don't enable XSAVE.
Both xsave() and xrstor are invoked only when v->fpu_dirtied.
>
>>>> 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.
>>
>
> Wow, so the last couple of Xen releases are broken for the latest Intel
> platforms unless you specify no-xsave. Handy to know I guess.
>
> Why is the feature flag stuff all stuffed in Xen itself rather than
> xc_cpuid_x86.c, by the way? Shouldn't your change also be in the same place,
> or (much preferably) all XSAVE related stuff be moved out into
> libxc/xc_cpuid_x86.c?
>
I'm afraid XSAVE related stuff cannot be move out into
libxc/xc_cpuid_x86.c completely? At least Xen needs to control
X86_CR4_OSXSAVE for guests which don't support XSAVE. I will have a look
at it.
Regards,
Weidong
> -- Keir
>
>
>> Regards,
>> Weidong
>>
>>>
>>>
>>>
>
>
>
prev parent reply other threads:[~2010-09-01 7:45 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
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 [this message]
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=4C7E04B5.7030902@intel.com \
--to=weidong.han@intel.com \
--cc=JBeulich@novell.com \
--cc=Tim.Deegan@eu.citrix.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.