From: Borislav Petkov <bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org>
To: "H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
Cc: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Matt Fleming
<matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>,
linux-efi <linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
Subject: Re: EFI runtime and kexec
Date: Sat, 2 Mar 2013 00:07:33 +0100 [thread overview]
Message-ID: <20130301230733.GL30938@pd.tnic> (raw)
In-Reply-To: <513132B0.3050308-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
On Fri, Mar 01, 2013 at 02:58:56PM -0800, H. Peter Anvin wrote:
> >> We seem to have a few options:
> >>
> >> 1. We could always map 1:1, with the EFI mappings being in the "user"
> >> part of the virtual address space. This MAY be what Windows does
> >> already. Some Apple platforms are known to fail in this configuration,
> >> but perhaps we can blacklist those platforms or do something special.
> >>
> >> 2. We could always map them into a fixed address that can be relied upon
> >> to be consistent. The most logical such area is the second quadrant of
> >> the address space (again, in the "user" portion.) It would be
> >> beneficial if we could define it so that whenever Linux needs to go to
> >> more than 48 virtual address bits at some point in the future this can
> >> be compatible between 48-bit and N-bit kernels, but if that is the only
> >> thing that breaks, then oh well.
> >>
> >> 3. We could just always map at the kernel virtual address. The 64-bit
> >> address space is large enough that we could make every ioremap() land at
> >> its identity-mapped address instead of in a unique part of the virtual
> >> address space.
> >>
> >> 4. We could export a table of mappings to the kexec'd kernel. In that
> >> case, we have to re-establish those mappings very early in the kernel
> >> boot so that nothing else steps on them.
> >>
> >> What is quite interesting in your case is that you have a mishmash of
> >> the identity-mapped and the non-identity-mapped mappings.
> >
> > Yeah, the mishmash comes from regions of type EFI_MEMORY_MAPPED_IO which
> > are really ioremapped instead of returning the kernel virtual address.
> >
> > Btw, I always tend to like the simplest approaches so option 3.
> > is kinda winking at me right now. I don't know whether for those
> > EFI_MEMORY_MAPPED_IO type regions though, we can simply return the
> > identity-mapped address.
> >
> > If we can, the advantage would be great because then the kexec kernel
> > would simply parse the efi memmap and use __va() on the physical
> > addresses there and no need for special option passing to it.
> >
>
> We can, and in fact we could do this for *all* ioremap()s in the 64-bit
> kernel. This doesn't help the 32-bit kernel in any way, however.
Right, ok.
> One thing I *really* don't like about it is that it exposes the kernel
> virtual address map as an ABI.
Hmm, yeah, that's nasty. This also means option #2 can go too because
of the fixed addresses. Option #1 is also kinda polluting user address
space so maybe the most elegant one would be #4, AFAICT.
We just need a nice mechanism to tell those mappings to the kexec-d
kernel and when it starts, to establish them right away.
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
next prev parent reply other threads:[~2013-03-01 23:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20130301213903.GI30938@pd.tnic>
[not found] ` <20130301213903.GI30938-fF5Pk5pvG8Y@public.gmane.org>
2013-03-01 22:32 ` EFI runtime and kexec H. Peter Anvin
[not found] ` <51312C8F.8000503-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-03-01 22:53 ` Borislav Petkov
[not found] ` <20130301225303.GK30938-fF5Pk5pvG8Y@public.gmane.org>
2013-03-01 22:58 ` H. Peter Anvin
[not found] ` <513132B0.3050308-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-03-01 23:07 ` Borislav Petkov [this message]
[not found] ` <20130301230733.GL30938-fF5Pk5pvG8Y@public.gmane.org>
2013-03-01 23:30 ` David Woodhouse
[not found] ` <1362180625.29011.4.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2013-03-01 23:34 ` David Woodhouse
[not found] ` <1362180853.29011.6.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2013-03-01 23:36 ` Matthew Garrett
2013-03-01 23:39 ` Borislav Petkov
[not found] ` <20130301233924.GM30938-fF5Pk5pvG8Y@public.gmane.org>
2013-03-01 23:48 ` H. Peter Anvin
2013-03-02 1:11 ` H. Peter Anvin
[not found] ` <513151C2.60907-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2013-03-02 1:51 ` David Woodhouse
[not found] ` <1362189072.32131.6.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2013-03-02 2:04 ` H. Peter Anvin
[not found] ` <94a3c086-b0b2-4820-8f4c-66d1496b89dc-2ueSQiBKiTY7tOexoI0I+QC/G2K4zDHf@public.gmane.org>
2013-03-02 11:47 ` Borislav Petkov
2013-03-01 23:50 ` H. Peter Anvin
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=20130301230733.GL30938@pd.tnic \
--to=bp-gina5biwoiwzqb+pc5nmwq@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org \
--cc=mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.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 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).