From: Glauber de Oliveira Costa Subject: [PATCH] Use pfn_to_page in initial memory mapping Date: Tue, 7 Nov 2006 02:44:26 -0200 Message-ID: <20061107044426.GB31301@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ibTvN161/egqYuK8" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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" --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="xen-pfn_to_page.patch" # HG changeset patch # User Glauber de Oliveira Costa # 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 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); --ibTvN161/egqYuK8 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.xensource.com http://lists.xensource.com/xen-devel --ibTvN161/egqYuK8--