From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [RFC PATCH V3 01/12] xen/mem_event: Cleanup of mem_event structures Date: Mon, 2 Feb 2015 17:19:48 +0000 Message-ID: <1422897588.8023.5.camel@citrix.com> References: <1422567998-29995-1-git-send-email-tamas.lengyel@zentific.com> <1422567998-29995-2-git-send-email-tamas.lengyel@zentific.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1422567998-29995-2-git-send-email-tamas.lengyel@zentific.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: Tamas K Lengyel Cc: kevin.tian@intel.com, wei.liu2@citrix.com, jun.nakajima@intel.com, steve@zentific.com, stefano.stabellini@eu.citrix.com, tim@xen.org, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, eddie.dong@intel.com, andres@lagarcavilla.org, jbeulich@suse.com, rshriram@cs.ubc.ca, keir@xen.org, dgdegra@tycho.nsa.gov, yanghy@cn.fujitsu.com, rcojocaru@bitdefender.com List-Id: xen-devel@lists.xenproject.org On Thu, 2015-01-29 at 22:46 +0100, Tamas K Lengyel wrote: > From: Razvan Cojocaru > > The public mem_event structures used to communicate with helper applications via > shared rings have been used in different settings. However, the variable names > within this structure have not reflected this fact, resulting in the reuse of > variables to mean different things under different scenarios. > > This patch remedies the issue by clearly defining the structure members based on > the actual context within which the structure is used. > > Signed-off-by: Razvan Cojocaru > Signed-off-by: Tamas K Lengyel > --- > v3: Add padding to mem_event structures. > Add version field to mem_event structures and checks for it. The addition of versioning is worth mentioning in the commit message IMHO. I'm not going to review the tools changes in detail, since I suppose they are very much mechanical. > - if ( req.gfn > paging->max_pages ) > + if ( req.data.mem_paging.gfn > paging->max_pages ) > { > - ERROR("Requested gfn %"PRIx64" higher than max_pages %x\n", req.gfn, paging->max_pages); > + ERROR("Requested gfn %"PRIx64" higher than max_pages %x\n", req.data.mem_paging.gfn, paging->max_pages); If you could wrap some of these lines which have become even more overly long here as you change them then that would be much appreciated. > + union { > + struct mem_event_paging_data mem_paging; > + struct mem_event_sharing_data mem_sharing; > + struct mem_event_mem_access_data mem_access; > + struct mem_event_mov_to_cr_data mov_to_cr; > + struct mem_event_mov_to_msr_data mov_to_msr; > + struct mem_event_software_breakpoint_data software_breakpoint; > + struct mem_event_singlestep_data singlestep; > + } data; We typically call these unions "u" but that's up to the hypervisor guys really. Ian.