From: Paolo Bonzini Subject: Re: [PATCH v5 2/2] kvm: nVMX: Introduce KVM_CAP_NESTED_STATE Date: Wed, 18 Jul 2018 19:33:01 +0200 Message-ID: References: <1531214840-24686-1-git-send-email-karahmed@amazon.de> <1531214840-24686-2-git-send-email-karahmed@amazon.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Jim Mattson , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org To: KarimAllah Ahmed , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Return-path: In-Reply-To: <1531214840-24686-2-git-send-email-karahmed@amazon.de> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 10/07/2018 11:27, KarimAllah Ahmed wrote: > @@ -11772,7 +11772,6 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu) > if (prepare_vmcs02(vcpu, vmcs12, &exit_qual)) > goto fail; > > - nested_get_vmcs12_pages(vcpu, vmcs12); > > r = EXIT_REASON_MSR_LOAD_FAIL; > msr_entry_idx = nested_vmx_load_msr(vcpu, I think this is not enough, the MSR load should not be redone on KVM_SET_NESTED_STATE. This issue is preexisting and happens for SMM exit as well. SMM exit in fact also needs to defer nested_get_vmcs12_pages, or the pages could be read from SMRAM. I'll send a v6 patch and a testcase, and in the meanwhile I have applied patch 1. Paolo