From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH v2 1/7] xen: vNUMA support for guests. Date: Thu, 14 Nov 2013 11:48:02 +0000 Message-ID: <5284B872.1090808@citrix.com> References: <1384399569-23969-1-git-send-email-ufimtseva@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1384399569-23969-1-git-send-email-ufimtseva@gmail.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: Elena Ufimtseva Cc: keir@xen.org, stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, msw@linux.com, dario.faggioli@citrix.com, lccycc123@gmail.com, xen-devel@lists.xen.org, JBeulich@suse.com List-Id: xen-devel@lists.xenproject.org [ This series hasn't been threaded correctly, please ensure you use the --compose option to git send-email to write the cover letter. ] On 14/11/13 03:26, Elena Ufimtseva wrote: > --- /dev/null > +++ b/xen/include/public/vnuma.h > @@ -0,0 +1,44 @@ > +#ifndef _XEN_PUBLIC_VNUMA_H > +#define _XEN_PUBLIC_VNUMA_H > +#include "memory.h" > +#include "xen.h" > + > +/* > + * Following structures are used to represent vNUMA > + * topology to guest if requested. > + */ > + > +/* > + * Memory ranges can be used to define > + * vNUMA memory node boundaries by the > + * linked list. As of now, only one range > + * per domain is suported. > + */ > + > +struct vmemrange { > + uint64_t start, end; > + struct vmemrange *next; I think this probably wants to be an index into the vmemrange array in struct vnuma_topology_info. It certainly cannot be a bare pointer like this. > +}; > +typedef struct vmemrange vmemrange_t; > +DEFINE_XEN_GUEST_HANDLE(vmemrange_t); > + > +/* > + * vNUMA topology specifies vNUMA node > + * number, distance table, memory ranges and > + * vcpu mapping provided for guests. > + */ > + > +struct vnuma_topology_info { > + /* IN */ > + domid_t domid; > + uint32_t _pad; > + /* OUT */ > + XEN_GUEST_HANDLE(uint) nr_vnodes; > + XEN_GUEST_HANDLE(uint) vdistance; > + XEN_GUEST_HANDLE(uint) vcpu_to_vnode; > + XEN_GUEST_HANDLE(vmemrange_t) vmemrange; > +}; XEN_GUEST_HANDLE() has different size in 32-bit and 64-bit x86 but you have no compat code to translate the structure. Using: union { XEN_GUEST_HANDLE(uint) h; uint64_t _pad; } nr_vnodes; for each field would produce a struct with a uniform ABI. See the recently added struct xen_kexec_segment for an example. David