From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH 2/4] sysctl/libxl: Add interface for returning IO topology data Date: Wed, 03 Dec 2014 10:37:59 -0500 Message-ID: <547F2E57.7010300@oracle.com> References: <1417556050-23364-1-git-send-email-boris.ostrovsky@oracle.com> <1417556050-23364-3-git-send-email-boris.ostrovsky@oracle.com> <547F2A5B.9060407@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <547F2A5B.9060407@citrix.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: Andrew Cooper , jbeulich@suse.com, keir@xen.org, ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, wei.liu2@citrix.com Cc: dario.faggioli@citrix.com, ufimtseva@gmail.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 12/03/2014 10:20 AM, Andrew Cooper wrote: > On 02/12/14 21:34, Boris Ostrovsky wrote: >> /* XEN_SYSCTL_topologyinfo */ >> #define INVALID_TOPOLOGY_ID (~0U) >> + >> +struct xen_sysctl_cputopo { >> + uint32_t core; >> + uint32_t socket; >> + uint32_t node; >> +}; >> +typedef struct xen_sysctl_cputopo xen_sysctl_cputopo_t; >> +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cputopo_t); >> + >> +struct xen_sysctl_iotopo { >> + uint16_t seg; >> + uint8_t bus; >> + uint8_t devfn; >> + uint32_t node; >> +}; >> +typedef struct xen_sysctl_iotopo xen_sysctl_iotopo_t; >> +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_iotopo_t); >> + >> struct xen_sysctl_topologyinfo { >> /* >> * IN: maximum addressable entry in the caller-provided arrays. >> - * OUT: largest cpu identifier in the system. >> + * OUT: largest cpu identifier or max number of devices in the system. >> * If OUT is greater than IN then the arrays are truncated! >> * If OUT is leass than IN then the array tails are not written by sysctl. >> */ >> uint32_t max_cpu_index; >> + uint32_t max_devs; >> >> /* >> * If not NULL, these arrays are filled with core/socket/node identifier >> - * for each cpu. >> - * If a cpu has no core/socket/node information (e.g., cpu not present) >> - * then the sentinel value ~0u is written to each array. >> - * The number of array elements written by the sysctl is: >> + * for each cpu and/or node for each PCI device. >> + * If information for a particular entry is not avalable it is set to >> + * INVALID_TOPOLOGY_ID. >> + * The number of array elements for CPU topology written by the sysctl is: >> * min(@max_cpu_index_IN,@max_cpu_index_OUT)+1 >> */ >> - XEN_GUEST_HANDLE_64(uint32) cpu_to_core; >> - XEN_GUEST_HANDLE_64(uint32) cpu_to_socket; >> - XEN_GUEST_HANDLE_64(uint32) cpu_to_node; >> + XEN_GUEST_HANDLE_64(xen_sysctl_cputopo_t) cputopo; >> + XEN_GUEST_HANDLE_64(xen_sysctl_iotopo_t) iotopo; > These are inherently lists with different indicies. They should not > conglomerated like this. I don't follow this. These are indeed lists with different indicies but why can't they both be part of this struct? -boris > > I would suggest introducing a new hypercall (xen_sysctl_iotopologyinfo > ?) and leave this one alone. > > ~Andrew