From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v2 1/4] pci: Do not ignore device's PXM information Date: Wed, 07 Jan 2015 09:42:30 -0500 Message-ID: <54AD45D6.6040601@oracle.com> References: <1420510737-22813-1-git-send-email-boris.ostrovsky@oracle.com> <1420510737-22813-2-git-send-email-boris.ostrovsky@oracle.com> <54AD052F0200007800052277@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54AD052F0200007800052277@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@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 01/07/2015 04:06 AM, Jan Beulich wrote: >>>> On 06.01.15 at 03:18, wrote: >> @@ -618,7 +620,22 @@ 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 ) >> + { >> + uint32_t pxm; >> + int optarr_off = offsetof(struct physdev_pci_device_add, optarr) / > unsigned int or size_t. > >> --- 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 thought I asked about this on v1 already: Does this really need to be > an int, when commonly node numbers are stored in u8/unsigned char? > Shrinking the field size would prevent the structure size from growing... I kept this field as an int to be able to store NUMA_NO_NODE which I thought to be (int)-1. But now I see that NUMA_NO_NODE is, in fact, 0xff but is promoted to (int)-1 by pxm_to_node(). Given that there is a number of tests for NUMA_NO_NODE and not for (int)-1, should we then make pxm_to_node() return u8 as well? > Of course an additional question would be whether the node wouldn't > better go into struct arch_pci_dev - that depends on whether we > expect ARM to be using NUMA... > Since we have CPU topology in common code I thought this would be arch-independent as well. -boris