From: leif.lindholm@arm.com (Leif Lindholm)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: Add SWP/SWPB emulation for ARMv7 processors (v2)
Date: Tue, 5 Jan 2010 18:09:39 -0000 [thread overview]
Message-ID: <000001ca8e32$3f84feb0$be8efc10$@lindholm@arm.com> (raw)
In-Reply-To: <20100104193400.GB13537@shareable.org>
> From: Jamie Lokier [mailto:jamie at shareable.org]
> Sent: 04 January 2010 19:34
> There is no need to return to userspace, as you know that userspace
> will immediately retry the instruction, or respond to a signal.
>
> So you can loop, as long as you:
>
> 1. Allow other tasks to run by calling cond_resched().
> 2. Break out of the loop if signal_pending().
Thanks for these suggestions - I will be posting an updated patch that does
this shortly.
> If someone executes SWP on uncached or device memory and it's not an
> intentional DOS (e.g. worked with older ARMs), they won't expect the
> instruction to loop at that point.
True, but difficult to solve in a clean way (see below).
> Faulting would be better. Is it feasible to detect when this has
> happened and send a SIGBUS signal instead of looping?
Only if the processor implements it (the AXI spec explicitly permits a
processor to treat an OKAY response, as opposed to EXOKAY, as an error -
but it doesn't mandate it). I am not aware of any ARM processors that do
this. Otherwise that would certainly be the best solution.
Of course this means that if we want to "detect" an impossible situation
in order to generate an abort, we need to resort to counters, and
determining an arbitrary "highest possible" number of valid sequential
failures...
/
Leif
prev parent reply other threads:[~2010-01-05 18:09 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
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 [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='000001ca8e32$3f84feb0$be8efc10$@lindholm@arm.com' \
--to=leif.lindholm@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 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.