From: David Hildenbrand Subject: Re: [PATCH 7/8] kvm: nVMX: Introduce KVM_CAP_VMX_STATE Date: Tue, 9 Jan 2018 09:19:49 +0100 Message-ID: <4f5c9784-97dc-cc44-4fb3-9b965403bb2f@redhat.com> References: <1480536229-11754-1-git-send-email-jmattson@google.com> <75bde61a-34ff-c0af-436e-c8328fe7e870@redhat.com> <67833a23-5dd4-c502-d724-fea5598c41df@redhat.com> <2301ab3e-c318-4494-4c1e-bd85e24ef78c@redhat.com> <4c348439-81f7-11e9-0e68-3e18df86f4c4@redhat.com> <4703cc37-ba01-d370-9b61-57d63f2a0b32@redhat.com> <113868cd-5a82-495b-8a0b-d17217c76fd5@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]:60014 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753231AbeAIITv (ORCPT ); Tue, 9 Jan 2018 03:19:51 -0500 In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 08.01.2018 22:55, Jim Mattson wrote: > On Mon, Jan 8, 2018 at 1:46 PM, David Hildenbrand wrote: >>> The vmcs01 does serve as a cache of L1 state at the time of VM-entry, >>> so if we simply restored the vmcs01 state, that would take care of >>> most of the rollback issues, as long as we don't deliver any >>> interrupts in this context. However, I would like to see the >>> vmcs01/vmcs02 separation go away at some point. svm.c seems to do fine >>> with just once VMCB. >> >> Interesting point, might make things easier for VMX. >> >>> >>>> If the page >>>>> tables have changed, or the L1 guest has overwritten the >>>>> VMLAUNCH/VMRESUME instruction, then you're out of luck. >>>> >>>> Page tables getting changed by other CPUs is actually a good point. But >>>> I would consider both as "theoretical" problems. At least compared to >>>> the interrupt stuff, which could also happen on guests behaving in a >>>> more sane way. >>> >>> My preference is for solutions that are architecturally correct, >>> thereby solving the theoretical problems as well as the empirical >>> ones. However, I grant that the Linux community leans the other way in >>> general. >> >> I usually agree, unless it makes the code horribly complicated without >> any real benefit. (e.g. for corner cases like this one: a CPU modifying >> instruction text of another CPU which is currently executing them) > > I don't feel that one additional bit of serialized state is horribly > complicated. It's aesthetically unpleasant, to be sure, but not > horribly complicated. And it's considerably less complicated than your > proposal. :-) Well, nested_run_pending is just the tip of the ice berg of the (in my opinion complicated) part of exiting to user space with nested state, exposing all* VCPU ioctls to it. But as we learned, it's the little things that cause big problems :) -- Thanks, David / dhildenb