diff options
author | Maxim Levitsky <mlevitsk@redhat.com> | 2021-09-13 16:09:54 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-09-22 16:47:50 +0200 |
commit | dbab610a5be69c2c5e4fdd7135d14b6bab2667a5 (patch) | |
tree | ebc092a5d5d294b2a027969c9b71121428a007c3 /arch/x86/kvm/vmx/vmx.h | |
parent | KVM: x86: nVMX: don't fail nested VM entry on invalid guest state if !from_vm... (diff) | |
download | linux-dbab610a5be69c2c5e4fdd7135d14b6bab2667a5.tar.xz linux-dbab610a5be69c2c5e4fdd7135d14b6bab2667a5.zip |
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>
Diffstat (limited to 'arch/x86/kvm/vmx/vmx.h')
-rw-r--r-- | arch/x86/kvm/vmx/vmx.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h index 02ab3468885f..592217fd7d92 100644 --- a/arch/x86/kvm/vmx/vmx.h +++ b/arch/x86/kvm/vmx/vmx.h @@ -355,6 +355,7 @@ void vmx_prepare_switch_to_guest(struct kvm_vcpu *vcpu); void vmx_set_host_fs_gs(struct vmcs_host_state *host, u16 fs_sel, u16 gs_sel, unsigned long fs_base, unsigned long gs_base); int vmx_get_cpl(struct kvm_vcpu *vcpu); +bool vmx_emulation_required(struct kvm_vcpu *vcpu); unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu); void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags); u32 vmx_get_interrupt_shadow(struct kvm_vcpu *vcpu); |