2018-03-05 09:33-0800, Sean Christopherson: > Segment registers must be synchronized prior to any code that may > trigger a call to emulation_required()/guest_state_valid(), e.g. > vmx_set_cr0(). Because preparing vmcs02 writes segmentation fields > directly, i.e. doesn't use vmx_set_segment(), emulation_required > will not be re-evaluated when synchronizing the segment registers, > which can result in L0 incorrectly starting emulation of L2. > > Fixes: 8665c3f97320 ("KVM: nVMX: initialize descriptor cache fields in prepare_vmcs02_full") > > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> > --- > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > @@ -10563,11 +10563,8 @@ static int nested_vmx_load_cr3(struct kvm_vcpu *vcpu, unsigned long cr3, bool ne > return 0; > } > > -static void prepare_vmcs02_full(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, > - bool from_vmentry) Nice catch! Paolo, was there a reason to that prevented prepare_vmcs02_full at the beginning of prepare_vmcs02? Thanks.