KVM: x86: nVMX: re-evaluate emulation_required on nested VM exit
authorMaxim Levitsky <mlevitsk@redhat.com>
Mon, 13 Sep 2021 14:09:54 +0000 (17:09 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Sep 2021 14:47:50 +0000 (10:47 -0400)
commitdbab610a5be69c2c5e4fdd7135d14b6bab2667a5
treeebc092a5d5d294b2a027969c9b71121428a007c3
parentc8607e4a086fae05efe5bffb47c5199c65e7216e
KVM: x86: nVMX: re-evaluate emulation_required on nested VM exit

If L1 had invalid state on VM entry (can happen on SMM transactions
when we enter from real mode, straight to nested guest),

then after we load 'host' state from VMCS12, the state has to become
valid again, but since we load the segment registers with
__vmx_set_segment we weren't always updating emulation_required.

Update emulation_required explicitly at end of load_vmcs12_host_state.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210913140954.165665-8-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h