On Tue, Dec 4, 2018 at 4:24 PM Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx> wrote: > > According to section "VM-entry Failures During or After Loading Guest State" > in Intel SDM vol 3C, > > "No MSRs are saved into the VM-exit MSR-store area." > > when bit 31 of the exit reason is set. > > Reported-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx> > Suggested-by: Jim Mattson <jmattson@xxxxxxxxxx> > Signed-off-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx> > Reviewed-by: Darren Kenny <darren.kenny@xxxxxxxxxx> > --- > arch/x86/kvm/vmx.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 4555077..4d153935 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -13827,6 +13827,18 @@ static void prepare_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, > * L2 to IDT_VECTORING_INFO_FIELD. > */ > vmcs12_save_pending_event(vcpu, vmcs12); > + > + /* > + * According to spec, there's no need to store the guest's > + * MSRs if the exit is due to a VM-entry failure that occurs > + * during or after loading the guest state. Since this exit > + * does not fall in that category, we need to save the MSRs. > + */ I'm still not a fan of this comment, but it's good enough. Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>