Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1199215
| From | Jake Oshins <jakeo@microsoft.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs |
| Date | 2015-08-03 21:30 +0200 |
| Message-ID | <pTtAS-40w-13@gated-at.bofh.it> (permalink) |
| References | <pSPWN-543-1@gated-at.bofh.it> <pSPWN-543-13@gated-at.bofh.it> <pSX7X-7dc-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@linutronix.de]
> Sent: Sunday, August 2, 2015 1:47 AM
> To: Jake Oshins <jakeo@microsoft.com>
> Cc: gregkh@linuxfoundation.org; KY Srinivasan <kys@microsoft.com>; LKML
> <linux-kernel@vger.kernel.org>; devel@linuxdriverproject.org;
> olaf@aepfle.de; apw@canonical.com; vkuznets@redhat.com; linux-
> pci@vger.kernel.org; bhelgaas@google.com; x86@kernel.org; Jiang Liu
> <jiang.liu@linux.intel.com>
> Subject: Re: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for
> Hyper-V VMs
>
<snip>
> > +static int hv_msi_domain_ops_prepare(struct irq_domain *domain,
> > + struct device *dev, int nvec,
> > + msi_alloc_info_t *arg)
> > +{
> > + struct pci_dev *pdev = to_pci_dev(dev);
> > + struct msi_desc *desc = first_pci_msi_entry(pdev);
> > +
> > + memset(arg, 0, sizeof(*arg));
> > + arg->msi_dev = pdev;
> > + if (desc->msi_attrib.is_msix) {
> > + arg->type = X86_IRQ_ALLOC_TYPE_MSIX;
> > + } else {
> > + arg->type = X86_IRQ_ALLOC_TYPE_MSI;
> > + arg->flags |= X86_IRQ_ALLOC_CONTIGUOUS_VECTORS;
> > + }
> > +
> > + return 0;
> > +}
>
> Pretty much a copy of the x86 code, right?
>
> I wonder whether this MSI infrastructure code would be better
> seperated out and moved to arch/x86/hyperv/msi.c or
> arch/x86/kernel/apic/hvmsi.c. It's small enough to be built in. So all
> you'd need to export is hv_pcie_init_irq_domain and
> hv_pcie_free_irq_domain.
>
> Thanks,
>
> tglx
Thanks for your review. I'll respond to all of your feedback and resend.
I do have a question about your last point, though. If I build this into the kernel, it will need to depend on sending and receiving messages through the hv_vmbus driver, which isn't built in. It seemed like the indirection and glue code necessary to make that work would be almost as big as this entire implementation (which admittedly isn't very big.) If you prefer that, I'll do it. But it would make more sense to me to refactor this a bit more so that functions like the one above are exported rather than putting hv_pcie_init_irq_domain and hv_pcie_free_irq_domain into the kernel itself. Would that work?
Thanks,
Jake Oshins
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/4] New Paravirtual front-end for PCI in a Hyper-V VM jakeo@microsoft.com - 2015-08-02 03:10 +0200
[PATCH 3/4] drivers:x86:pci: Make it possible to implement a PCI MSI IRQ Domain in a module. jakeo@microsoft.com - 2015-08-02 03:10 +0200
[PATCH 2/4] drivers:hv: Define the channel type for Hyper-V PCI Express pass-through jakeo@microsoft.com - 2015-08-02 03:10 +0200
[PATCH 1/4] drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num jakeo@microsoft.com - 2015-08-02 03:10 +0200
[PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs jakeo@microsoft.com - 2015-08-02 03:10 +0200
Re: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs Thomas Gleixner <tglx@linutronix.de> - 2015-08-02 10:50 +0200
RE: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs Jake Oshins <jakeo@microsoft.com> - 2015-08-03 21:30 +0200
RE: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs Thomas Gleixner <tglx@linutronix.de> - 2015-08-03 21:50 +0200
Re: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs Paul Bolle <pebolle@tiscali.nl> - 2015-08-03 11:20 +0200
Re: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for Hyper-V VMs Dan Carpenter <dan.carpenter@oracle.com> - 2015-08-03 12:00 +0200
csiph-web