From: Paolo Bonzini Subject: Re: [PATCH v5 2/2] kvm: nVMX: Introduce KVM_CAP_NESTED_STATE Date: Wed, 18 Jul 2018 23:10:10 +0200 Message-ID: <8653119f-0ac4-7937-225b-16ef0977528b@redhat.com> References: <1531214840-24686-1-git-send-email-karahmed@amazon.de> <1531214840-24686-2-git-send-email-karahmed@amazon.de> <20180718175545.GA11749@flask> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: KarimAllah Ahmed , LKML , kvm list , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , the arch/x86 maintainers To: Jim Mattson , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 18/07/2018 20:03, Jim Mattson wrote: > On Wed, Jul 18, 2018 at 10:55 AM, Radim Krčmář wrote: > >>> + vmx->nested.nested_run_pending = 1; >> This is not necessary. We're only copying state and do not add anything >> that would be lost on a nested VM exit without prior VM entry. > If nested_run_pending is blindly set on restore, then prepare_vmcs02 > will do the wrong thing. For example, if there was an injected event > in the vmcs12, it will get injected again, even if the vCPU has been > in L2 for some time. > > The value of nested_run_pending should always come from the saved VMX > state (a few lines above). > Yep, and there are a couple other things that need adjustment. Stay tuned... Paolo