All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: EFI's -mapbs option may cause Linux to panic()
Date: Mon, 21 Nov 2022 17:48:10 +0100	[thread overview]
Message-ID: <Y3uryky3urmQlIjs@Air-de-Roger> (raw)
In-Reply-To: <60663f81-09cd-e46b-bb94-1afe50519086@suse.com>

On Mon, Nov 21, 2022 at 05:27:16PM +0100, Jan Beulich wrote:
> Hello,
> 
> on a system with these first two EFI memory map entries
> 
> (XEN)  0000000000000-000000009dfff type=4 attr=000000000000000f
> (XEN)  000000009e000-000000009ffff type=2 attr=000000000000000f
> 
> i.e. except for 2 pages all space below 1M being BootServicesData, the
> -mapbs option has the effect of marking reserved all that space. Then
> Linux fails trying to allocate its lowmem trampoline (which really it
> shouldn't need when running in PV mode), ultimately leading to
> 
> 		panic("Real mode trampoline was not allocated");
> 
> in their init_real_mode().
> 
> While for PV I think it is clear that the easiest is to avoid
> trampoline setup in the first place, iirc PVH Dom0 also tries to
> mirror the host memory map to its own address space. Does PVH Linux
> require a lowmem trampoline?

Yes, it does AFAIK.  I guess those two pages won't be enough for
Linux boot trampoline requirements then.

I assume native Linux is fine with this memory map because it reclaims
the EfiBootServicesData region and that's enough.

> While the two pages here are just enough for Xen's trampoline, I still
> wonder whether we want to adjust -mapbs behavior. Since whatever we
> might do leaves a risk of conflicting with true firmware (mis)use of
> that space, the best I can think of right now would be another option
> altering behavior (or providing altered behavior). Yet such an option
> would likely need to be more fine-grained then than covering all of
> the low Mb in one go. Which feels like both going too far and making
> it awkward for people to figure out what value(s) to use ...
> 
> Thoughts anyone?

I'm unsure what to recommend.  The mapbs option is a workaround for
broken firmware, and it's not enabled by default, so we might be lucky
and never find a system with a memory map like you describe that also
requires mapbs in order to boot.

Any native OS would also have problems booting in such system if it
has any option similar to mapbs, so I don't see much solution.

Thanks, Roger.


  reply	other threads:[~2022-11-21 16:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 16:27 EFI's -mapbs option may cause Linux to panic() Jan Beulich
2022-11-21 16:48 ` Roger Pau Monné [this message]
2022-11-21 17:01   ` Jan Beulich
2022-11-22  9:47     ` Roger Pau Monné
2022-11-23  7:39       ` Juergen Gross
2022-11-23  9:18         ` Jan Beulich
2022-11-23 10:18           ` Juergen Gross

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=Y3uryky3urmQlIjs@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.