mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Guenter Roeck <groeck@google.com>,
	Kees Cook <keescook@chromium.org>,
	Jeffy Chen <jeffy.chen@rock-chips.com>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
	Douglas Anderson <dianders@chromium.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Will Deacon <Will.Deacon@arm.com>
Subject: Re: Problem with atomic accesses in pstore on some ARM CPUs
Date: Tue, 16 Aug 2016 11:32:04 +0100	[thread overview]
Message-ID: <8f0c9ced-cdc3-ab9b-caee-06fe85e6c1e7@arm.com> (raw)
In-Reply-To: <CABXOdTfT7xMfiBvRuUS1hsVs=q5q2wY1x1Z8oCyyJNFckM0g0A@mail.gmail.com>

Hi Guenter,

On 16/08/16 00:19, Guenter Roeck wrote:
> Hi,
> 
> we are having a problem with atomic accesses in pstore on some ARM
> CPUs (specifically rk3288 and rk3399). With those chips, atomic
> accesses fail with both pgprot_noncached and pgprot_writecombine
> memory. Atomic accesses do work when selecting PAGE_KERNEL protection.

What's the pstore backed by? I'm guessing it's not normal DRAM.

> Debugging on rk3399 shows the following crash.
> 
> [    0.912669] Bad mode in Error handler detected, code 0xbf000002 -- SError
> [    0.920140] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 4.4.14 #389
> [    0.926838] Hardware name: Google Kevin (DT)
> [    0.931533] task: ffffffc0edfe0000 ti: ffffffc0edf7c000 task.ti:
> ffffffc0edf 7c000
> [    0.939780] PC is at __ll_sc___cmpxchg_case_mb_4+0x2c/0x5c
> [    0.945811] LR is at 0x1
> 
> The "solution" for this problem in various Chrome OS releases is to
> disable atomic accesses in pstore entirely, which seems to be a bit
> brute-force. Question is what a proper upstream-acceptable solution

>From that, it sounds like the endpoint doesn't support exclusive
accesses. I imagine you get away with it through a PAGE_KERNEL mapping
by virtue of being write-back cacheable, such that the exclusives end up
being handled by the local monitor at L1 and don't go out to memory, but
I'm not sure even that's necessarily reliable.

In general terms, not doing atomic accesses is probably the only 100%
safe solution.

Robin.

> might be. Introduce another memory type to select PAGE_KERNEL ? Is
> there some means to determine if atomic operations are supported with
> a given protection mask, maybe ? Anything else ?
> 
> Thanks,
> Guenter
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

  reply	other threads:[~2016-08-16 10:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 23:19 Guenter Roeck
2016-08-16 10:32 ` Robin Murphy [this message]
2016-08-16 10:45   ` Will Deacon
2016-08-16 13:21     ` Guenter Roeck
2016-08-16 13:14   ` Guenter Roeck
2016-08-16 13:21     ` Will Deacon
2016-08-16 15:02       ` Guenter Roeck
2016-08-15 22:15         ` Mark Rutland
2016-08-16 17:35           ` Colin Cross
2016-08-16 20:26             ` Guenter Roeck
2016-08-16 20:50               ` Kees Cook
2016-08-17  0:26                 ` Guenter Roeck
2016-08-19  9:35             ` Russell King - ARM Linux
2016-08-19 12:47               ` Guenter Roeck
2016-08-22 21:03           ` Arnd Bergmann

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=8f0c9ced-cdc3-ab9b-caee-06fe85e6c1e7@arm.com \
    --to=robin.murphy@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=ccross@android.com \
    --cc=dianders@chromium.org \
    --cc=groeck@google.com \
    --cc=jeffy.chen@rock-chips.com \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /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

Powered by JetHome