From mboxrd@z Thu Jan 1 00:00:00 1970 From: Liran Alon Subject: [PATCH v2 0/5]: KVM: nVMX: Fix multiple issues with nested-posted-interrupts Date: Tue, 5 Dec 2017 10:16:21 +0200 Message-ID: <1512461786-6465-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 userp2120.oracle.com ([156.151.31.85]:46094 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbdLEIQu (ORCPT ); Tue, 5 Dec 2017 03:16:50 -0500 Sender: kvm-owner@vger.kernel.org List-ID: Hi, This series aims to fix multiple issues with nested-posted-interrupts. The first patch removes a per vCPU flag called pi_pending which is used to signal KVM that it should emulate nested-posted-interrupt dispatching on next resume of L2. However, this flag is unnecessary as it has the exact same meaning as vmx->nested.pi_desc->control ON bit. The second patch fixes an issue of not re-evaluating what should be done with a new L1 pending interrupt that was discovered by syncing PIR to IRR just before resuming L2 guest. For example, this pending L1 event should in most cases result in exiting from L2 to L1 on external-interrupt. But currently, we will just continue resuming L2 which is wrong. The third patch clean-up & fix handling of directly injecting a L1 interrupt to L2 when L1 don't intercept external-interrupts. The current handling of this case doesn't correctly consider the LAPIC TPR and don't update it's IRR & ISR after injecting the interrupt to L2. Fix this by using standard interrupt-injection code-path in this scenario as-well. The fourth patch fix multiple race-condition issues in sending & dispatching nested-posted-interrupts. The patch fixes these issues by checking if there is pending nested-posted-interrupts before each vmentry and if yes, using self-IPI to make hardware dispatch them instead of emulating behavior in software. The fifth patch fixes a bug of not waking up a halted L2 when L1 sends it a nested-posted-interrupt and L1 doesn't intercept HLT. Regards, -Liran