public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zamsden@redhat.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: Joerg Roedel <joerg.roedel@amd.com>, Avi Kivity <avi@redhat.com>,
	kvm <kvm@vger.kernel.org>
Subject: Re: Nested SVM and migration
Date: Sat, 20 Feb 2010 13:26:49 -1000	[thread overview]
Message-ID: <4B806FB9.20009@redhat.com> (raw)
In-Reply-To: <20100220201822.GG20833@8bytes.org>

>
> On Sat, Feb 20, 2010 at 09:14:06AM -1000, Zachary Amsden wrote:
>    
>> Perhaps I am misunderstanding, but I don't see how nested SVM instances
>> can be properly migrated.  How does one extract and rebuild the nested
>> hsave control block?
>>      
> Migrating guests which run in nested mode could not be migrated in a
> save way currently but there are plans to fix that :-)
> The first step is to save the l1 cpu state in the guest supplied hsave
> area. But that is not sufficient because this does not work for all l1
> state.
>    

Thanks for the fast response!  I am glad to know both my reading of the 
code is correct and also that there are plans to fix it.  For now, it 
gives me freedom to fix a couple outstanding bugs and not worry about 
breaking a complex feature as nested migration through a bisectable 
patch-set.

>> If it isn't done already, one possible way to add it as an extension
>> might be to represent the data as additional MSRs which are saved and
>> restored with migration.
>>      
> This sounds complicated.
>
>    

I think it's actually pretty easy.

The infrastructure is already there to import / export and migrate MSR 
settings.  MSRs are also 64-bit, and hold "model-specific" settings, so 
if you don't mind thinking of the nested feature as a model-specific 
feature of the KVM-SVM CPU, it's even somewhat well defined in terms of 
the architecture.

In that case, the simplest approach, mapping a set of MSRs 1-1 onto the 
vmcb could be one possible implementation of a migration solution.  I 
don't think you would even need very much code; it could be simply 
blasted one qword at a time into the struct.  You would need only 
minimal error checking - most checks are done by hardware - and the only 
security concern, exposing host pages to the guest - is actually really 
a point of correctness - on migration, any physical page frames 
referenced in the hardware struct will obviously need to be reallocated 
anyway.

Mostly the problem is figuring out what chunk of MSR space to use.

Zach

  reply	other threads:[~2010-02-20 23:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-20 19:14 Nested SVM and migration Zachary Amsden
2010-02-20 20:18 ` Joerg Roedel
2010-02-20 23:26   ` Zachary Amsden [this message]
2010-02-21 12:10     ` Joerg Roedel
2010-02-21 12:24       ` Avi Kivity
2010-02-21 12:41         ` Joerg Roedel
2010-02-21 12:54           ` Avi Kivity
2010-02-21 13:09             ` Joerg Roedel
2010-02-21 13:14               ` Avi Kivity
     [not found]                 ` <4B8137E7.4030001@redhat.com>
     [not found]                   ` <20100221144352.GC26465@8bytes.org>
2010-02-22 16:54                     ` Zachary Amsden
     [not found]                     ` <4B814C41.7010105@redhat.com>
     [not found]                       ` <20100221155624.GD26465@8bytes.org>
2010-02-22 16:56                         ` Zachary Amsden
2010-02-22 16:59                           ` Avi Kivity
2010-02-22 16:46               ` Zachary Amsden
2010-02-22 17:07                 ` Joerg Roedel
2010-02-24 15:23               ` Joerg Roedel
2010-02-24 20:21                 ` Zachary Amsden
2010-02-22 16:42         ` Zachary Amsden
2010-02-22 16:44           ` Avi Kivity
2010-02-22 17:00             ` Zachary Amsden
2010-02-22 17:02               ` Avi Kivity
2010-02-22 17:07                 ` Zachary Amsden
2010-02-22 17:11                   ` Avi Kivity
2010-02-22 17:24                     ` Zachary Amsden
2010-02-22 16:39       ` Zachary Amsden
2010-02-21  7:23   ` Avi Kivity
2010-02-21  7:46     ` Gleb Natapov
2010-02-21  8:12       ` Avi Kivity
2010-02-21 12:18     ` Joerg Roedel

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=4B806FB9.20009@redhat.com \
    --to=zamsden@redhat.com \
    --cc=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    /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