kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Sheng Yang <sheng@linux.intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: XSAVE/XRSTOR live migration support
Date: Thu, 27 May 2010 14:34:19 +0300	[thread overview]
Message-ID: <4BFE58BB.6090404@redhat.com> (raw)
In-Reply-To: <201005271833.11409.sheng@linux.intel.com>

On 05/27/2010 01:33 PM, Sheng Yang wrote:
>
>> If we do that then xcr0 needs to be in a separate structure, say
>> kvm_xcr, with a flags field and reserved space of its own for future xcr
>> growth.
>>      
> I meant to put it into sregs, but found it's already full... How about "extended
> sregs"?
>    

Isn't this what xcr means?  xtended control register?

>>> +static void kvm_vcpu_ioctl_x86_get_xsave(struct kvm_vcpu *vcpu,
>>> +					struct kvm_xsave *guest_xsave)
>>> +{
>>> +	struct xsave_struct *xsave =&vcpu->arch.guest_fpu.state->xsave;
>>> +
>>> +	if (!cpu_has_xsave)
>>> +		return;
>>>        
>> Hm, it would be nice to make it backward compatible and return the
>> legacy fpu instead.  I think the layouts are compatible?
>>      
> Sound good.  But seems we still need KVM_CAP_XSAVE to use this interface, and
> other processors would still go FPU interface. Seems didn't improve much?
>    

I would like the new interface to be used in all cases, this way we can 
deprecate the old one in a few years.

>>> diff --git a/include/linux/kvm.h b/include/linux/kvm.h
>>> index 23ea022..5006761 100644
>>> --- a/include/linux/kvm.h
>>> +++ b/include/linux/kvm.h
>>> @@ -524,6 +524,9 @@ struct kvm_enable_cap {
>>>
>>>    #define KVM_CAP_PPC_OSI 52
>>>    #define KVM_CAP_PPC_UNSET_IRQ 53
>>>    #define KVM_CAP_ENABLE_CAP 54
>>>
>>> +#ifdef __KVM_HAVE_XSAVE
>>> +#define KVM_CAP_XSAVE 55
>>> +#endif
>>>        
>> Might make sense to have a separate KVM_CAP_XCR, just for consistency.
>>      
> Maybe EXTENDED_SREGS? But still every future field in the struct need a CAP...
>    

Might do

struct kvm_xcr {
     __u32 xcr;
     __u32 reserved;
     __u64 value;
};

struct kvm_xcrs {
     __u32 nr_xcrs;
     __u32 flags;
     struct kvm_xcr xcrs[KVM_MAX_XCRS];
     ... reserved;
};

which would allow new xcrs to be added easily.

You'll need to change kvm_set_xcr0() to kvm_set_xcr() for this to work 
though.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-05-27 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27  9:48 [PATCH] KVM: x86: XSAVE/XRSTOR live migration support Sheng Yang
2010-05-27 10:02 ` Avi Kivity
2010-05-27 10:33   ` Sheng Yang
2010-05-27 11:34     ` Avi Kivity [this message]
2010-05-31 11:21   ` Sheng Yang
2010-05-31 11:26     ` 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=4BFE58BB.6090404@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=sheng@linux.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).