From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753952AbcAVOHp (ORCPT ); Fri, 22 Jan 2016 09:07:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43045 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753594AbcAVOHf (ORCPT ); Fri, 22 Jan 2016 09:07:35 -0500 Date: Fri, 22 Jan 2016 15:07:32 +0100 From: Radim =?utf-8?Q?Krcm=C3=A1r?= To: "Wu, Feng" Cc: "pbonzini@redhat.com" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" Subject: Re: [PATCH v3 3/4] KVM: x86: Add lowest-priority support for vt-d posted-interrupts Message-ID: <20160122140731.GB23362@potion.brq.redhat.com> References: <1453254177-103002-1-git-send-email-feng.wu@intel.com> <1453254177-103002-4-git-send-email-feng.wu@intel.com> <20160121201635.GB14104@potion.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-01-22 05:12+0000, Wu, Feng: >> From: Radim Krčmář [mailto:rkrcmar@redhat.com] >> 2016-01-20 09:42+0800, Feng Wu: >>> - if (kvm_intr_is_single_vcpu_fast(kvm, irq, dest_vcpu)) >>> + if (kvm_intr_can_posting_fast(kvm, irq, dest_vcpu)) >>> return true; >> >> There is one pitfall: xAPIC flat logical broadcast returns false, > > Do you mean kvm_intr_can_posting_fast() returns false for > xAPIC flat logical lowest-priority broadcast? I did. > After carefully read the code for several times, I still cannot > find the reason, could you please give more hints? You are right, there isn't a problem in the code. > BTW, I noticed there is a "if(irq->dest_id == 0xFF) goto out;" in > this function, but it is for the physical dest mode. I am not > sure you mean this. I didn't check if my assumptions were wrong. I'm sorry. >> but lowest priority is defined for it (practically isn't a broadcast) and >> the rest of this function doesn't check for lowest priority, so the >> interrupt won't be posted. >> >> We could modify our _fast functions to cover 0xff in flat logical, but >> ignoring this case isn't bad either ... it can happen only with 8 VCPU >> guests. > > Could you please elaborate a bit more why only for the 8 VCPU guests? xAPIC flat logical doesn't forbid lowest priority broadcasts, but lowest priority delivery still needs to have all destinations enabled, which can only happen with 8 VCPUs.