All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Chartier <aurelien.chartier@citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: Ross Philipson <Ross.Philipson@citrix.com>,
	"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Kernel panic with tboot E820_UNUSABLE region
Date: Tue, 14 May 2013 12:06:16 +0100	[thread overview]
Message-ID: <51921AA8.1010807@citrix.com> (raw)

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

             reply	other threads:[~2013-05-14 11:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 11:06 Aurelien Chartier [this message]
2013-05-14 13:40 ` Kernel panic with tboot E820_UNUSABLE region 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51921AA8.1010807@citrix.com \
    --to=aurelien.chartier@citrix.com \
    --cc=Ross.Philipson@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.