All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: Aurelien Chartier <aurelien.chartier@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Jan Beulich <JBeulich@suse.com>,
	Ross Philipson <Ross.Philipson@citrix.com>
Subject: Re: Kernel panic with tboot E820_UNUSABLE region
Date: Tue, 14 May 2013 13:47:10 -0400	[thread overview]
Message-ID: <20130514174710.GA10764@konrad-lan.dumpdata.com> (raw)
In-Reply-To: <5192716B.8030305@citrix.com>

On Tue, May 14, 2013 at 06:16:27PM +0100, David Vrabel wrote:
> On 14/05/13 18:02, Konrad Rzeszutek Wilk wrote:
> > David Vrabel <david.vrabel@citrix.com> wrote:
> > 
> >> On 14/05/13 15:46, Jan Beulich wrote:
> >>>>>> On 14.05.13 at 16:33, Aurelien Chartier
> >> <aurelien.chartier@citrix.com> wrote:
> >>>
> >>> With
> >>>
> >>>> (XEN)  0000000000100000 - 0000000000800000 (usable)
> >>>> (XEN)  0000000000800000 - 0000000000975000 (unusable)
> >>>> (XEN)  0000000000975000 - 0000000020000000 (usable)
> >>>> ...
> >>>> The region 0000000000975000 - 0000000020000000 has been set to
> >> unusable
> >>>> by tboot.
> >>>
> >>> ... you certainly mean the range 800000-975000.
> >>>
> >>>> Calls to update_va_mapping show the following error messages (with
> >> mfn
> >>>> going from 800 to 974):
> >>>>
> >>>> (XEN) mm.c:911:d0 Error getting mfn 800 (pfn 5555555555555555) from
> >> L1
> >>>> entry 0000000000800463 for l1e_owner=0, pg_owner=0
> >>>
> >>> Yes, the kernel has no business mapping that region, and the
> >>> hypervisor rightly refuses the attempt.
> >>
> >> Ok, so this is Xen checking the new PTE supplied in the
> >> update_va_mapping hypercall and saying no.
> >>
> >> I think there are two things the kernel can do here.
> >>
> >> a) Change the type of UNUSABLE regions to RAM.
> >>
> >> b) Release pages overlapping UNUSABLE regions, destroy their mapping
> >> and
> >> clear/invalidate the region in the p2m.
> >>
> >> Option a) is probably the easiest.
> >>
> >> David
> > 
> > But option b) seems the proper one.
> 
> Well...  The pfns currently overlapping the machine's UNUSABLE region
> are usable RAM and nothing else is the kernel will want to access any
> machine address within this region (and evidently can't, even if it
> wanted to!).
> 
> If it helps, think of it as dom0 taking the pseudo-physical memory map
> and putting holes in it to corresponding to interesting bits of the
> machine memory map.  UNUSABLE regions aren't interesting so we don't
> make holes for them.

We do in the Linux's P2M. We mark them as 1:1, meaning that they the
MFNs we get from the P2M should be the PFN value. And the M2P.. well
that looks to be always 55555.

And that logic looks to be same irregardless if the regions are
E820_RESERVED, E820_UNUSABLE or just MMIO gaps. This is looking at
xen_set_identity_and_release which calls the
xen_set_identity_and_release_chunk (which calls set_phys_range_identity
to set the P2M for 1-1 mapping).

I think I am missing something?
Or when you say 'p2m' you are referring to the hypervisor's direct map?

  reply	other threads:[~2013-05-14 17:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=20130514174710.GA10764@konrad-lan.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=Ross.Philipson@citrix.com \
    --cc=aurelien.chartier@citrix.com \
    --cc=david.vrabel@citrix.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.