From: "Jan Beulich" Subject: Re: [PATCH v2 04/12] x86/altp2m: basic data structures and support routines. Date: Wed, 24 Jun 2015 11:23:01 +0100 Message-ID: <558AA1250200007800088C7F@mail.emea.novell.com> References: <1434999372-3688-1-git-send-email-edmund.h.white@intel.com> <1434999372-3688-5-git-send-email-edmund.h.white@intel.com> <558A813F.4050402@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <558A813F.4050402@citrix.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: Andrew Cooper , Ed White Cc: RaviSahita , Wei Liu , Tim Deegan , Ian Jackson , xen-devel@lists.xen.org, tlengyel@novetta.com, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org >>> On 24.06.15 at 12:06, wrote: > On 22/06/15 19:56, Ed White wrote: >> @@ -498,6 +498,24 @@ int hap_enable(struct domain *d, u32 mode) >> goto out; >> } >> >> + /* Init alternate p2m data */ >> + if ( (d->arch.altp2m_eptp = alloc_xenheap_page()) == NULL ) > > Please use alloc_domheap_page() and map_domain_page_global() so the > allocation is accounted against the domain. The suggestion is okay, but it would be NULL that gets passed as domain pointer here, i.e. there wouldn't be any accounting anyway (we'd gain a wider pool to allocate from, but now that we have vmalloc(), that should be considered as an option here too). Or shouldn't this memory come from the P2M pool anyway? What I also dislike here is an EPT specific allocation in hap.c. Jan