[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Rename memory_is_conventional_ram() to page_is_conventional_ram().



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1232879546 0
# Node ID 2f993fde1dc6575c62db8677a5598c6cdbb5a855
# Parent  ef156b933aad4c505f0c1eb8899995aeb1930e91
Rename memory_is_conventional_ram() to page_is_conventional_ram().
It now checks that a whole contiguous page is conventional RAM.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/ia64/xen/mm.c              |    6 +++---
 xen/arch/x86/mm.c                   |    9 +++++----
 xen/drivers/passthrough/vtd/iommu.c |    4 ++--
 xen/drivers/video/vga.c             |    2 +-
 xen/include/xen/mm.h                |    4 ++--
 5 files changed, 13 insertions(+), 12 deletions(-)

diff -r ef156b933aad -r 2f993fde1dc6 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Sun Jan 25 10:16:11 2009 +0000
+++ b/xen/arch/ia64/xen/mm.c    Sun Jan 25 10:32:26 2009 +0000
@@ -3246,9 +3246,9 @@ int get_page_type(struct page_info *page
     return 1;
 }
 
-int memory_is_conventional_ram(paddr_t p)
-{
-    return (efi_mem_type(p) == EFI_CONVENTIONAL_MEMORY);
+int page_is_conventional_ram(unsigned long mfn)
+{
+    return (efi_mem_type(pfn_to_paddr(mfn)) == EFI_CONVENTIONAL_MEMORY);
 }
 
 
diff -r ef156b933aad -r 2f993fde1dc6 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Sun Jan 25 10:16:11 2009 +0000
+++ b/xen/arch/x86/mm.c Sun Jan 25 10:32:26 2009 +0000
@@ -290,15 +290,16 @@ void __init arch_init_memory(void)
     subarch_init_memory();
 }
 
-int memory_is_conventional_ram(paddr_t p)
-{
+int page_is_conventional_ram(unsigned long mfn)
+{
+    uint64_t maddr = pfn_to_paddr(mfn);
     int i;
 
     for ( i = 0; i < e820.nr_map; i++ )
     {
         if ( (e820.map[i].type == E820_RAM) &&
-             (e820.map[i].addr <= p) &&
-             ((e820.map[i].addr + e820.map[i].size) > p) )
+             (e820.map[i].addr <= maddr) &&
+             ((e820.map[i].addr + e820.map[i].size) >= (maddr + PAGE_SIZE)) )
             return 1;
     }
 
diff -r ef156b933aad -r 2f993fde1dc6 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Sun Jan 25 10:16:11 2009 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c       Sun Jan 25 10:32:26 2009 +0000
@@ -998,8 +998,8 @@ static int intel_iommu_domain_init(struc
         /* Set up 1:1 page table for dom0 for all RAM except Xen bits. */
         for ( i = 0; i < max_page; i++ )
         {
-            if ( xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) ||
-                 !memory_is_conventional_ram(i << PAGE_SHIFT) )
+            if ( !page_is_conventional_ram(i) ||
+                 xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) )
                 continue;
 
             tmp = 1 << (PAGE_SHIFT - PAGE_SHIFT_4K);
diff -r ef156b933aad -r 2f993fde1dc6 xen/drivers/video/vga.c
--- a/xen/drivers/video/vga.c   Sun Jan 25 10:16:11 2009 +0000
+++ b/xen/drivers/video/vga.c   Sun Jan 25 10:32:26 2009 +0000
@@ -79,7 +79,7 @@ void __init vga_init(void)
     switch ( vga_console_info.video_type )
     {
     case XEN_VGATYPE_TEXT_MODE_3:
-        if ( memory_is_conventional_ram(0xB8000) ||
+        if ( page_is_conventional_ram(paddr_to_pfn(0xB8000)) ||
              ((video = ioremap(0xB8000, 0x8000)) == NULL) )
             return;
         outw(0x200a, 0x3d4); /* disable cursor */
diff -r ef156b933aad -r 2f993fde1dc6 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h      Sun Jan 25 10:16:11 2009 +0000
+++ b/xen/include/xen/mm.h      Sun Jan 25 10:32:26 2009 +0000
@@ -103,8 +103,8 @@ unsigned long avail_scrub_pages(void);
 
 int guest_remove_page(struct domain *d, unsigned long gmfn);
 
-/* Returns TRUE if the memory at address @p is ordinary RAM. */
-int memory_is_conventional_ram(paddr_t p);
+/* Returns TRUE if the whole page at @mfn is ordinary RAM. */
+int page_is_conventional_ram(unsigned long mfn);
 
 extern unsigned long *alloc_bitmap;    /* for vmcoreinfo */
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.