linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
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: Wed, 18 Nov 2015 18:04:35 +0000	[thread overview]
Message-ID: <20151118180434.GB13355@leverpostej> (raw)
In-Reply-To: <564CB1DA.4090304@arm.com>

> >We also need to figure out what's happening with the code as it is.
> 
> Well, I'm suspect what is happening is that there are conflicting
> TLB's hanging around, one for a cont range that is overlapping a stale
> non cont one. This sort of implies that this has been happening all
> along, AKA RO regions were being "lazy" activated if you will. Its
> only on a core that aborts when it detects that (which i assume
> requires differing size entries for this core) does it cause problems.

I suspect that we may have believed that the TLB maintenance at the end
of paging_init was sufficient, as we evidently  id not consider TLB
conflicts.

> The break-before-make issue, seems like it won't cause a big problem
> here as long as there is some way to assure valid TLBs before the
> update, and then assure they are cleared following it.

If at any instant in time you have a valid TLB entry for an address, and
the page tables hold a value that would give rise to a conflicting TLB
entry, you can encounter a TLB conflict abort.

It's a race against the hardware.

> Hence the overly aggressive change works because it
> flushes following every cont block update. Which would bother me
> more if the code were run more than once per boot (or in the future
> per module load/unload if someone gets around to updating the no
> execute reliably).

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.

We're almost certainly going to have to revisit this code in future, and
sprinkling TLB maintenance over it will only make it harder to reason
about in future.

Mark.

  reply	other threads:[~2015-11-18 18:04 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 [this message]
2015-11-18 19:31           ` Jeremy Linton
2015-11-19 11:31             ` Mark Rutland
2015-11-20 19:52               ` Mark Rutland
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=20151118180434.GB13355@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).