diff options
| -rw-r--r-- | arch/x86/xen/setup.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index eac010008cd2..1e85e26efa69 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
| @@ -158,9 +158,8 @@ char * __init xen_memory_setup(void) | |||
| 158 | xen_extra_mem_start = mem_end; | 158 | xen_extra_mem_start = mem_end; |
| 159 | for (i = 0; i < memmap.nr_entries; i++) { | 159 | for (i = 0; i < memmap.nr_entries; i++) { |
| 160 | unsigned long long end = map[i].addr + map[i].size; | 160 | unsigned long long end = map[i].addr + map[i].size; |
| 161 | |||
| 161 | if (map[i].type == E820_RAM) { | 162 | if (map[i].type == E820_RAM) { |
| 162 | if (map[i].addr > mem_end) | ||
| 163 | continue; | ||
| 164 | if (end > mem_end) { | 163 | if (end > mem_end) { |
| 165 | /* Truncate region to max_mem. */ | 164 | /* Truncate region to max_mem. */ |
| 166 | map[i].size -= end - mem_end; | 165 | map[i].size -= end - mem_end; |
| @@ -169,7 +168,9 @@ char * __init xen_memory_setup(void) | |||
| 169 | } | 168 | } |
| 170 | } else if (map[i].type != E820_RAM) | 169 | } else if (map[i].type != E820_RAM) |
| 171 | xen_extra_mem_start = end; | 170 | xen_extra_mem_start = end; |
| 172 | if (map[i].size > 0) | 171 | |
| 172 | if ((map[i].type != E820_RAM || map[i].addr < mem_end) && | ||
| 173 | map[i].size > 0) | ||
| 173 | e820_add_region(map[i].addr, map[i].size, map[i].type); | 174 | e820_add_region(map[i].addr, map[i].size, map[i].type); |
| 174 | } | 175 | } |
| 175 | 176 | ||
