From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH 2/5] xen/vm_access: Support for memory-content hiding Date: Mon, 08 Jun 2015 13:02:38 +0300 Message-ID: <5575683E.4030807@bitdefender.com> References: <1430932352-4289-1-git-send-email-rcojocaru@bitdefender.com> <1430932352-4289-3-git-send-email-rcojocaru@bitdefender.com> <554CFB760200007800078703@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <554CFB760200007800078703@mail.emea.novell.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: Jan Beulich Cc: kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, tim@xen.org, xen-devel@lists.xen.org, eddie.dong@intel.com, Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com, suravee.suthikulpanit@amd.com, boris.ostrovsky@oracle.com, keir@xen.org, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 05/08/2015 07:07 PM, Jan Beulich wrote: >> > --- a/xen/include/asm-x86/domain.h >> > +++ b/xen/include/asm-x86/domain.h >> > @@ -512,6 +513,7 @@ struct arch_vcpu >> > uint32_t emulate_flags; >> > unsigned long gpa; >> > unsigned long eip; >> > + struct vm_event_emul_read_data emul_read_data; > Considering the size of this structure I don't think this should be > there for all vCPU-s of all guests. IOW - please allocate this > dynamically only on domains where it's needed. Looking at the code, it's not immediately clear how to differentiate between a domain where this is needed and one where it is not. At domain init time we don't know, because it might become needed as soon as a vm_event client becomes attached to the domain. Then again, even once a vm_event client attaches to the domain, it might still not be necessary to allocate that structure, as the client might never reply with MEM_ACCESS_SET_EMUL_READ_DATA. The only place where we know for sure that it's needed is in p2m_mem_access_check(), when receiving a vm_event response with MEM_ACCESS_SET_EMUL_READ_DATA (lazy allocation). Would this be alright? Thanks, Razvan