From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 09/10] KVM: Enable MSI for device assignment Date: Tue, 04 Nov 2008 15:32:49 +0200 Message-ID: <49104F01.30604@redhat.com> References: <1225428647-27614-1-git-send-email-sheng@linux.intel.com> <1225428647-27614-10-git-send-email-sheng@linux.intel.com> <49103098.7020109@redhat.com> <20081104132543.GB18696@yukikaze> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Avi Kivity , Sheng Yang , kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:56288 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751888AbYKDNcx (ORCPT ); Tue, 4 Nov 2008 08:32:53 -0500 In-Reply-To: <20081104132543.GB18696@yukikaze> Sender: kvm-owner@vger.kernel.org List-ID: Sheng Yang wrote: > One question here: did the architectures other than X86 and IA64 need > dispatch MSI support? s390 doesn't. ppc may, one day in the future. Not now I think. > If so, I am afraid reuse assigned_device_msi_dispatch > (or similar solution) won't be elegant (though I already lean toward a arch > specific dispatch function). > > I am not familiar with virtio-pci and how it works, it would be good if > it can be illustrated a little more. For this context, it's just a pci device. qemu calls KVM_IRQ_LINE to inject an irq, and the pci layer in the guest delivers the irq to the virtio-pci driver. In fact, it's not just for pci. We could msi-enable e1000 and get improved performance there as well. > But I guess what you means is only set > gsi can result in kvm_set_irq() deliver the MSI correctly. I think this can > be done. Associating gsi with guest_msi_addr and guest_msi_data in a linked > list, for gsi >= IOAPIC_PINS, Let's say, (gsi >> 24) == 1. That gives us 16M potential MSIs. > kvm_set_irq() checked the list and deliver the > interrupt. Of course, some lock should be taken to maintain the list, maybe > kvm->lock in first step as we used for kvm_set_irq (kvm->lock become more > and more bigger...). > I think kvm_set_irq() already takes kvm->lock. -- error compiling committee.c: too many arguments to function