]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: sync vmcs02 segment regs prior to vmx_set_cr0
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 5 Mar 2018 17:33:27 +0000 (09:33 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 23 Mar 2018 17:26:21 +0000 (18:26 +0100)
commitfcd8ddff868b015aa3553e42626386cd7622b16b
tree82d2700fa857f56446dc28d5e9d0746818b25cd6
parent31cbfb4fe608a400056c6eecf47835eaa73072c0
KVM: nVMX: sync vmcs02 segment regs prior to vmx_set_cr0

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: 776152cb382d ("KVM: nVMX: initialize descriptor cache fields in prepare_vmcs02_full")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
[Move all of prepare_vmcs02_full earlier, not just segment registers. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c