From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arun Sharma Subject: [PATCH] x86-64-paging-init.patch Date: Mon, 21 Mar 2005 16:42:36 -0800 Message-ID: <20050322004235.GA25526@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Ian Pratt , Keir Fraser Cc: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org Calling alloc_boot_pages() after end_boot_allocator() could result in double allocation of the same page. Signed-off-by: Chengyuan Li Signed-off-by: Arun Sharma --- 1.21/xen/arch/x86/x86_64/mm.c 2005-03-19 11:36:41 -08:00 +++ edited/xen/arch/x86/x86_64/mm.c 2005-03-21 15:53:23 -08:00 @@ -118,6 +118,7 @@ { unsigned long i, p, max; l3_pgentry_t *l3rw, *l3ro; + struct pfn_info *pg; /* Map all of physical memory. */ max = ((max_page + L1_PAGETABLE_ENTRIES - 1) & @@ -130,10 +131,11 @@ */ for ( i = 0; i < max_page; i += ((1UL << L2_PAGETABLE_SHIFT) / 8) ) { - p = alloc_boot_pages(1UL << L2_PAGETABLE_SHIFT, - 1UL << L2_PAGETABLE_SHIFT); - if ( p == 0 ) + pg = alloc_domheap_pages(NULL, + (L2_PAGETABLE_SHIFT - L1_PAGETABLE_SHIFT)); + if ( pg == 0 ) panic("Not enough memory for m2p table\n"); + p = page_to_phys(pg); map_pages(idle_pg_table, RDWR_MPT_VIRT_START + i*8, p, 1UL << L2_PAGETABLE_SHIFT, PAGE_HYPERVISOR | _PAGE_USER); memset((void *)(RDWR_MPT_VIRT_START + i*8), 0x55, ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click