From: David Hildenbrand Subject: Re: [PATCH 7/8] kvm: nVMX: Introduce KVM_CAP_VMX_STATE Date: Tue, 19 Dec 2017 18:33:57 +0100 Message-ID: References: <1480536229-11754-1-git-send-email-jmattson@google.com> <1480536229-11754-8-git-send-email-jmattson@google.com> <555d6a5a-fd6d-e1c2-6a40-3ecfbb09b379@redhat.com> <7d9c263c-3d21-8535-5fed-35adfdfb71be@redhat.com> <89880fbd-2d47-d994-81f5-2073eec96ce0@redhat.com> <3bbb7742-ece1-0e8a-cc73-45d5160bc6c4@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini , kvm list , David Hildenbrand To: Jim Mattson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39862 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbdLSRd7 (ORCPT ); Tue, 19 Dec 2017 12:33:59 -0500 In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 19.12.2017 18:26, Jim Mattson wrote: > Yes, it can be done that way, but what makes this approach technically > superior to the original API? a) not having to migrate data twice b) not having to think about a proper API to get data in/out All you need to know is, if the guest was in nested mode when migrating, no? That would be a simple flag. > > On Tue, Dec 19, 2017 at 2:35 AM, David Hildenbrand wrote: >> On 19.12.2017 04:07, Jim Mattson wrote: >>> The other unfortunate thing about flushing the "current" VMCS12 state >>> to guest memory on each L2->userspace transition is that much of this >>> state is in the VMCS02. So,it's not just a matter of writing a >>> VMCS12_SIZE blob to guest memory; first, the cached VMCS12 has to be >>> updated from the VMCS02 by calling sync_vmcs12(). This will be >>> particularly bad for double-nesting, where L1 kvm has to take all of >>> those VMREAD VM-exits. >>> >>> If you still prefer this method, I will go ahead and do it, but I >>> remain opposed. >> >> This can be easily solved by letting QEMU trigger a pre-migration ioctl. >> (FLUSH_NESTED_VMCS). So that shouldn't really be the problem. >> >> -- >> >> Thanks, >> >> David / dhildenb -- Thanks, David / dhildenb