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

[Xen-changelog] [xen-unstable] xen: Understand the E820_UNUSABLE (type code 5) memory type.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1188468099 -3600
# Node ID 1c19a3430ab135260a7ede669462c721a7de8ae9
# Parent  c398dad9d50a5d3f16155f0c3f6c5faf8907f9a7
xen: Understand the E820_UNUSABLE (type code 5) memory type.
Signed-off-by: Joseph Cihula <joseph.cihula@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/domain_build.c |   10 ++++++++++
 xen/arch/x86/e820.c         |    9 +++++++--
 xen/arch/x86/mm.c           |    4 +++-
 xen/arch/x86/setup.c        |    3 +--
 xen/include/asm-x86/e820.h  |    1 +
 5 files changed, 22 insertions(+), 5 deletions(-)

diff -r c398dad9d50a -r 1c19a3430ab1 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Thu Aug 30 09:57:09 2007 +0100
+++ b/xen/arch/x86/domain_build.c       Thu Aug 30 11:01:39 2007 +0100
@@ -989,6 +989,16 @@ int __init construct_dom0(
             rc |= iomem_deny_access(dom0, mfn, mfn);
     }
 
+    /* Remove access to E820_UNUSABLE I/O regions. */
+    for ( i = 0; i < e820.nr_map; i++ )
+    {
+        if ( e820.map[i].type != E820_UNUSABLE)
+            continue;
+        mfn = paddr_to_pfn(e820.map[i].addr);
+        nr_pages = (e820.map[i].size + PAGE_SIZE - 1) >> PAGE_SHIFT;
+        rc |= iomem_deny_access(dom0, mfn, mfn + nr_pages - 1);
+    }
+
     BUG_ON(rc != 0);
 
     return 0;
diff -r c398dad9d50a -r 1c19a3430ab1 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c       Thu Aug 30 09:57:09 2007 +0100
+++ b/xen/arch/x86/e820.c       Thu Aug 30 11:01:39 2007 +0100
@@ -41,7 +41,8 @@ static void __init print_e820_memory_map
                (unsigned long long)(map[i].addr),
                (unsigned long long)(map[i].addr + map[i].size));
         switch (map[i].type) {
-        case E820_RAM: printk("(usable)\n");
+        case E820_RAM:
+            printk("(usable)\n");
             break;
         case E820_RESERVED:
             printk("(reserved)\n");
@@ -52,7 +53,11 @@ static void __init print_e820_memory_map
         case E820_NVS:
             printk("(ACPI NVS)\n");
             break;
-        default:       printk("type %u\n", map[i].type);
+        case E820_UNUSABLE:
+            printk("(unusable)\n");
+            break;
+        default:
+            printk("type %u\n", map[i].type);
             break;
         }
     }
diff -r c398dad9d50a -r 1c19a3430ab1 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Thu Aug 30 09:57:09 2007 +0100
+++ b/xen/arch/x86/mm.c Thu Aug 30 11:01:39 2007 +0100
@@ -213,7 +213,9 @@ void __init arch_init_memory(void)
     /* Any areas not specified as RAM by the e820 map are considered I/O. */
     for ( i = 0, pfn = 0; pfn < max_page; i++ )
     {
-        while ( (i < e820.nr_map) && (e820.map[i].type != E820_RAM) )
+        while ( (i < e820.nr_map) &&
+                (e820.map[i].type != E820_RAM) &&
+                (e820.map[i].type != E820_UNUSABLE) )
             i++;
 
         if ( i >= e820.nr_map )
diff -r c398dad9d50a -r 1c19a3430ab1 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Thu Aug 30 09:57:09 2007 +0100
+++ b/xen/arch/x86/setup.c      Thu Aug 30 11:01:39 2007 +0100
@@ -610,8 +610,7 @@ void __init __start_xen(unsigned long mb
                 ((u64)map->base_addr_high << 32) | (u64)map->base_addr_low;
             e820_raw[e820_raw_nr].size = 
                 ((u64)map->length_high << 32) | (u64)map->length_low;
-            e820_raw[e820_raw_nr].type = 
-                (map->type > E820_NVS) ? E820_RESERVED : map->type;
+            e820_raw[e820_raw_nr].type = map->type;
             e820_raw_nr++;
 
             bytes += map->size + 4;
diff -r c398dad9d50a -r 1c19a3430ab1 xen/include/asm-x86/e820.h
--- a/xen/include/asm-x86/e820.h        Thu Aug 30 09:57:09 2007 +0100
+++ b/xen/include/asm-x86/e820.h        Thu Aug 30 11:01:39 2007 +0100
@@ -8,6 +8,7 @@
 #define E820_RESERVED     2
 #define E820_ACPI         3
 #define E820_NVS          4
+#define E820_UNUSABLE     5
 
 struct e820entry {
     uint64_t addr;

_______________________________________________
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®.