From: "Jan Beulich" Subject: [PATCH 3/5] x86: widen NUMA nodes to be allocated from Date: Thu, 26 Feb 2015 13:54:30 +0000 Message-ID: <54EF33A60200007800064144@mail.emea.novell.com> References: <54EF315902000078000640FF@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part7045C686.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YQytd-0005U0-Va for xen-devel@lists.xenproject.org; Thu, 26 Feb 2015 13:54:34 +0000 In-Reply-To: <54EF315902000078000640FF@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: xen-devel Cc: Andrew Cooper , Dario Faggioli , Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part7045C686.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Jan Beulich --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -285,7 +285,8 @@ struct vcpu_guest_context *alloc_vcpu_gu =20 for ( i =3D 0; i < PFN_UP(sizeof(struct vcpu_guest_context)); ++i ) { - struct page_info *pg =3D alloc_domheap_page(NULL, 0); + struct page_info *pg =3D alloc_domheap_page(current->domain, + MEMF_no_owner); =20 if ( unlikely(pg =3D=3D NULL) ) { @@ -322,7 +323,7 @@ static int setup_compat_l4(struct vcpu * l4_pgentry_t *l4tab; int rc; =20 - pg =3D alloc_domheap_page(NULL, MEMF_node(vcpu_to_node(v))); + pg =3D alloc_domheap_page(v->domain, MEMF_no_owner); if ( pg =3D=3D NULL ) return -ENOMEM; =20 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -1182,7 +1182,7 @@ int __init construct_dom0( } else { - page =3D alloc_domheap_page(NULL, 0); + page =3D alloc_domheap_page(d, MEMF_no_owner); if ( !page ) panic("Not enough RAM for domain 0 PML4"); page->u.inuse.type_info =3D PGT_l4_page_table|PGT_validated|1; --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -150,7 +150,7 @@ long arch_do_domctl( break; } =20 - page =3D alloc_domheap_page(NULL, 0); + page =3D alloc_domheap_page(current->domain, MEMF_no_owner); if ( !page ) { ret =3D -ENOMEM; --- a/xen/arch/x86/hvm/stdvga.c +++ b/xen/arch/x86/hvm/stdvga.c @@ -604,7 +604,7 @@ void stdvga_init(struct domain *d) =20 for ( i =3D 0; i !=3D ARRAY_SIZE(s->vram_page); i++ ) { - pg =3D alloc_domheap_page(NULL, MEMF_node(domain_to_node(d))); + pg =3D alloc_domheap_page(d, MEMF_no_owner); if ( pg =3D=3D NULL ) break; s->vram_page[i] =3D pg; --- a/xen/arch/x86/hvm/vlapic.c +++ b/xen/arch/x86/hvm/vlapic.c @@ -1417,7 +1417,6 @@ HVM_REGISTER_SAVE_RESTORE(LAPIC_REGS, la int vlapic_init(struct vcpu *v) { struct vlapic *vlapic =3D vcpu_vlapic(v); - unsigned int memflags =3D MEMF_node(vcpu_to_node(v)); =20 HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "%d", v->vcpu_id); =20 @@ -1431,7 +1430,7 @@ int vlapic_init(struct vcpu *v) =20 if (vlapic->regs_page =3D=3D NULL) { - vlapic->regs_page =3D alloc_domheap_page(NULL, memflags); + vlapic->regs_page =3D alloc_domheap_page(v->domain, MEMF_no_owner)= ; if ( vlapic->regs_page =3D=3D NULL ) { dprintk(XENLOG_ERR, "alloc vlapic regs error: %d/%d\n", --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5879,7 +5879,6 @@ int create_perdomain_mapping(struct doma l3_pgentry_t *l3tab; l2_pgentry_t *l2tab; l1_pgentry_t *l1tab; - unsigned int memf =3D MEMF_node(domain_to_node(d)); int rc =3D 0; =20 ASSERT(va >=3D PERDOMAIN_VIRT_START && @@ -5887,7 +5886,7 @@ int create_perdomain_mapping(struct doma =20 if ( !d->arch.perdomain_l3_pg ) { - pg =3D alloc_domheap_page(NULL, MEMF_node(domain_to_node(d))); + pg =3D alloc_domheap_page(d, MEMF_no_owner); if ( !pg ) return -ENOMEM; l3tab =3D __map_domain_page(pg); @@ -5908,7 +5907,7 @@ int create_perdomain_mapping(struct doma =20 if ( !(l3e_get_flags(l3tab[l3_table_offset(va)]) & _PAGE_PRESENT) ) { - pg =3D alloc_domheap_page(NULL, memf); + pg =3D alloc_domheap_page(d, MEMF_no_owner); if ( !pg ) { unmap_domain_page(l3tab); @@ -5937,7 +5936,7 @@ int create_perdomain_mapping(struct doma { if ( pl1tab && !IS_NIL(pl1tab) ) { - l1tab =3D alloc_xenheap_pages(0, memf); + l1tab =3D alloc_xenheap_pages(0, MEMF_node(domain_to_node(= d))); if ( !l1tab ) { rc =3D -ENOMEM; @@ -5949,7 +5948,7 @@ int create_perdomain_mapping(struct doma } else { - pg =3D alloc_domheap_page(NULL, memf); + pg =3D alloc_domheap_page(d, MEMF_no_owner); if ( !pg ) { rc =3D -ENOMEM; @@ -5966,7 +5965,7 @@ int create_perdomain_mapping(struct doma if ( ppg && !(l1e_get_flags(l1tab[l1_table_offset(va)]) & _PAGE_PRESENT) = ) { - pg =3D alloc_domheap_page(NULL, memf); + pg =3D alloc_domheap_page(d, MEMF_no_owner); if ( pg ) { clear_domain_page(page_to_mfn(pg)); --- a/xen/arch/x86/mm/hap/hap.c +++ b/xen/arch/x86/mm/hap/hap.c @@ -331,7 +331,7 @@ hap_set_allocation(struct domain *d, uns if ( d->arch.paging.hap.total_pages < pages ) { /* Need to allocate more memory from domheap */ - pg =3D alloc_domheap_page(NULL, MEMF_node(domain_to_node(d)));= + pg =3D alloc_domheap_page(d, MEMF_no_owner); if ( pg =3D=3D NULL ) { HAP_PRINTK("failed to allocate hap pages.\n"); --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -1677,7 +1677,7 @@ static unsigned int sh_set_allocation(st { /* Need to allocate more memory from domheap */ sp =3D (struct page_info *) - alloc_domheap_page(NULL, MEMF_node(domain_to_node(d))); + alloc_domheap_page(d, MEMF_no_owner); if ( sp =3D=3D NULL ) { SHADOW_PRINTK("failed to allocate shadow pages.\n"); --=__Part7045C686.1__= Content-Type: text/plain; name="x86-alloc-for-domain.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-alloc-for-domain.patch" x86: widen NUMA nodes to be allocated from=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/arch/x86/domain.c=0A+++ b/xen/arch/x86/d= omain.c=0A@@ -285,7 +285,8 @@ struct vcpu_guest_context *alloc_vcpu_gu=0A = =0A for ( i =3D 0; i < PFN_UP(sizeof(struct vcpu_guest_context)); ++i = )=0A {=0A- struct page_info *pg =3D alloc_domheap_page(NULL, = 0);=0A+ struct page_info *pg =3D alloc_domheap_page(current->domain,= =0A+ MEMF_no_owner);=0A = =0A if ( unlikely(pg =3D=3D NULL) )=0A {=0A@@ -322,7 = +323,7 @@ static int setup_compat_l4(struct vcpu *=0A l4_pgentry_t = *l4tab;=0A int rc;=0A =0A- pg =3D alloc_domheap_page(NULL, = MEMF_node(vcpu_to_node(v)));=0A+ pg =3D alloc_domheap_page(v->domain, = MEMF_no_owner);=0A if ( pg =3D=3D NULL )=0A return -ENOMEM;=0A = =0A--- a/xen/arch/x86/domain_build.c=0A+++ b/xen/arch/x86/domain_build.c=0A= @@ -1182,7 +1182,7 @@ int __init construct_dom0(=0A }=0A else=0A = {=0A- page =3D alloc_domheap_page(NULL, 0);=0A+ page =3D = alloc_domheap_page(d, MEMF_no_owner);=0A if ( !page )=0A = panic("Not enough RAM for domain 0 PML4");=0A page->u.inuse.type_= info =3D PGT_l4_page_table|PGT_validated|1;=0A--- a/xen/arch/x86/domctl.c= =0A+++ b/xen/arch/x86/domctl.c=0A@@ -150,7 +150,7 @@ long arch_do_domctl(= =0A break;=0A }=0A =0A- page =3D = alloc_domheap_page(NULL, 0);=0A+ page =3D alloc_domheap_page(cur= rent->domain, MEMF_no_owner);=0A if ( !page )=0A = {=0A ret =3D -ENOMEM;=0A--- a/xen/arch/x86/hvm/stdvga.c=0A+= ++ b/xen/arch/x86/hvm/stdvga.c=0A@@ -604,7 +604,7 @@ void stdvga_init(struc= t domain *d)=0A =0A for ( i =3D 0; i !=3D ARRAY_SIZE(s->vram_page);= i++ )=0A {=0A- pg =3D alloc_domheap_page(NULL, MEMF_node(domain= _to_node(d)));=0A+ pg =3D alloc_domheap_page(d, MEMF_no_owner);=0A = if ( pg =3D=3D NULL )=0A break;=0A s->vram_page[= i] =3D pg;=0A--- a/xen/arch/x86/hvm/vlapic.c=0A+++ b/xen/arch/x86/hvm/vlapi= c.c=0A@@ -1417,7 +1417,6 @@ HVM_REGISTER_SAVE_RESTORE(LAPIC_REGS, la=0A = int vlapic_init(struct vcpu *v)=0A {=0A struct vlapic *vlapic =3D = vcpu_vlapic(v);=0A- unsigned int memflags =3D MEMF_node(vcpu_to_node(v))= ;=0A =0A HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "%d", v->vcpu_id);=0A =0A@@ = -1431,7 +1430,7 @@ int vlapic_init(struct vcpu *v)=0A =0A if (vlapic->r= egs_page =3D=3D NULL)=0A {=0A- vlapic->regs_page =3D alloc_domhe= ap_page(NULL, memflags);=0A+ vlapic->regs_page =3D alloc_domheap_pag= e(v->domain, MEMF_no_owner);=0A if ( vlapic->regs_page =3D=3D NULL = )=0A {=0A dprintk(XENLOG_ERR, "alloc vlapic regs = error: %d/%d\n",=0A--- a/xen/arch/x86/mm.c=0A+++ b/xen/arch/x86/mm.c=0A@@ = -5879,7 +5879,6 @@ int create_perdomain_mapping(struct doma=0A = l3_pgentry_t *l3tab;=0A l2_pgentry_t *l2tab;=0A l1_pgentry_t = *l1tab;=0A- unsigned int memf =3D MEMF_node(domain_to_node(d));=0A = int rc =3D 0;=0A =0A ASSERT(va >=3D PERDOMAIN_VIRT_START &&=0A@@ = -5887,7 +5886,7 @@ int create_perdomain_mapping(struct doma=0A =0A if = ( !d->arch.perdomain_l3_pg )=0A {=0A- pg =3D alloc_domheap_page(= NULL, MEMF_node(domain_to_node(d)));=0A+ pg =3D alloc_domheap_page(d= , MEMF_no_owner);=0A if ( !pg )=0A return -ENOMEM;=0A = l3tab =3D __map_domain_page(pg);=0A@@ -5908,7 +5907,7 @@ int = create_perdomain_mapping(struct doma=0A =0A if ( !(l3e_get_flags(l3tab[= l3_table_offset(va)]) & _PAGE_PRESENT) )=0A {=0A- pg =3D = alloc_domheap_page(NULL, memf);=0A+ pg =3D alloc_domheap_page(d, = MEMF_no_owner);=0A if ( !pg )=0A {=0A = unmap_domain_page(l3tab);=0A@@ -5937,7 +5936,7 @@ int create_perdomain_mapp= ing(struct doma=0A {=0A if ( pl1tab && !IS_NIL(pl1tab) = )=0A {=0A- l1tab =3D alloc_xenheap_pages(0, = memf);=0A+ l1tab =3D alloc_xenheap_pages(0, MEMF_node(domain= _to_node(d)));=0A if ( !l1tab )=0A {=0A = rc =3D -ENOMEM;=0A@@ -5949,7 +5948,7 @@ int create_perdoma= in_mapping(struct doma=0A }=0A else=0A = {=0A- pg =3D alloc_domheap_page(NULL, memf);=0A+ = pg =3D alloc_domheap_page(d, MEMF_no_owner);=0A if ( = !pg )=0A {=0A rc =3D -ENOMEM;=0A@@ = -5966,7 +5965,7 @@ int create_perdomain_mapping(struct doma=0A if = ( ppg &&=0A !(l1e_get_flags(l1tab[l1_table_offset(va)]) & = _PAGE_PRESENT) )=0A {=0A- pg =3D alloc_domheap_page(NULL= , memf);=0A+ pg =3D alloc_domheap_page(d, MEMF_no_owner);=0A = if ( pg )=0A {=0A clear_domain_page(pa= ge_to_mfn(pg));=0A--- a/xen/arch/x86/mm/hap/hap.c=0A+++ b/xen/arch/x86/mm/h= ap/hap.c=0A@@ -331,7 +331,7 @@ hap_set_allocation(struct domain *d, uns=0A = if ( d->arch.paging.hap.total_pages < pages )=0A {=0A = /* Need to allocate more memory from domheap */=0A- pg = =3D alloc_domheap_page(NULL, MEMF_node(domain_to_node(d)));=0A+ = pg =3D alloc_domheap_page(d, MEMF_no_owner);=0A if ( pg =3D=3D = NULL )=0A {=0A HAP_PRINTK("failed to allocate = hap pages.\n");=0A--- a/xen/arch/x86/mm/shadow/common.c=0A+++ b/xen/arch/x8= 6/mm/shadow/common.c=0A@@ -1677,7 +1677,7 @@ static unsigned int sh_set_all= ocation(st=0A {=0A /* Need to allocate more memory = from domheap */=0A sp =3D (struct page_info *)=0A- = alloc_domheap_page(NULL, MEMF_node(domain_to_node(d)));=0A+ = alloc_domheap_page(d, MEMF_no_owner);=0A if ( sp =3D=3D = NULL )=0A {=0A SHADOW_PRINTK("failed to = allocate shadow pages.\n");=0A --=__Part7045C686.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part7045C686.1__=--