ia64/xen-unstable

changeset 16778:851c52be63df

[IA64] domheap: Allocate PV privregs pages from domain heap

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Thu Jan 17 12:05:43 2008 -0700 (2008-01-17)
parents db81d2f94866
children 17751a50accb
files xen/arch/ia64/xen/domain.c
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Thu Jan 17 12:05:43 2008 -0700
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Jan 17 12:05:43 2008 -0700
     1.3 @@ -400,7 +400,7 @@ void relinquish_vcpu_resources(struct vc
     1.4  	if (HAS_PERVCPU_VHPT(v->domain))
     1.5  		pervcpu_vhpt_free(v);
     1.6  	if (v->arch.privregs != NULL) {
     1.7 -		free_xenheap_pages(v->arch.privregs,
     1.8 +		free_domheap_pages(virt_to_page(v->arch.privregs),
     1.9  		                   get_order_from_shift(XMAPPEDREGS_SHIFT));
    1.10  		v->arch.privregs = NULL;
    1.11  	}
    1.12 @@ -501,6 +501,7 @@ static void vcpu_share_privregs_with_gue
    1.13  int vcpu_late_initialise(struct vcpu *v)
    1.14  {
    1.15  	struct domain *d = v->domain;
    1.16 +	struct page_info *page;
    1.17  	int rc, order;
    1.18  
    1.19  	if (HAS_PERVCPU_VHPT(d)) {
    1.20 @@ -511,7 +512,11 @@ int vcpu_late_initialise(struct vcpu *v)
    1.21  
    1.22  	/* Create privregs page. */
    1.23  	order = get_order_from_shift(XMAPPEDREGS_SHIFT);
    1.24 -	v->arch.privregs = alloc_xenheap_pages(order);
    1.25 +	page = alloc_domheap_pages(NULL, order, 0);
    1.26 +	if (page == NULL)
    1.27 +		return -ENOMEM;
    1.28 +	
    1.29 +	v->arch.privregs = page_to_virt(page);
    1.30  	BUG_ON(v->arch.privregs == NULL);
    1.31  	memset(v->arch.privregs, 0, 1 << XMAPPEDREGS_SHIFT);
    1.32  	vcpu_share_privregs_with_guest(v);