From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v12 for-xen-4.5 01/20] common/symbols: Export hypervisor symbols to privileged guest Date: Fri, 26 Sep 2014 10:58:12 -0400 Message-ID: <20140926145812.GB14378@laptop.dumpdata.com> References: <1411673336-32736-1-git-send-email-boris.ostrovsky@oracle.com> <1411673336-32736-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: Content-Disposition: inline In-Reply-To: <1411673336-32736-2-git-send-email-boris.ostrovsky@oracle.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: Boris Ostrovsky Cc: kevin.tian@intel.com, keir@xen.org, jbeulich@suse.com, jun.nakajima@intel.com, andrew.cooper3@citrix.com, tim@xen.org, dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org, Aravind.Gopalakrishnan@amd.com, suravee.suthikulpanit@amd.com, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org > diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h > index 053b9fa..4f21b17 100644 > --- a/xen/include/public/platform.h > +++ b/xen/include/public/platform.h > @@ -527,6 +527,24 @@ struct xenpf_core_parking { > typedef struct xenpf_core_parking xenpf_core_parking_t; > DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t); > > +#define XENPF_get_symbol 61 > +struct xenpf_symdata { > + /* IN/OUT variables */ > + uint32_t namelen; /* IN: size of name buffer */ > + /* OUT: strlen(name) of hypervisor symbol (may be */ > + /* larger than what's been copied to guest) */ > + uint32_t symnum; /* IN: Symbol to read */ > + /* OUT: Next available symbol. If same as IN then */ > + /* we reached the end */ > + > + /* OUT variables */ > + char type; > + XEN_GUEST_HANDLE(char) name; > + uint64_t address; > +}; > +typedef struct xenpf_symdata xenpf_symdata_t; This is what 'pahole' says: struct xenpf_symdata { uint32_t namelen; /* 0 4 */ uint32_t symnum; /* 4 4 */ char type; /* 8 1 */ /* XXX 7 bytes hole, try to pack */ __guest_handle_char name; /* 16 8 */ uint64_t address; /* 24 8 */ /* size: 32, cachelines: 1, members: 5 */ /* sum members: 25, holes: 1, sum holes: 7 */ /* last cacheline: 32 bytes */ }; If I move them just a bit: diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h index 4f21b17..b97e476 100644 --- a/xen/include/public/platform.h +++ b/xen/include/public/platform.h @@ -538,9 +538,9 @@ struct xenpf_symdata { /* we reached the end */ /* OUT variables */ - char type; - XEN_GUEST_HANDLE(char) name; uint64_t address; + XEN_GUEST_HANDLE(char) name; + char type; }; typedef struct xenpf_symdata xenpf_symdata_t; DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t); 'pahole' is satisfied: struct xenpf_symdata { uint32_t namelen; /* 0 4 */ uint32_t symnum; /* 4 4 */ uint64_t address; /* 8 8 */ __guest_handle_char name; /* 16 8 */ char type; /* 24 1 */ /* size: 32, cachelines: 1, members: 5 */ /* padding: 7 */ /* last cacheline: 32 bytes */ }; With that change, Reviewed-by: Konrad Rzeszutek Wilk