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 13:23:04 +0200 Message-ID: <49103098.7020109@redhat.com> References: <1225428647-27614-1-git-send-email-sheng@linux.intel.com> <1225428647-27614-10-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx2.redhat.com ([66.187.237.31]:53308 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532AbYKDLXI (ORCPT ); Tue, 4 Nov 2008 06:23:08 -0500 In-Reply-To: <1225428647-27614-10-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: Sheng Yang wrote: > We enable guest MSI and host MSI support in this patch. The userspace want to > enable MSI should set KVM_DEV_IRQ_ASSIGN_ENABLE_MSI in the assigned_irq's > flag. Function would return -ENOTTY if can't enable MSI, userspace shouldn't > set MSI Enable bit when KVM_ASSIGN_IRQ return -ENOTTY with > KVM_DEV_IRQ_ASSIGN_ENABLE_MSI. > Need a KVM_CAP_MSI so that userspace can tell before trying. > + if (assigned_dev->irq_requested_type & KVM_ASSIGNED_DEV_GUEST_INTX) > + kvm_set_irq(assigned_dev->kvm, > + assigned_dev->irq_source_id, > + assigned_dev->guest_irq, 1); > + else if (assigned_dev->irq_requested_type & > + KVM_ASSIGNED_DEV_GUEST_MSI) { > + assigned_device_msi_dispatch(assigned_dev); > + enable_irq(assigned_dev->host_irq); > + } > Hmm. This means the only path that can trigger msi is device assignment. But we also want virtio-pci to use msi. How about modifying kvm_set_irq() to dispatch either msi or normal irqs? We'd need a 'struct kvm_guest_irq' if we can't define the msi using the bits available in gsi (and also define a new KVM_IRQ_LINE... I really hope we can fit the msi info in gsi). The device-assignment-independent parts should be in a separate patch. -- error compiling committee.c: too many arguments to function