From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM11MPcore: tlb_ops_need_broadcast causes deadlock
Date: Wed, 28 Mar 2012 09:56:11 +0100 [thread overview]
Message-ID: <20120328085611.GA11524@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <20120327174152.GA905@mvista.com>
On Tue, Mar 27, 2012 at 06:41:52PM +0100, George G. Davis wrote:
> On Tue, Mar 27, 2012 at 02:32:26PM +0100, Will Deacon wrote:
> > I have a theory about what goes on:
> >
> > Say we have a valid (i.e. non-faulting) page which contains a load instruction
> > that will fault. A CPU executes this load and takes a data abort but at the
> > same time another CPU marks the page being executed as old. So when the
> > original CPU tries to load the faulting instruction in do_thumb_abort, we take
> > a second data abort (assumedly because we don't have a D-side TLB entry for the
> > text page, so we immediately see that it is old) and, because interrupts were
> > not yet re-enabled in the first fault, they are not enabled in the nested fault
> > either.
>
> This is precisely what happened here. The only difference is that the traces
> I've reviewed faulted at "not_thumb:" while attempting to read the userspace
> ARM instruction which lead to the (second) data abort with interrupts disabled.
Right, I think that's the same problem though.
> > Possible solutions:
> >
> > (1) Enable interrupts if they are enabled in the faulting context before
> > loading instructions on the dabt path.
> >
> > (2) Use the FSR to determine whather a fault is due to a read or a write on
> > ARMv6 - only load and disassemble the instruction on 1136 CPUs affected
> > by erratum #325103 (which aren't SMP, so cannot hit the problem above).
>
> We submitted a change similar to (2) above to the ARM Linux kernel mailing
> list for RFC [1] over a year ago. That change [1] is similar to your change
> below.
Apologies, I missed that. Are you happy for me to continue with my change
below? I'd really like it if Peter could confirm it fixes his problem.
> > The latter is probably best. Please can you try the patch below? I've
> > checked that it does the right thing on an r0p1 1136 core using a simple
> > fork/swp program to trigger a CoW.
>
> I tested your patch but only on a CPU_V6K based SMP machine. In this
> case, ARM_ERRATA_326103 depends on CPU_V6, so is left disabled, renderring
> this patch functionally equivaltent to [1] below.
Thanks George. Do you have a testcase for reliably reproducing the deadlock
without this patch applied?
> FYI/FWIW, your patch above suffered whitespace damage.
That'll be the sorry excuse for an email system that I'm forced to use.
Perhaps the list archive has a better version:
http://lists.arm.linux.org.uk/lurker/attach/1 at 20120327.133226.639a8b79.attach
Will
prev parent reply other threads:[~2012-03-28 8:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 12:24 ARM11MPcore: tlb_ops_need_broadcast causes deadlock EXTERNAL Waechtler Peter (Fa. TCP, CM-AI/PJ-CF31)
2012-03-23 17:30 ` Will Deacon
2012-03-25 12:08 ` Peter Waechtler
2012-03-25 13:09 ` Russell King - ARM Linux
2012-03-25 18:22 ` Peter Waechtler
2012-03-25 19:15 ` Russell King - ARM Linux
2012-03-25 20:22 ` Peter Waechtler
2012-03-25 21:55 ` Russell King - ARM Linux
2012-03-26 15:20 ` Will Deacon
[not found] ` <274124B9C6907D4B8CE985903EAA19E91B2D5798D9@SI-MBX06.de.bosch.com>
2012-03-27 13:32 ` Will Deacon
2012-03-27 17:41 ` George G. Davis
2012-03-28 8:56 ` Will Deacon [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=20120328085611.GA11524@mudshark.cambridge.arm.com \
--to=will.deacon@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).