WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Use pfn_to_page in initial memory mapping

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Use pfn_to_page in initial memory mapping
From: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
Date: Tue, 7 Nov 2006 02:44:26 -0200
Delivery-date: Mon, 06 Nov 2006 20:44:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11
the mem_map structure is only visible in the flatmem memory model. We
should be a little bit more agnostic on this.

A patch follows.
-- 
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
# HG changeset patch
# User Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
# Node ID 9a9e51d2ca56a15f9c9e8bb23658a715defe2e97
# Parent  20204db0891b0b7c10959822e3283656c3600500
[LINUX] Use pfn_to_page instead of relying in memory assumptions

This makes usage agnostic on the memory model being used.

Signed-off-by: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>

diff -r 20204db0891b -r 9a9e51d2ca56 
linux-2.6-xen-sparse/arch/i386/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c      Thu Nov  2 18:52:04 2006
+++ b/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c      Tue Nov  7 04:41:14 2006
@@ -663,8 +663,8 @@
        totalram_pages += free_all_bootmem();
        /* XEN: init and count low-mem pages outside initial allocation. */
        for (pfn = xen_start_info->nr_pages; pfn < max_low_pfn; pfn++) {
-               ClearPageReserved(&mem_map[pfn]);
-               set_page_count(&mem_map[pfn], 1);
+               ClearPageReserved(pfn_to_page(pfn));
+               set_page_count(pfn_to_page(pfn), 1);
                totalram_pages++;
        }
 
diff -r 20204db0891b -r 9a9e51d2ca56 
linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c    Thu Nov  2 18:52:04 2006
+++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c    Tue Nov  7 04:41:14 2006
@@ -913,8 +913,8 @@
 #endif
        /* XEN: init and count pages outside initial allocation. */
        for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) {
-               ClearPageReserved(&mem_map[pfn]);
-               set_page_count(&mem_map[pfn], 1);
+               ClearPageReserved(pfn_to_page(pfn));
+               set_page_count(pfn_to_page(pfn), 1);
                totalram_pages++;
        }
        reservedpages = end_pfn - totalram_pages - e820_hole_size(0, end_pfn);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Use pfn_to_page in initial memory mapping, Glauber de Oliveira Costa <=