summaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/setup.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-30 11:04:14 +0100
committerMark Brown <broonie@linaro.org>2013-08-30 11:04:14 +0100
commitc79c33af8f867e57ad4b84102db7901aee67485a (patch)
treeaa619736b89a143cfc48f9647493c929523a928a /arch/x86/xen/setup.c
parent1c9a341bbdc14051a4d8c74ea67269786c7d3736 (diff)
parent824ef826f3c4d83d1925a5e351313bfd3e5ca6cb (diff)
downloadop-kernel-dev-c79c33af8f867e57ad4b84102db7901aee67485a.zip
op-kernel-dev-c79c33af8f867e57ad4b84102db7901aee67485a.tar.gz
Merge remote-tracking branch 'asoc/topic/core' into tmp
Diffstat (limited to 'arch/x86/xen/setup.c')
-rw-r--r--arch/x86/xen/setup.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 056d11f..8f3eea6 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -313,6 +313,17 @@ static void xen_align_and_add_e820_region(u64 start, u64 size, int type)
e820_add_region(start, end - start, type);
}
+void xen_ignore_unusable(struct e820entry *list, size_t map_size)
+{
+ struct e820entry *entry;
+ unsigned int i;
+
+ for (i = 0, entry = list; i < map_size; i++, entry++) {
+ if (entry->type == E820_UNUSABLE)
+ entry->type = E820_RAM;
+ }
+}
+
/**
* machine_specific_memory_setup - Hook for machine specific memory setup.
**/
@@ -353,6 +364,17 @@ char * __init xen_memory_setup(void)
}
BUG_ON(rc);
+ /*
+ * Xen won't allow a 1:1 mapping to be created to UNUSABLE
+ * regions, so if we're using the machine memory map leave the
+ * region as RAM as it is in the pseudo-physical map.
+ *
+ * UNUSABLE regions in domUs are not handled and will need
+ * a patch in the future.
+ */
+ if (xen_initial_domain())
+ xen_ignore_unusable(map, memmap.nr_entries);
+
/* Make sure the Xen-supplied memory map is well-ordered. */
sanitize_e820_map(map, memmap.nr_entries, &memmap.nr_entries);
OpenPOWER on IntegriCloud