From: "Jan Beulich" Subject: Re: [PATCH 1/4] pci: Do not ignore device's PXM information Date: Fri, 05 Dec 2014 15:53:47 +0000 Message-ID: <5481E31B020000780004D44D@mail.emea.novell.com> References: <1417556050-23364-1-git-send-email-boris.ostrovsky@oracle.com> <1417556050-23364-2-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417556050-23364-2-git-send-email-boris.ostrovsky@oracle.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: Boris Ostrovsky Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, ufimtseva@gmail.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 02.12.14 at 22:34, wrote: > If ACPI provides PXM data for IO devices then dom0 will pass it to > hypervisor during PHYSDEVOP_pci_device_add call. This information, > however, is currently ignored. > > We should remember it (in the form of nodeID). We will also print it > when user requests device information dump. This on its own seems pretty little reason for changing the code; considering that subsequent patches will at least convey the information to the tool stack, maybe that should be mentioned here as the primary reason for the change? > @@ -597,13 +598,14 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) > pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn; > ret = pci_add_device(0, manage_pci_ext.bus, > manage_pci_ext.devfn, > - &pdev_info); > + &pdev_info, NUMA_NO_NODE); > break; > } > > case PHYSDEVOP_pci_device_add: { > struct physdev_pci_device_add add; > struct pci_dev_info pdev_info; > + int node; Here and everywhere else as applicable: unsigned int unless a negative value is possible. > @@ -618,7 +620,19 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) > } > else > pdev_info.is_virtfn = 0; > - ret = pci_add_device(add.seg, add.bus, add.devfn, &pdev_info); > + > + if ( add.flags & XEN_PCI_DEV_PXM ) { Coding style. > --- a/xen/drivers/passthrough/pci.c > +++ b/xen/drivers/passthrough/pci.c > @@ -568,7 +568,8 @@ static void pci_enable_acs(struct pci_dev *pdev) > pci_conf_write16(seg, bus, dev, func, pos + PCI_ACS_CTRL, ctrl); > } > > -int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info) > +int pci_add_device(u16 seg, u8 bus, u8 devfn, > + const struct pci_dev_info *info, const int node) I don't see the need for the const. > --- a/xen/include/xen/pci.h > +++ b/xen/include/xen/pci.h > @@ -56,6 +56,8 @@ struct pci_dev { > > u8 phantom_stride; > > + int node; /* NUMA node */ I don't think we currently support node IDs wider than 8 bits. Jan