From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 2/3] VMX: allocate VMCS pages from domain heap Date: Tue, 20 Oct 2015 11:12:46 +0100 Message-ID: <5626139E.60906@citrix.com> References: <5625242002000078000AC73A@prv-mh.provo.novell.com> <562526D002000078000AC766@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZoTuV-000670-Gt for xen-devel@lists.xenproject.org; Tue, 20 Oct 2015 10:12:51 +0000 In-Reply-To: <562526D002000078000AC766@prv-mh.provo.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 , xen-devel Cc: Kevin Tian , Jun Nakajima List-Id: xen-devel@lists.xenproject.org On 19/10/15 16:22, Jan Beulich wrote: > -static struct vmcs_struct *vmx_alloc_vmcs(void) > +static paddr_t vmx_alloc_vmcs(void) > { > + struct page_info *pg; > struct vmcs_struct *vmcs; > > - if ( (vmcs = alloc_xenheap_page()) == NULL ) > + if ( (pg = alloc_domheap_page(NULL, 0)) == NULL ) As an observation, it would be good to pass v from the caller, and NUMA allocate against v->domain here. > @@ -580,7 +583,7 @@ int vmx_cpu_up_prepare(unsigned int cpu) > void vmx_cpu_dead(unsigned int cpu) > { > vmx_free_vmcs(per_cpu(vmxon_region, cpu)); > - per_cpu(vmxon_region, cpu) = NULL; > + per_cpu(vmxon_region, cpu) = 0; While this is currently safe (as pa 0 is not part of the available heap allocation range), might it be worth introducing a named sentential? I can forsee a DMLite nested Xen scenario where we definitely don't need to treat the low 1MB magically. > --- a/xen/arch/x86/hvm/vmx/vvmx.c > +++ b/xen/arch/x86/hvm/vmx/vvmx.c > @@ -56,13 +56,14 @@ int nvmx_vcpu_initialise(struct vcpu *v) > { > struct nestedvmx *nvmx = &vcpu_2_nvmx(v); > struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v); > + struct page_info *pg = alloc_domheap_page(NULL, 0); Again - this can be NUMA allocated with v->domain. ~Andrew