From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2] arm64: efi: correctly map runtime regions
Date: Fri, 20 Nov 2015 19:32:33 +0000 [thread overview]
Message-ID: <20151120193232.GB14942@leverpostej> (raw)
In-Reply-To: <CAKv+Gu8XKpZFdRAGTz2FaptzARN+qDLhxgNQYz+_ypHT9TAOgg@mail.gmail.com>
On Fri, Nov 20, 2015 at 07:31:21PM +0100, Ard Biesheuvel wrote:
> On 20 November 2015 at 16:12, Mark Rutland <mark.rutland@arm.com> wrote:
> > Thus we account for the residue twice, and when the residue is non-zero
> > will cause __create_mapping to map an additional page at the end of the
> > region. Depending on the memory map, this page may be in a region we are
> > not intended/permitted to map, or may clash with a different region that
> > we which to map.
> >
>
> wish
Whoops; corrected locally.
> It is worth to note that, since the memory map is virtually always
> sorted in ascending order (especially now that we sort it explicitly
> in the stub), this is highly unlikely to cause trouble in practice,
> since the additional page mapping is always at the top, and will be
> corrected as it is overwritten by the subsequent entry.
I agree that in the common case we are extremely likely to overwrite and
correct an erroneous entry (especially given that's how I detected this
in the first place).
I've added a note to that effect.
If there is no next entry, or it's start address is sufficiently far
away, we won't fix up the erroneous entry. It seems either that case is
unlikely, or the region happened to be safe to map regardless.
> The page tables are not active at this stage, so there are no concerns
> regarding break-before-make etc.
Yup.
> > for_each_efi_memory_desc(&memmap, md) {
> > - u64 paddr, npages, size;
> > + u64 size;
>
> I would have dropped 'size' entirely, and use the expression as the
> function argument directly, but this is also fine by me.
Sure; I've folded that in locally.
> In either case:
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cheers!
Mark.
prev parent reply other threads:[~2015-11-20 19:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 15:12 [PATCHv2] arm64: efi: correctly map runtime regions Mark Rutland
2015-11-20 18:31 ` Ard Biesheuvel
2015-11-20 19:32 ` Mark Rutland [this message]
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=20151120193232.GB14942@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.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