• Oliver Upton's avatar
    kvm: nVMX: reflect MTF VM-exits if injected by L1 · b045ae90
    Oliver Upton authored
    According to SDM 26.6.2, it is possible to inject an MTF VM-exit via the
    VM-entry interruption-information field regardless of the 'monitor trap
    flag' VM-execution control. KVM appropriately copies the VM-entry
    interruption-information field from vmcs12 to vmcs02. However, if L1
    has not set the 'monitor trap flag' VM-execution control, KVM fails to
    reflect the subsequent MTF VM-exit into L1.
    
    Fix this by consulting the VM-entry interruption-information field of
    vmcs12 to determine if L1 has injected the MTF VM-exit. If so, reflect
    the exit, regardless of the 'monitor trap flag' VM-execution control.
    
    Fixes: 5f3d45e7 ("kvm/x86: add support for MONITOR_TRAP_FLAG")
    Signed-off-by: default avatarOliver Upton <oupton@google.com>
    Reviewed-by: default avatarPeter Shier <pshier@google.com>
    Reviewed-by: default avatarJim Mattson <jmattson@google.com>
    Message-Id: <20200414224746.240324-1-oupton@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    b045ae90
nested.c 192 KB