From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 5/5] qemu-kvm: device assignment: Enable in-kernel MSI-X mask support Date: Thu, 21 Oct 2010 15:12:16 +0800 Message-ID: <201010211512.16320.sheng@linux.intel.com> References: <1287563395-30039-1-git-send-email-sheng@linux.intel.com> <1287563395-30039-6-git-send-email-sheng@linux.intel.com> <20101020223656.GD27545@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org To: "Michael S. Tsirkin" Return-path: Received: from mga02.intel.com ([134.134.136.20]:48918 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753213Ab0JUHLF (ORCPT ); Thu, 21 Oct 2010 03:11:05 -0400 In-Reply-To: <20101020223656.GD27545@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thursday 21 October 2010 06:36:56 Michael S. Tsirkin wrote: > On Wed, Oct 20, 2010 at 04:29:55PM +0800, Sheng Yang wrote: > > Signed-off-by: Sheng Yang > > --- > > > > hw/device-assignment.c | 13 +++++++++++++ > > 1 files changed, 13 insertions(+), 0 deletions(-) > > > > diff --git a/hw/device-assignment.c b/hw/device-assignment.c > > index d1a6282..aa3358e 100644 > > --- a/hw/device-assignment.c > > +++ b/hw/device-assignment.c > > @@ -269,6 +269,9 @@ static void assigned_dev_iomem_map(PCIDevice > > *pci_dev, int region_num, > > > > AssignedDevRegion *region = &r_dev->v_addrs[region_num]; > > PCIRegion *real_region = &r_dev->real_device.regions[region_num]; > > int ret = 0; > > > > +#ifdef KVM_CAP_DEVICE_MSIX_MASK > > + struct kvm_assigned_msix_mmio msix_mmio; > > +#endif > > > > DEBUG("e_phys=%08" FMT_PCIBUS " r_virt=%p type=%d len=%08" > > FMT_PCIBUS " region_num=%d \n", > > > > e_phys, region->u.r_virtbase, type, e_size, region_num); > > > > @@ -287,6 +290,16 @@ static void assigned_dev_iomem_map(PCIDevice > > *pci_dev, int region_num, > > > > cpu_register_physical_memory(e_phys + offset, > > > > TARGET_PAGE_SIZE, r_dev->mmio_index); > > > > +#ifdef KVM_CAP_DEVICE_MSIX_MASK > > + memset(&msix_mmio, 0, sizeof(struct kvm_assigned_msix_mmio)); > > + msix_mmio.assigned_dev_id = calc_assigned_dev_id(r_dev->h_segnr, > > + r_dev->h_busnr, r_dev->h_devfn); > > + msix_mmio.base_addr = e_phys + offset; > > + if (kvm_assign_reg_msix_mmio(kvm_context, &msix_mmio)) > > + fprintf(stderr, "fail to register in-kernel > > msix_mmio!\n"); + /* We can still continue because the MMIO > > accessing can fall + * back to QEmu */ > > So let's not print scary messages ... OK... -- regards Yang, Sheng > > > +#endif > > > > } > > > > }