From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [PATCH] arm64: Boot failure on m400 with new cont PTEs
Date: Fri, 20 Nov 2015 19:52:44 +0000 [thread overview]
Message-ID: <20151120195243.GC14942@leverpostej> (raw)
In-Reply-To: <20151119112923.GA24570@leverpostej>
On Thu, Nov 19, 2015 at 11:31:34AM +0000, Mark Rutland wrote:
> On Wed, Nov 18, 2015 at 01:31:18PM -0600, Jeremy Linton wrote:
> > On 11/18/2015 12:04 PM, Mark Rutland wrote:
> >
> > >You're racing against other parts of the CPU (the page table walker(s),
> > >I-caches, etc). The flushing only minimises the window for a race, and
> > >does not prevent the race from being possible.
> > >
> > >Given that the envelope is constantly pushing forward w.r.t. how
> > >aggressive CPUs may be in this area, we need to fix the issue by
> > >reasoning against what the architecture guarantees us.
> > Its also not suppose to fault on speculative access, and to me that
> > means page table walks/etc that are the result of speculative
> > access.
>
> I was under the impression that TLB conflict abort could be delivered
> for asynchronous events (e.g. speculative I-cache fetches rather than
> for speculative execution of already fetched instructions).
>
> Having looked at the ARM ARM, I appear to have been mistaken. As you
> say, it appears that TLB conflict aborts are always delivered
> synchronously.
>
> > Which AFAIK, closes the window significantly. I would only
> > really worry about interrupt activity, and updates to the memory
> > containing the PTE's themselves. Either way the simple change
> > (rather than rewriting the whole code path) is probably to flag the
> > fault handler to simply resume from these kinds of faults during
> > create_mapping_late().
> > But that isn't what is happening here AFAIK, the faults are long
> > after the PTE's have been updated, and are the result of failure to
> > flush the TLB..
> I think that if we need to do something more drastic to account for the
> other issues above (e.g. by ensuring that we can never allocate
> conflicting TLB entries in the first place), and that said strategy
> would also fix this problem, that would be preferable, given that we're
> going to have to do that eventually anyway.
Having looked into this further, we also have the same issue with the
kasan init code.
I believe that the issue is restricted to one-off init code, as I don't
think that we do anything at runtime which would be problematic. If
anyone knows of a counter-example, please let me know!
Given that, we can restrict the problem to an early UP environment, and
it won't matter if therre's some large(ish) fixed cost associated with
updating the kernel page tables. I think that we can avoid the issue
entirely by modifying a copy of the kernel page tables, which we can
later install via some idmap code (going via a reserved table to clear
the TLBs).
I'm working on patches to implement the above, which I'll try to get
somewhere with next week.
Thanks,
Mark
next prev parent reply other threads:[~2015-11-20 19:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 15:03 [PATCH] [PATCH] arm64: Boot failure on m400 with new cont PTEs Jeremy Linton
2015-11-18 15:20 ` Mark Rutland
2015-11-18 16:08 ` Jeremy Linton
2015-11-18 16:29 ` Mark Rutland
2015-11-18 17:14 ` Jeremy Linton
2015-11-18 18:04 ` Mark Rutland
2015-11-18 19:31 ` Jeremy Linton
2015-11-19 11:31 ` Mark Rutland
2015-11-20 19:52 ` Mark Rutland [this message]
2015-11-23 12:15 ` Catalin Marinas
2015-11-23 13:49 ` Mark Rutland
2015-11-23 14:48 ` Jeremy Linton
2015-11-23 15:41 ` Will Deacon
2015-11-23 15:46 ` Jeremy Linton
2015-11-23 14:31 ` Jeremy Linton
2015-11-20 20:15 ` Mark Rutland
2015-11-23 15:51 ` Catalin Marinas
2015-11-23 16:02 ` Jeremy Linton
2015-11-23 16:37 ` Laura Abbott
2015-11-23 16:42 ` Jeremy Linton
2015-11-23 17:52 ` Laura Abbott
2015-11-23 18:46 ` Jeremy Linton
2015-11-24 8:04 ` Ard Biesheuvel
2015-11-23 16:52 ` Catalin Marinas
2015-11-23 17:24 ` Catalin Marinas
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=20151120195243.GC14942@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;
as well as URLs for NNTP newsgroup(s).