From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Nadav Har'El" Subject: Re: [PATCH 0/30] nVMX: Nested VMX, v9 Date: Mon, 23 May 2011 16:18:14 +0300 Message-ID: <20110523131814.GA18915@fermat.math.technion.ac.il> References: <1304842511-nyh@il.ibm.com> <4DC7CD81.2070305@redhat.com> <20110511082027.GG19019@redhat.com> <20110512154228.GA7943@fermat.math.technion.ac.il> <20110512155727.GA20193@redhat.com> <20110512163115.GA13138@fermat.math.technion.ac.il> <20110512165157.GC20193@redhat.com> <20110522193239.GA13130@fermat.math.technion.ac.il> <4DDA2E72.8070907@redhat.com> <20110523130226.GC23407@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Gleb Natapov , kvm@vger.kernel.org, abelg@il.ibm.com To: Joerg Roedel Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:57786 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752209Ab1EWNS1 (ORCPT ); Mon, 23 May 2011 09:18:27 -0400 Content-Disposition: inline In-Reply-To: <20110523130226.GC23407@8bytes.org> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, May 23, 2011, Joerg Roedel wrote about "Re: [PATCH 0/30] nVMX: Nested VMX, v9": > About live-migration with nesting, we had discussed the idea of just > doing an VMEXIT(INTR) if the vcpu runs nested and we want to migrate. > The problem was that the hypervisor may not expect an INTR intercept. > > How about doing an implicit VMEXIT in this case and an implicit VMRUN > after the vcpu is migrated? The nested hypervisor will not see the > vmexit and the vcpu will be in a state where it is safe to migrate. This > should work for nested-vmx too if the guest-state is written back to > guest memory on VMEXIT. Is this the case? Indeed, on nested exit (L2 to L1), the L2 guest state is written back to vmcs12 (in guest memory). In theory, at that point, the vmcs02 (the vmcs used by L0 to actually run L2) can be discarded, without risking losing anything. The receiving hypervisor will need to remember to do that implicit VMRUN when it starts the guest; It also needs to know what is the current L2 guest - in VMX this would be vmx->nested.current_vmptr, which needs to me migrated as well (on the other hand, other variables like vmx->nested.current_vmcs12, will need to be recalculated by the receiver, and not migrated as-is). I haven't started considering how to wrap up all these pieces into a complete working solution - it is one of the things on my TODO list after the basic nested VMX is merged. -- Nadav Har'El | Monday, May 23 2011, 19 Iyyar 5771 nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Live as if you were to die tomorrow, http://nadav.harel.org.il |learn as if you were to live forever.