On 10/26/2009 11:56 AM, Joerg Roedel wrote:
On Mon, Oct 26, 2009 at 11:39:46AM +0200, Avi Kivity wrote:
On 10/26/2009 11:30 AM, Joerg Roedel wrote:
Which host state?  As far as I can tell, it can all be regenerated.
The state which is loaded into the vcpu when a #vmexit is emulated. This
includes segments, control registers and the host rip for example.
All of this state does not change between nested guest and normal
guest mode.
I am talking about all the state that is saved in svm->nested.hsave.
When we migrate a guest vcpu while it is running in guest mode itself
(without forcing a nested #vmexit) this state is required when a #vmexit
needs to be emulated on this vcpu after migration.
Same is true for the nested intercept conditions.

The state that is saved by VMRUN can be saved to guest memory and migrated. Extra state (like the intercepts for the previous mode) must be saved to host memory and not migrated; host intercepts can be regenerated.

Concretely:


    hsave->save.es     = vmcb->save.es;
    hsave->save.cs     = vmcb->save.cs;
    hsave->save.ss     = vmcb->save.ss;
    hsave->save.ds     = vmcb->save.ds;
    hsave->save.gdtr   = vmcb->save.gdtr;
    hsave->save.idtr   = vmcb->save.idtr;
    hsave->save.efer   = svm->vcpu.arch.shadow_efer;
    hsave->save.cr0    = svm->vcpu.arch.cr0;
    hsave->save.cr4    = svm->vcpu.arch.cr4;
    hsave->save.rflags = vmcb->save.rflags;
    hsave->save.rip    = svm->next_rip;
    hsave->save.rsp    = vmcb->save.rsp;
    hsave->save.rax    = vmcb->save.rax;
    if (npt_enabled)
        hsave->save.cr3    = vmcb->save.cr3;
    else
        hsave->save.cr3    = svm->vcpu.arch.cr3;


Can all be saved to guest memory.

    copy_vmcb_control_area(hsave, vmcb);

Must not be saved into guest memory. On the other hand, it is not needed for migration.


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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to