xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] extend_brk and fixes to users of extend_brk (v1).
@ 2012-07-31 10:42 Konrad Rzeszutek Wilk
  2012-07-31 10:42 ` [PATCH 1/3] xen/mmu/p2m: Check extend_brk for NULL Konrad Rzeszutek Wilk
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-07-31 10:42 UTC (permalink / raw)
  To: linux-kernel, xen-devel, Ian.Campbell, hpa, x86

In v3.5 I've added some patches that during boot-time and add more
entries to the P2M tree: http://lists.xen.org/archives/html/xen-devel/2012-04/msg01152.html
which worked great on all my machines. But there were some folks
who reported that it caused them at bootup to hit this:

(XEN) domain_crash_sync called from entry.S
(XEN) CPU:    0
(XEN) RIP:    e033:[<ffffffff818aad3b>]
(XEN) RFLAGS: 0000000000000206   EM: 1   CONTEXT: pv guest
(XEN) rax: ffffffff81a7c000   rbx: 000000000000003d   rcx: 0000000000001000
(XEN) rdx: ffffffff81a7b000   rsi: 0000000000001000   rdi: 0000000000001000
(XEN) rbp: ffffffff81801cd8   rsp: ffffffff81801c98   r8:  0000000000100000
(XEN) r9:  ffffffff81a7a000   r10: 0000000000000001   r11: 0000000000000003
(XEN) r12: 0000000000000004   r13: 0000000000000004   r14: 000000000000003d
(XEN) r15: 00000000000001e8   cr0: 000000008005003b   cr4: 00000000000006f0
(XEN) cr3: 0000000125803000   cr2: 0000000000000000
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: e02b   cs: e033
(XEN) Guest stack trace from rsp=ffffffff81801c98:

The failure was that my patches depended on the __brk_base to be large.
On v3.5 due to some other patches (not sure which ones) the space is quite
large (around ~4MB) while in previous kernels its ~344kB. But depending
on the compiler to fix my mistake is not really the best way. So patch:

 [PATCH 2/3] xen/p2m: Reserve 4MB of _brk space for P2M leafs when

fixes this, while 
 [PATCH 1/3] xen/mmu/p2m: Check extend_brk for NULL

gets in line with the DMI code to check extend_brk for NULL, and lastly:

 [PATCH 3/3] x86: Let extend_brk return a NULL pointer instead of

makes extend_brk not do BUG_ON and instead just return NULL. This allows
us to handle the bootup issues more gracefully.

Note, I've also posted another variant of this:
http://lists.xen.org/archives/html/xen-devel/2012-07/msg01401.html
which Ian pointed out is a bit fragile.

Looking forward to your comments.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-31 17:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31 10:42 [PATCH] extend_brk and fixes to users of extend_brk (v1) Konrad Rzeszutek Wilk
2012-07-31 10:42 ` [PATCH 1/3] xen/mmu/p2m: Check extend_brk for NULL Konrad Rzeszutek Wilk
2012-07-31 13:48   ` Konrad Rzeszutek Wilk
2012-07-31 10:42 ` [PATCH 2/3] xen/p2m: Reserve 4MB of _brk space for P2M leafs when populating back Konrad Rzeszutek Wilk
2012-07-31 10:42 ` [PATCH 3/3] x86: Let extend_brk return a NULL pointer instead of just BUG_ON Konrad Rzeszutek Wilk
2012-07-31 15:49 ` [PATCH] extend_brk and fixes to users of extend_brk (v1) H. Peter Anvin
2012-07-31 16:15   ` Konrad Rzeszutek Wilk
2012-07-31 16:41     ` [Xen-devel] " Jan Beulich
2012-07-31 17:29       ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).