lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM2PR0301MB1232A1E50FA39BEAB5707FEDAB770@DM2PR0301MB1232.namprd03.prod.outlook.com>
Date:	Mon, 3 Aug 2015 19:19:56 +0000
From:	Jake Oshins <jakeo@...rosoft.com>
To:	Thomas Gleixner <tglx@...utronix.de>
CC:	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	KY Srinivasan <kys@...rosoft.com>,
	LKML <linux-kernel@...r.kernel.org>,
	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
	"olaf@...fle.de" <olaf@...fle.de>,
	"apw@...onical.com" <apw@...onical.com>,
	"vkuznets@...hat.com" <vkuznets@...hat.com>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
	"x86@...nel.org" <x86@...nel.org>,
	Jiang Liu <jiang.liu@...ux.intel.com>
Subject: RE: [PATCH 4/4] drivers:pci:hv: New paravirtual PCI front-end for
 Hyper-V VMs

> -----Original Message-----
> From: Thomas Gleixner [mailto:tglx@...utronix.de]
> Sent: Sunday, August 2, 2015 1:47 AM
> To: Jake Oshins <jakeo@...rosoft.com>
> Cc: gregkh@...uxfoundation.org; KY Srinivasan <kys@...rosoft.com>; LKML
> <linux-kernel@...r.kernel.org>; devel@...uxdriverproject.org;
> olaf@...fle.de; apw@...onical.com; vkuznets@...hat.com; linux-
> pci@...r.kernel.org; bhelgaas@...gle.com; x86@...nel.org; Jiang Liu
> <jiang.liu@...ux.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ