Merge branch 'stable/bug-fixes-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

* 'stable/bug-fixes-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen/setup: Route halt operations to safe_halt pvop.
xen/e820: Guard against E820_RAM not having page-aligned size or start.
xen/p2m: Mark INVALID_P2M_ENTRY the mfn_list past max_pfn.

+12 -12
+5 -11
arch/x86/xen/p2m.c
··· 241 * As long as the mfn_list has enough entries to completely 242 * fill a p2m page, pointing into the array is ok. But if 243 * not the entries beyond the last pfn will be undefined. 244 - * And guessing that the 'what-ever-there-is' does not take it 245 - * too kindly when changing it to invalid markers, a new page 246 - * is allocated, initialized and filled with the valid part. 247 */ 248 if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) { 249 unsigned long p2midx; 250 - unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE); 251 - p2m_init(p2m); 252 253 - for (p2midx = 0; pfn + p2midx < max_pfn; p2midx++) { 254 - p2m[p2midx] = mfn_list[pfn + p2midx]; 255 - } 256 - p2m_top[topidx][mididx] = p2m; 257 - } else 258 - p2m_top[topidx][mididx] = &mfn_list[pfn]; 259 } 260 261 m2p_override_init();
··· 241 * As long as the mfn_list has enough entries to completely 242 * fill a p2m page, pointing into the array is ok. But if 243 * not the entries beyond the last pfn will be undefined. 244 */ 245 if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) { 246 unsigned long p2midx; 247 248 + p2midx = max_pfn % P2M_PER_PAGE; 249 + for ( ; p2midx < P2M_PER_PAGE; p2midx++) 250 + mfn_list[pfn + p2midx] = INVALID_P2M_ENTRY; 251 + } 252 + p2m_top[topidx][mididx] = &mfn_list[pfn]; 253 } 254 255 m2p_override_init();
+7 -1
arch/x86/xen/setup.c
··· 179 e820.nr_map = 0; 180 xen_extra_mem_start = mem_end; 181 for (i = 0; i < memmap.nr_entries; i++) { 182 - unsigned long long end = map[i].addr + map[i].size; 183 184 if (map[i].type == E820_RAM && end > mem_end) { 185 /* RAM off the end - may be partially included */ 186 u64 delta = min(map[i].size, end - mem_end); ··· 355 boot_cpu_data.hlt_works_ok = 1; 356 #endif 357 pm_idle = default_idle; 358 359 fiddle_vdso(); 360 }
··· 179 e820.nr_map = 0; 180 xen_extra_mem_start = mem_end; 181 for (i = 0; i < memmap.nr_entries; i++) { 182 + unsigned long long end; 183 184 + /* Guard against non-page aligned E820 entries. */ 185 + if (map[i].type == E820_RAM) 186 + map[i].size -= (map[i].size + map[i].addr) % PAGE_SIZE; 187 + 188 + end = map[i].addr + map[i].size; 189 if (map[i].type == E820_RAM && end > mem_end) { 190 /* RAM off the end - may be partially included */ 191 u64 delta = min(map[i].size, end - mem_end); ··· 350 boot_cpu_data.hlt_works_ok = 1; 351 #endif 352 pm_idle = default_idle; 353 + boot_option_idle_override = IDLE_HALT; 354 355 fiddle_vdso(); 356 }