Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964937AbbLWRVp (ORCPT ); Wed, 23 Dec 2015 12:21:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53327 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933553AbbLWRVm (ORCPT ); Wed, 23 Dec 2015 12:21:42 -0500 Date: Wed, 23 Dec 2015 18:21:39 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Feng Wu Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] KVM: x86: Add lowest-priority support for vt-d posted-interrupts Message-ID: <20151223172138.GC19037@potion.brq.redhat.com> References: <1450229853-3886-1-git-send-email-feng.wu@intel.com> <1450229853-3886-3-git-send-email-feng.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450229853-3886-3-git-send-email-feng.wu@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1045 Lines: 32 2015-12-16 09:37+0800, Feng Wu: > Use vector-hashing to deliver lowest-priority interrupts for > VT-d posted-interrupts. > > Signed-off-by: Feng Wu > --- > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > @@ -10702,8 +10702,16 @@ static int vmx_update_pi_irte(struct kvm *kvm, unsigned int host_irq, > */ > > kvm_set_msi_irq(e, &irq); > - if (!kvm_intr_is_single_vcpu(kvm, &irq, &vcpu)) > - continue; > + > + if (!kvm_intr_is_single_vcpu(kvm, &irq, &vcpu)) { > + if (!kvm_vector_hashing_enabled() || > + irq.delivery_mode != APIC_DM_LOWEST) Hm, wouldn't it actually be easier to extend kvm_intr_is_single_vcpu() with vector hashing? :) > + continue; > + > + vcpu = kvm_intr_vector_hashing_dest(kvm, &irq); > + if (!vcpu) > + continue; > + } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/