From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752335AbcGAJAx (ORCPT ); Fri, 1 Jul 2016 05:00:53 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34652 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbcGAJAu (ORCPT ); Fri, 1 Jul 2016 05:00:50 -0400 Subject: Re: [PATCH v1 05/11] KVM: x86: use generic function for MSI parsing To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20160630205429.16480-1-rkrcmar@redhat.com> <20160630205429.16480-6-rkrcmar@redhat.com> Cc: "Lan, Tianyu" , Igor Mammedov , Jan Kiszka , Peter Xu From: Paolo Bonzini Message-ID: <3ab78958-76f4-84ef-4e13-aa5a4a4995c6@redhat.com> Date: Fri, 1 Jul 2016 10:42:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160630205429.16480-6-rkrcmar@redhat.com> 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 30/06/2016 22:54, Radim Krčmář wrote: > Signed-off-by: Radim Krčmář > --- > arch/x86/kvm/irq_comm.c | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/arch/x86/kvm/irq_comm.c b/arch/x86/kvm/irq_comm.c > index dfb4c6476877..47ad681a33fd 100644 > --- a/arch/x86/kvm/irq_comm.c > +++ b/arch/x86/kvm/irq_comm.c > @@ -388,21 +388,16 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu, > kvm->arch.nr_reserved_ioapic_pins); > for (i = 0; i < nr_ioapic_pins; ++i) { > hlist_for_each_entry(entry, &table->map[i], link) { > - u32 dest_id, dest_mode; > - bool level; > + struct kvm_lapic_irq irq; > > if (entry->type != KVM_IRQ_ROUTING_MSI) > continue; > - dest_id = (entry->msi.address_lo >> 12) & 0xff; > - dest_mode = (entry->msi.address_lo >> 2) & 0x1; > - level = entry->msi.data & MSI_DATA_TRIGGER_LEVEL; > - if (level && kvm_apic_match_dest(vcpu, NULL, 0, > - dest_id, dest_mode)) { > - u32 vector = entry->msi.data & 0xff; > > - __set_bit(vector, > - ioapic_handled_vectors); > - } > + kvm_set_msi_irq(entry, &irq); > + > + if (irq.level && kvm_apic_match_dest(vcpu, NULL, 0, > + irq.dest_id, irq.dest_mode)) > + __set_bit(irq.vector, ioapic_handled_vectors); > } > } > srcu_read_unlock(&kvm->irq_srcu, idx); > Reviewed-by: Paolo Bonzini