From: "Jan Beulich" Subject: Re: [PATCH 1/2] xen/x86: Patch re-factors MSI/X config code from, drivers/passthrough/pci.c to x86 specific Date: Tue, 14 Apr 2015 10:11:26 +0100 Message-ID: <552CF5DE0200007800071C4F@mail.emea.novell.com> References: <552B730B.5090907@caviumnetworks.com> <552B9BA1.5070101@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <552B9BA1.5070101@caviumnetworks.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Manish Jaggi Cc: "Prasun.kapoor@cavium.com" , Ian Campbell , Stefano Stabellini , Vijaya Kumar , Julien Grall , Xen Devel List-Id: xen-devel@lists.xenproject.org >>> On 13.04.15 at 12:34, wrote: > On Monday 13 April 2015 03:45 PM, Stefano Stabellini wrote: >> On Mon, 13 Apr 2015, Manish Jaggi wrote: >>> @@ -282,22 +266,10 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, >>> u8 bus, u8 devfn) >>> *((u8*) &pdev->bus) = bus; >>> *((u8*) &pdev->devfn) = devfn; >>> pdev->domain = NULL; >>> - INIT_LIST_HEAD(&pdev->msi_list); >>> - >>> - if ( pci_find_cap_offset(pseg->nr, bus, PCI_SLOT(devfn), >>> PCI_FUNC(devfn), >>> - PCI_CAP_ID_MSIX) ) >>> + if (!pci_alloc_msix (pdev, pseg, bus, devfn)) >>> { >>> - struct arch_msix *msix = xzalloc(struct arch_msix); >>> - >>> - if ( !msix ) >>> - { >>> - xfree(pdev); >>> - return NULL; >>> - } >>> - spin_lock_init(&msix->table_lock); >>> - pdev->msix = msix; >>> + return NULL; >>> } >>> - >> From the look of it, this code doesn't seem x86 specific > MSIX is only used for x86, dom0/U handles MSI/X in ARM. I think If ARM > is not using MSI/X then code has to be in x86 specific file. No, you need to take a more general perspective here: MSI and MSI-X are integral parts of PCI, and hence if ARM _really_ chooses to hand control of it to DomU-s, the code here shouldn't become x86-specific, but non-ARM-specific. Jan