All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86-64-paging-init.patch
@ 2005-03-22  0:42 Arun Sharma
  0 siblings, 0 replies; only message in thread
From: Arun Sharma @ 2005-03-22  0:42 UTC (permalink / raw)
  To: Ian Pratt, Keir Fraser; +Cc: xen-devel

Calling alloc_boot_pages() after end_boot_allocator() could result in
double allocation of the same page.

Signed-off-by: Chengyuan Li <chengyuan.li@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>

--- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-22  0:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-22  0:42 [PATCH] x86-64-paging-init.patch Arun Sharma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.