From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ed White Subject: Re: [PATCH 05/11] x86/altp2m: basic data structures and support routines. Date: Wed, 25 Mar 2015 13:59:43 -0700 Message-ID: <551321BF.7050201@intel.com> References: <1420838801-11704-1-git-send-email-edmund.h.white@intel.com> <1420838801-11704-6-git-send-email-edmund.h.white@intel.com> <54B50158.7020903@citrix.com> <54B576C8.1010702@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54B576C8.1010702@intel.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: Andrew Cooper , xen-devel@lists.xen.org Cc: ian.jackson@eu.citrix.com, tim@xen.org, keir@xen.org, ian.campbell@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org >>> diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c >>> index abf3d7a..8fe0650 100644 >>> --- a/xen/arch/x86/mm/hap/hap.c >>> +++ b/xen/arch/x86/mm/hap/hap.c >>> @@ -439,7 +439,7 @@ void hap_domain_init(struct domain *d) >>> int hap_enable(struct domain *d, u32 mode) >>> { >>> unsigned int old_pages; >>> - uint8_t i; >>> + uint16_t i; >>> int rv = 0; >>> >>> domain_pause(d); >>> @@ -485,6 +485,23 @@ int hap_enable(struct domain *d, u32 mode) >>> goto out; >>> } >>> >>> + /* Init alternate p2m data */ >>> + if ( (d->arch.altp2m_eptp = alloc_xenheap_page()) == NULL ) >> >> This memory should be allocated from some domain-accounted pool, >> probably the paging pool (d->->arch.paging.alloc_page()). You can use >> map_domain_page_global() to get a safe pointer to anchor in >> d->arch.altp2m_eptp for hardware. I tried this but could not get it to work due to panics in Xen. Looking at the current VMX code, all the existing structures shared with hardware (VMCS, exception bitmap, etc.) are allocated using alloc_xenheap_page(), which is what induced me to write the code this way. Ed