From: jamie@shareable.org (Jamie Lokier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Add SWP/SWPB emulation for ARMv7 processors (v2)
Date: Fri, 18 Dec 2009 19:54:32 +0000 [thread overview]
Message-ID: <20091218195432.GC1205@shareable.org> (raw)
In-Reply-To: <20091218182007.GF5527@n2100.arm.linux.org.uk>
Russell King - ARM Linux wrote:
> > + NOTE: when accessing uncached shared regions, LDREX/STREX rely
> > + on an external transaction monitoring block called a global
> > + monitor to maintain update atomicity. If your system does not
> > + implement a global monitor, this option is not safe for programs
> > + that are permitted to map uncached memory (CAP_SYS_RAWIO).
>
> We can trap this case by looking at the L_PTE_MT_* bits in the pte
> for the page we're going to be accessing - that's probably a good
> idea to ensure that such accesses are trapped, rather than going
> head and possibly risking silent corruption.
After that test, the kernel could even use the SWP/SWPB instructions
if necessary for correct behaviour :-)
Trapping and sending the process a signal would be
a good way to ensure code doing that is fixed.
There might be thread synchronisation code using SWP/SWPB on shared
memory which gets mapped uncached to prevent aliasing.
So would it be more appropriate to trap when the access is to a
non-RAM mapping? Or are there devices which depend on the SWP bus
cycle on RAM too, for example a PCI device updating RAM by DMA and
using locked cycles?
-- Jamie
next prev parent reply other threads:[~2009-12-18 19:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-18 18:04 [PATCH] ARM: Add SWP/SWPB emulation for ARMv7 processors (v2) Leif Lindholm
2009-12-18 18:20 ` Russell King - ARM Linux
2009-12-18 19:48 ` Jamie Lokier
2009-12-18 20:01 ` Russell King - ARM Linux
2009-12-18 19:54 ` Jamie Lokier [this message]
2009-12-18 20:03 ` Russell King - ARM Linux
2009-12-19 17:18 ` Catalin Marinas
2009-12-19 17:28 ` Russell King - ARM Linux
2010-01-04 18:18 ` Leif Lindholm
2010-01-04 19:34 ` Jamie Lokier
2010-01-05 18:09 ` Leif Lindholm
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=20091218195432.GC1205@shareable.org \
--to=jamie@shareable.org \
--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 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.