From: David Hildenbrand Subject: Re: [PATCH 7/8] kvm: nVMX: Introduce KVM_CAP_VMX_STATE Date: Mon, 8 Jan 2018 11:35:28 +0100 Message-ID: <2301ab3e-c318-4494-4c1e-bd85e24ef78c@redhat.com> 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> <75bde61a-34ff-c0af-436e-c8328fe7e870@redhat.com> <67833a23-5dd4-c502-d724-fea5598c41df@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm list , David Hildenbrand To: Paolo Bonzini , Jim Mattson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37716 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755770AbeAHKfa (ORCPT ); Mon, 8 Jan 2018 05:35:30 -0500 In-Reply-To: <67833a23-5dd4-c502-d724-fea5598c41df@redhat.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 19.12.2017 22:29, Paolo Bonzini wrote: > On 19/12/2017 20:21, Jim Mattson wrote: >> One reason is that it is a bit awkward for GET_NESTED_STATE to modify >> guest memory. I don't know about qemu, but our userspace agent expects >> guest memory to be quiesced by the time it starts going through its >> sequence of GET_* ioctls. Sure, we could introduce a pre-migration >> ioctl, but is that the best way to handle this? Another reason is that >> it is a bit awkward for SET_NESTED_STATE to require guest memory. >> Again, I don't know about qemu, but our userspace agent does not >> expect any guest memory to be available when it starts going through >> its sequence of SET_* ioctls. Sure, we could prefetch the guest page >> containing the current VMCS12, but is that better than simply >> including the current VMCS12 in the NESTED_STATE payload? Moreover, >> these unpredictable (from the guest's point of view) updates to guest >> memory leave a bad taste in my mouth (much like SMM). > > IIRC QEMU has no problem with either, but I think your concerns are > valid. The active VMCS is processor state, not memory state. Same for > the host save data in SVM. > > The unstructured "blob" of data is not an issue. If it becomes a > problem, we can always document the structure... Thinking about it, I agree. It might be simpler/cleaner to transfer the "loaded" VMCS. But I think we should take care of only transferring data that actually is CPU state and not special to our current implementation. (e.g. nested_run_pending I would says is special to out current implementation, but we can discuss) So what I would consider VMX state: - vmxon - vmxon_ptr - vmptr - cached_vmcs12 - ... ? > > Paolo -- Thanks, David / dhildenb