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

* 'stable/bug-fixes-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
xen: p2m: correctly initialize partial p2m leaf
xen: fix non-ANSI function warning in irq.c

+20 -2
+1 -1
arch/x86/xen/irq.c
··· 126 #endif 127 }; 128 129 - void __init xen_init_irq_ops() 130 { 131 pv_irq_ops = xen_irq_ops; 132 x86_init.irqs.intr_init = xen_init_IRQ;
··· 126 #endif 127 }; 128 129 + void __init xen_init_irq_ops(void) 130 { 131 pv_irq_ops = xen_irq_ops; 132 x86_init.irqs.intr_init = xen_init_IRQ;
+19 -1
arch/x86/xen/p2m.c
··· 237 p2m_top[topidx] = mid; 238 } 239 240 - p2m_top[topidx][mididx] = &mfn_list[pfn]; 241 } 242 243 m2p_override_init();
··· 237 p2m_top[topidx] = mid; 238 } 239 240 + /* 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();