From: Will Deacon <will.deacon@arm.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
"Jiri Kosina" <jikos@kernel.org>, "Jürgen Groß" <jgross@suse.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
"Michal Hocko" <mhocko@suse.com>,
"Naoya Horiguchi" <n-horiguchi@ah.jp.nec.com>,
"Michael Ellerman" <mpe@ellerman.id.au>
Subject: Re: Access to non-RAM pages
Date: Mon, 3 Sep 2018 11:36:11 +0100 [thread overview]
Message-ID: <20180903103610.GA11055@arm.com> (raw)
In-Reply-To: <CA+55aFyhq23ce94Vq_XdCJSOKvo8oYnb2UOdjf-KVaaOFngr+g@mail.gmail.com>
On Sun, Sep 02, 2018 at 07:10:46PM -0700, Linus Torvalds wrote:
> On Sun, Sep 2, 2018 at 7:01 PM Benjamin Herrenschmidt
> <benh@kernel.crashing.org> wrote:
> >
> > Still, I can potentially see an issue with DEBUG_PAGEALLOC
>
> An unmapped page isn't a problem. That's what the whole
> load_unaligned_zeropad() is about: it's ok to take a fault on the part
> that crosses a page, and we'll just fill the value with zeroes (that's
> the "zeropad" part).
>
> So as long as it's rare (and it is), it's all fine.
>
> That said, I think we turn off for DEBUG_PAGEALLOC simply because it's
> not rare _enough_.
>
> And vmalloc() should actually be safe too, simply because I think we
> strive for a guard page between vmalloc areas.
>
> So only a *mapped* page after the page that matters, and only if it's
> something you can't read without side effects.
>
> Which basically doesn't happen on x86 in reality. BIOSes just don't
> put MMIO right after the last page of RAM. I think this is why it only
> triggered on Xen, due to some crazy "Xen reacts badly" case where we
> do the speculation into a balloon address.
>
> So _practically_ this is just a Xen bug, nothing more.
>
> But since in _theory_ you could have MMIO abut regular RAM directly,
> it's worth maybe making sure it's purely theory.
On arm64, ioremap() gives you a guard page because it allocates out of
the vmalloc area. The only way I think we could get MMIO in the middle
of the linear map would be if firmware has reserved something there. In
this case, the region should be treated as NOMAP, meaning we won't map
the area at all in the kernel and our pfn_valid() implementation will
return false for the corresponding memmap entries.
For userspace, we did consider putting out a guard page for non-fixed
mmap() calls, but it's not something we've really looked into.
Will
next prev parent reply other threads:[~2018-09-03 10:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 12:10 Access to non-RAM pages Juergen Gross
2018-08-31 21:18 ` Jiri Kosina
2018-09-01 10:47 ` Juergen Gross
2018-09-01 17:13 ` Al Viro
2018-09-01 21:48 ` Jiri Kosina
2018-09-01 17:27 ` Linus Torvalds
2018-09-01 18:06 ` Linus Torvalds
2018-09-03 0:48 ` Benjamin Herrenschmidt
2018-09-03 0:55 ` Benjamin Herrenschmidt
2018-09-03 1:38 ` Linus Torvalds
2018-09-03 1:42 ` Linus Torvalds
2018-09-03 2:00 ` Benjamin Herrenschmidt
2018-09-03 2:10 ` Linus Torvalds
2018-09-03 2:25 ` Benjamin Herrenschmidt
2018-09-03 2:47 ` Linus Torvalds
2018-09-03 2:52 ` Linus Torvalds
2018-09-03 3:44 ` Benjamin Herrenschmidt
2018-09-03 5:08 ` Juergen Gross
2018-09-03 6:05 ` Jiri Kosina
2018-09-03 10:36 ` Will Deacon [this message]
2018-09-03 1:44 ` Benjamin Herrenschmidt
2018-09-03 1:46 ` Benjamin Herrenschmidt
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=20180903103610.GA11055@arm.com \
--to=will.deacon@arm.com \
--cc=benh@kernel.crashing.org \
--cc=jgross@suse.com \
--cc=jikos@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=mpe@ellerman.id.au \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=torvalds@linux-foundation.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.