From mboxrd@z Thu Jan 1 00:00:00 1970 From: Liran Alon Subject: [PATCH v2 0/8] KVM: Fix multiple issues in handling pending/injected events Date: Tue, 21 Nov 2017 17:30:03 +0200 Message-ID: <1511278211-12257-1-git-send-email-liran.alon@oracle.com> Cc: jmattson@google.com, wanpeng.li@hotmail.com, idan.brown@oracle.com To: pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org Return-path: Received: from userp1040.oracle.com ([156.151.31.81]:34908 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772AbdKUPac (ORCPT ); Tue, 21 Nov 2017 10:30:32 -0500 Sender: kvm-owner@vger.kernel.org List-ID: Hi, This series aim to fix multiple issues in how KVM defines & handles pending vs. injected events. Both in non-nested and nested scenarios. The first patch removes wrong unnecessary code of clearing pending NMI/interrupt when injecting event in real-mode when coming from one of the VMCS event-injection methods (vmx_queue_exception(), vmx_inject_nmi(), vmx_inject_irq()). The second patch renames interrupt.pending to interrupt.injected in order to better represent it's meaning and make it aligned with the meaning of "pending" & "injected" event for exceptions & NMIs. A "pending" event should represent an event that it's side-effect have not been applied yet. In contrast, an "injected" event should represent an event that it's side-effect have been applied. The third until fifth patches make set/get_events ioctl to consider userspace-injected exception as in "injected" state instead of "pending" state. This makes it's handling also aligned with how userspace-injected interrupts are handled. The sixth patch fix some misleading comments in inject_pending_events() regarding why exception.pending blocks re-injection of NMI/Interrupt and why it is evaluated first among the pending events. The 7th patch fixes a critical bug in nVMX which cause L1 to lose an IPI when it is sent in the exact moment a destination L2 CPU exits to L0 due to event-delivery. The last patch removes now irrelevant code which sets KVM_REQ_EVENT on conditions when it is unnecessary. I will appreciate if you could review all patches in series even if you encounter some issues with previous patches. This is because this series address multiple issues in current KVM code. Regards, -Liran Alon