From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754335AbdBHRWQ (ORCPT ); Wed, 8 Feb 2017 12:22:16 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33521 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752929AbdBHRWN (ORCPT ); Wed, 8 Feb 2017 12:22:13 -0500 Subject: Re: [PATCH 6/6] kvm: x86: do not use KVM_REQ_EVENT for APICv interrupt injection To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1482164232-130035-1-git-send-email-pbonzini@redhat.com> <1482164232-130035-7-git-send-email-pbonzini@redhat.com> <20170207195804.GA1473@potion> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "Wu, Feng" From: Paolo Bonzini Message-ID: Date: Wed, 8 Feb 2017 17:23:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170207195804.GA1473@potion> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/02/2017 20:58, Radim Krčmář wrote: >> - local_irq_disable(); >> + if (kvm_lapic_enabled(vcpu)) { >> + /* >> + * This handles the case where a posted interrupt was >> + * notified with kvm_vcpu_kick. >> + */ >> + if (kvm_x86_ops->sync_pir_to_irr) >> + kvm_x86_ops->sync_pir_to_irr(vcpu); > Hm, this is not working well when nesting while L1 has assigned devices: > if the posted interrupt arrives just before local_irq_disable(), then > we'll just enter L2 instead of doing a nested VM exit (in case we have > interrupt exiting). > > And after reading the code a bit, I think we allow posted interrupts in > L2 while L1 has assigned devices that use posted interrupts, and that it > doesn't work. So you mean the interrupt is delivered to L2? The fix would be to wrap L2 entry and exit with some subset of pi_pre_block/pi_post_block. Paolo