From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH V5 08/12] xen/vm_event: Check for VM_EVENT_FLAG_DUMMY only in Debug builds Date: Fri, 13 Feb 2015 20:14:39 +0000 Message-ID: <54DE5B2F.60108@citrix.com> References: <1423845203-18941-1-git-send-email-tamas.lengyel@zentific.com> <1423845203-18941-9-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: <1423845203-18941-9-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 , xen-devel@lists.xen.org Cc: kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, tim@xen.org, steve@zentific.com, jbeulich@suse.com, eddie.dong@intel.com, andres@lagarcavilla.org, jun.nakajima@intel.com, rshriram@cs.ubc.ca, keir@xen.org, dgdegra@tycho.nsa.gov, yanghy@cn.fujitsu.com, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 13/02/15 16:33, Tamas K Lengyel wrote: > The flag is only used for debugging purposes, thus it should be only checked > for in debug builds of Xen. > > Signed-off-by: Tamas K Lengyel What is the purpose of the dummy flag? I would have thought it would be more dangerous to accidentally process a dummy response in a non-debug Xen. ~Andrew > --- > xen/arch/x86/mm/mem_sharing.c | 2 ++ > xen/arch/x86/mm/p2m.c | 2 ++ > xen/common/mem_access.c | 2 ++ > 3 files changed, 6 insertions(+) > > diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c > index 4e5477a..0459544 100644 > --- a/xen/arch/x86/mm/mem_sharing.c > +++ b/xen/arch/x86/mm/mem_sharing.c > @@ -606,8 +606,10 @@ int mem_sharing_sharing_resume(struct domain *d) > continue; > } > > +#ifndef NDEBUG > if ( rsp.flags & VM_EVENT_FLAG_DUMMY ) > continue; > +#endif > > /* Validate the vcpu_id in the response. */ > if ( (rsp.vcpu_id >= d->max_vcpus) || !d->vcpu[rsp.vcpu_id] ) > diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c > index 5ce852e..68d57d7 100644 > --- a/xen/arch/x86/mm/p2m.c > +++ b/xen/arch/x86/mm/p2m.c > @@ -1312,8 +1312,10 @@ void p2m_mem_paging_resume(struct domain *d) > continue; > } > > +#ifndef NDEBUG > if ( rsp.flags & VM_EVENT_FLAG_DUMMY ) > continue; > +#endif > > /* Validate the vcpu_id in the response. */ > if ( (rsp.vcpu_id >= d->max_vcpus) || !d->vcpu[rsp.vcpu_id] ) > diff --git a/xen/common/mem_access.c b/xen/common/mem_access.c > index a6d82d1..63f2b52 100644 > --- a/xen/common/mem_access.c > +++ b/xen/common/mem_access.c > @@ -44,8 +44,10 @@ void mem_access_resume(struct domain *d) > continue; > } > > +#ifndef NDEBUG > if ( rsp.flags & VM_EVENT_FLAG_DUMMY ) > continue; > +#endif > > /* Validate the vcpu_id in the response. */ > if ( (rsp.vcpu_id >= d->max_vcpus) || !d->vcpu[rsp.vcpu_id] )