From: Jonas Bonn <jonas@southpole.se>
To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Cc: Jonas Bonn <jonas@southpole.se>
Subject: [PATCH 6/6] openrisc: use scratch regs in atomic syscall
Date: Tue, 8 May 2012 11:54:05 +0200 [thread overview]
Message-ID: <1336470845-13859-7-git-send-email-jonas@southpole.se> (raw)
In-Reply-To: <1336470845-13859-1-git-send-email-jonas@southpole.se>
The function sys_or1k_atomic was using call-saved registers without
restoring their value before returning. This is a faux pas: either
we need to restore their values or use scratch regs; the latter is
less code so that's the route this patch takes.
Thanks to David Hennerström for doing most of the heavy-lifting in
tracking this one down.
Reported-by: Davd Hennerström <david.hennerstrom@aacmicrotec.com>
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
arch/openrisc/kernel/entry.S | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S
index 6e61af8..ddfcaa8 100644
--- a/arch/openrisc/kernel/entry.S
+++ b/arch/openrisc/kernel/entry.S
@@ -1117,10 +1117,10 @@ ENTRY(sys_rt_sigreturn)
ENTRY(sys_or1k_atomic)
/* FIXME: This ignores r3 and always does an XCHG */
DISABLE_INTERRUPTS(r17,r19)
- l.lwz r30,0(r4)
- l.lwz r28,0(r5)
- l.sw 0(r4),r28
- l.sw 0(r5),r30
+ l.lwz r29,0(r4)
+ l.lwz r27,0(r5)
+ l.sw 0(r4),r27
+ l.sw 0(r5),r29
ENABLE_INTERRUPTS(r17)
l.jr r9
l.or r11,r0,r0
--
1.7.0.4
next prev parent reply other threads:[~2012-05-08 9:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 9:53 [PATCH 0/6] OpenRISC patches for review Jonas Bonn
2012-05-08 9:54 ` [PATCH 1/6] openrisc: implement irqdomains Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` [PATCH 2/6] openrisc: remove unnecessary includes Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` [PATCH 3/6] openrisc/mm/fault.c: Port OOM changes to do_page_fault Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` [PATCH 4/6] openrisc: header file cleanups Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` [PATCH 5/6] openrisc: provide dma_map_ops Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn [this message]
2012-05-08 9:54 ` [PATCH 6/6] openrisc: use scratch regs in atomic syscall Jonas Bonn
2012-05-08 11:24 ` [PATCH 0/6] OpenRISC patches for review 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=1336470845-13859-7-git-send-email-jonas@southpole.se \
--to=jonas@southpole.se \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).