From: Mihai DONTU <mdontu@xxxxxxxxxxxxxxx> Inform the guest introspection tool that the exception (from a previous KVMI_INJECT_EXCEPTION command) was not successfully injected. It can happen for the introspection tool to queue a pagefault but have it overwritten by an interrupt picked up during guest reentry. kvmi_trap_event() is used to inform the tool when such a situation has been detected. Signed-off-by: Mihai Donțu <mdontu@xxxxxxxxxxxxxxx> --- arch/x86/kvm/x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6d5f801e4797..64572f7ec689 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -7773,6 +7773,9 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) } } + if (kvmi_lost_exception(vcpu)) + kvmi_trap_event(vcpu); + r = kvm_mmu_reload(vcpu); if (unlikely(r)) { goto cancel_injection;