kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Cui, Dexuan" <dexuan.cui@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Yang, Sheng" <sheng.yang@intel.com>
Subject: Re: [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest
Date: Thu, 06 May 2010 22:45:07 +0300	[thread overview]
Message-ID: <4BE31C43.9060506@redhat.com> (raw)
In-Reply-To: <1865303E0DED764181A9D882DEF65FB61A82B51D4C@shsmsx502.ccr.corp.intel.com>

On 05/06/2010 05:20 PM, Cui, Dexuan wrote:
>
>> However, switching xcr0 may be slow.  That's our experience with msrs.
>> Can you measure its latency?
>>      
> We can measure that.
> However, I think the changing xcr0 to guest xcr0 in handle_xsetbv() is necessary --
> or else, inside guest xgetbv() would return host xcr0 rather than guest xcr0 --
> this is obviously incorrect. Once handle_xsetbv() changes the xcr0 to guest's value,
> the xsetbv() in kvm_fx_restore_host() is also necessary, and the xsetbv() in
> kvm_fx_restore_guest() is also necessary. So looks guest can't run with the
> host xcr0.
>    

Right.  Moreover, xsave would write into memory the guest doesn't expect.

>> btw, it needs save/restore for live migration, as well as save/restore
>> for the new fpu state.
>>      
> Yes. This part is missing. Sheng and I is also doing this -- it may be a bittle
> troublesome as the number of XSTATEs can grown as time goes on. We'll
> have to handle the compatibility issue.
>    


Reserve tons of space in the ioctl - and we can use the same format as 
xsave.

All those control registers are annoying, we have cr1 and cr5-cr7 free, 
cr9-cr15 on x86_64, infinite msr space, and now we have XCRs.  Great.

Looking forward to YCR0.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  reply	other threads:[~2010-05-06 19:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-29  5:22 [PATCH 1/1] KVM: X86: add the support of XSAVE/XRSTOR to guest Dexuan Cui
2010-05-02 14:13 ` Avi Kivity
2010-05-06  4:23   ` Cui, Dexuan
2010-05-06  8:14     ` Avi Kivity
2010-05-06 14:20       ` Cui, Dexuan
2010-05-06 19:45         ` Avi Kivity [this message]
2010-05-06 19:49           ` Avi Kivity

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=4BE31C43.9060506@redhat.com \
    --to=avi@redhat.com \
    --cc=dexuan.cui@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=sheng.yang@intel.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 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).