From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH v3 1/2] kvm: x86: Extended struct kvm_lapic_irq with msi_redir_hint for MSI delivery Date: Tue, 17 Mar 2015 15:02:08 +0100 Message-ID: <20150317140207.GA2556@potion.brq.redhat.com> References: <1426555822-3280-1-git-send-email-sullivan.james.f@gmail.com> <1426555822-3280-2-git-send-email-sullivan.james.f@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, gleb@kernel.org, pbonzini@redhat.com To: James Sullivan Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56312 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753135AbbCQOCR (ORCPT ); Tue, 17 Mar 2015 10:02:17 -0400 Content-Disposition: inline In-Reply-To: <1426555822-3280-2-git-send-email-sullivan.james.f@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: 2015-03-16 19:30-0600, James Sullivan: > In kvm_set_msi_irq(), the RH bit is currently ignored for > determining the destination mode of the MSI delivery, and only the > DM bit is used. Corrected this so that dest_mode is APIC_DEST_LOGICAL > only when RH=3D1/DM=3D1, and APIC_DEST_PHYSICAL otherwise. >=20 > Extended struct kvm_lapic_irq with bool msi_redir_hint, which will > be used to determine if the delivery of the MSI should target only > the lowest priority CPU in the logical group specified for delivery. > (In physical dest mode, the RH bit is not relevant). Initialized the = value > of msi_redir_hint to true when RH=3D1 in kvm_set_msi_irq(), and initi= alized > to false in all other cases. >=20 > Added value of msi_redir_hint to a debug message dump of an IRQ in > apic_send_ipi(). >=20 > Signed-off-by: James Sullivan > --- Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99 Thanks. --- Btw. I often have comments ... if they are in parentheses, I have a different opinion on some choice and would like to know why you chose a that variant instead, because I might be missing something; there is no need to send new revision or even answer them. > diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c > @@ -103,12 +103,17 @@ static inline void kvm_set_msi_irq(struct kvm_k= ernel_irq_routing_entry *e, > + irq->msi_redir_hint =3D ((e->msi.address_lo > + & MSI_ADDR_REDIRECTION_LOWPRI) > 0); (- two extra tabs, or alignment, help to distinguish a continued line from indented next line - outer parentheses are useless - '!=3D 0' saves thinking about negative values - it would fit on one line if we didn't map to {0,1} explicitly; KVM style prefers explicit, though ...)