All of lore.kernel.org
 help / color / mirror / Atom feed
* Kernel panic with tboot E820_UNUSABLE region
@ 2013-05-14 11:06 Aurelien Chartier
  2013-05-14 13:40 ` Konrad Rzeszutek Wilk
  2013-05-14 13:53 ` David Vrabel
  0 siblings, 2 replies; 14+ messages in thread
From: Aurelien Chartier @ 2013-05-14 11:06 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com; +Cc: Ross Philipson, konrad.wilk@oracle.com

Hi everybody,

We noticed a crash in Linux dom0 early boot sequence when running over
tboot and Xen. The issue seemed related with a E820 region that tboot is
setting as E820_UNUSABLE. We posted to tboot-devel to understand better
what could be the cause of the kernel panic. This thread can be read
here :
http://sourceforge.net/mailarchive/forum.php?thread_name=51852B26.7070406%40citrix.com&forum_name=tboot-devel

Following Konrad's advice, we took a closer look at arch/x86/xen/setup.c
and found what could be the cause of the kernel panic. I am not familiar
with that part of Xen, so feel free to correct me.

The Xen memory setup code called during early boot is trying to release
chunks of memory in xen_set_identity_and_release for non-RAM regions
(including E820_UNUSABLE). The xen_set_identity_and_release_chunk
function is calling HYPERVISOR_update_va_mapping, which will fail in our
case. As tboot marked that region as being unusable, Xen did not map
those pages and the later call on get_page_from_l1e (arch/x86/mm.c in
Xen code) is returning an error.  As the return value of the hypercall
is not checked in Linux code, xen_set_identity_and_release_chunk
function is carrying on and tries to release the E820_UNUSABLE chunk.
This is apparently messing up some Xen internal memory structures,
resulting in a kernel crash when Linux is initializing its memory mapping.

A possible fix I have tried is to check the return value of
HYPERVISOR_update_va_mapping and if encountering an error, exit from
xen_set_identity_and_release_chunk. This is fixing the kernel panic, but
I am not sure about other implications by that change.

Any ideas about this issue ?

Thanks in advance,
Aurelien

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

end of thread, other threads:[~2013-05-15  8:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14 11:06 Kernel panic with tboot E820_UNUSABLE region Aurelien Chartier
2013-05-14 13:40 ` Konrad Rzeszutek Wilk
2013-05-14 14:11   ` Jan Beulich
2013-05-14 14:12   ` Aurelien Chartier
2013-05-14 13:53 ` David Vrabel
2013-05-14 14:33   ` Aurelien Chartier
2013-05-14 14:46     ` Jan Beulich
2013-05-14 15:14       ` Aurelien Chartier
2013-05-14 16:49       ` David Vrabel
2013-05-14 17:02         ` Konrad Rzeszutek Wilk
2013-05-14 17:16           ` David Vrabel
2013-05-14 17:47             ` Konrad Rzeszutek Wilk
2013-05-15  8:28             ` Jan Beulich
2013-05-15  7:08         ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.