From: "Jan Beulich" Subject: Re: [PATCH v3 1/7] xen: vNUMA support for PV guests Date: Tue, 19 Nov 2013 14:01:09 +0000 Message-ID: <528B7D350200007800104840@nat28.tlf.novell.com> References: <1384806262-12532-1-git-send-email-ufimtseva@gmail.com> <1384806262-12532-2-git-send-email-ufimtseva@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vilre-0006KB-T5 for xen-devel@lists.xenproject.org; Tue, 19 Nov 2013 14:01:15 +0000 In-Reply-To: <1384806262-12532-2-git-send-email-ufimtseva@gmail.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: Elena Ufimtseva Cc: keir@xen.org, Ian.Campbell@citrix.com, lccycc123@gmail.com, george.dunlap@eu.citrix.com, msw@linux.com, dario.faggioli@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 18.11.13 at 21:24, Elena Ufimtseva wrote: > @@ -889,6 +890,84 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) > } > break; > > + case XEN_DOMCTL_setvnumainfo: > + { > + unsigned int dist_size, nr_vnodes; > + > + ret = -EINVAL; > + > + /* > + * If number of vnodes was set before, > + * dont initilize it again. > + */ > + //ASSERT(d->vnuma.nr_vnodes > 0); Please, finally, clean up your patches before submitting. I'm not going to point out further obvious violations below. > --- /dev/null > +++ b/xen/include/public/vnuma.h > @@ -0,0 +1,56 @@ > +#ifndef _XEN_PUBLIC_VNUMA_H > +#define _XEN_PUBLIC_VNUMA_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; > + uint64_t __padm; What are you padding here? > +}; > + > +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 */ > + union { > + XEN_GUEST_HANDLE(uint) h; > + uint64_t _padn; No need for the odd trailing n (and other characters below). One thing that I only realized - what information is the guest supposed to use to know the number of virtual nodes it has (needed to size the arrays the handles here point to)? > + } nr_vnodes; > + union { > + XEN_GUEST_HANDLE(uint) h; > + uint64_t _padd; > + } vdistance; > + union { > + XEN_GUEST_HANDLE(uint) h; And this one is as problematic - I don't think the guest necessarily knows what max_vcpus the hypervisor has set for it. Jan