diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-29 18:40:30 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-29 18:40:30 +0100 |
commit | 72bce45fdecab65936f1e466c5c5107e48f8251e (patch) | |
tree | e5009748ab6136465c812860b7913d06098ed520 /arch/x86/xen/setup.c | |
parent | 0d0c6fddf052ca1e5324297420ed587a95b7be82 (diff) | |
parent | 965abff8d8accdffc4af1b11fcf580e83031330a (diff) |
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-androidlsk-android-13.08
Diffstat (limited to 'arch/x86/xen/setup.c')
-rw-r--r-- | arch/x86/xen/setup.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 94eac5c85cd..0a9fb7a0b45 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); |