efi/fake_mem: arrange for a resource entry per efi_fake_mem instance
[linux-2.6-microblaze.git] / arch / x86 / kernel / e820.c
index 983cd53..22aad41 100644 (file)
@@ -305,6 +305,20 @@ static int __init cpcompare(const void *a, const void *b)
        return (ap->addr != ap->entry->addr) - (bp->addr != bp->entry->addr);
 }
 
+static bool e820_nomerge(enum e820_type type)
+{
+       /*
+        * These types may indicate distinct platform ranges aligned to
+        * numa node, protection domain, performance domain, or other
+        * boundaries. Do not merge them.
+        */
+       if (type == E820_TYPE_PRAM)
+               return true;
+       if (type == E820_TYPE_SOFT_RESERVED)
+               return true;
+       return false;
+}
+
 int __init e820__update_table(struct e820_table *table)
 {
        struct e820_entry *entries = table->entries;
@@ -380,7 +394,7 @@ int __init e820__update_table(struct e820_table *table)
                }
 
                /* Continue building up new map based on this information: */
-               if (current_type != last_type || current_type == E820_TYPE_PRAM) {
+               if (current_type != last_type || e820_nomerge(current_type)) {
                        if (last_type != 0)      {
                                new_entries[new_nr_entries].size = change_point[chg_idx]->addr - last_addr;
                                /* Move forward only if the new size was non-zero: */