Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1466113
| Path | csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Jiri Slaby <jslaby@suse.cz> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 3.12 090/100] metag: Fix __cmpxchg_u32 asm constraint for CMP |
| Date | Fri, 19 Aug 2016 09:20:04 +0200 |
| Message-ID | <s7MfW-2xj-87@gated-at.bofh.it> (permalink) |
| References | <s7MfU-2xj-3@gated-at.bofh.it> |
| X-Amavis-Alert | BAD HEADER SECTION, Duplicate header field: "References" |
| X-Mailer | git-send-email 2.9.3 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 50 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, James Hogan <james.hogan@imgtec.com>, linux-metag@vger.kernel.org, Jiri Slaby <jslaby@suse.cz> |
| X-Original-Date | Fri, 19 Aug 2016 09:11:29 +0200 |
| X-Original-Message-ID | <fd07c45cd9bf8c1e9e54c272d7a12690aba306b6.1471589700.git.jslaby@suse.cz> |
| X-Original-References | <bc76af4e1436406a1f53da243e76bd10327691f2.1471589700.git.jslaby@suse.cz> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1466113 |
Show key headers only | View raw
From: James Hogan <james.hogan@imgtec.com>
3.12-stable review patch. If anyone has any objections, please let me know.
===============
commit 6154c187b97ee7513046bb4eb317a89f738f13ef upstream.
The LNKGET based atomic sequence in __cmpxchg_u32 has slightly incorrect
constraints for the return value which under certain circumstances can
allow an address unit register to be used as the first operand of a CMP
instruction. This isn't a valid instruction however as the encodings
only allow a data unit to be specified. This would result in an
assembler error like the following:
Error: failed to assemble instruction: "CMP A0.2,D0Ar6"
Fix by changing the constraint from "=&da" (assigned, early clobbered,
data or address unit register) to "=&d" (data unit register only).
The constraint for the second operand, "bd" (an op2 register where op1
is a data unit register and the instruction supports O2R) is already
correct assuming the first operand is a data unit register.
Other cases of CMP in inline asm have had their constraints checked, and
appear to all be fine.
Fixes: 6006c0d8ce94 ("metag: Atomics, locks and bitops")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
arch/metag/include/asm/cmpxchg_lnkget.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/metag/include/asm/cmpxchg_lnkget.h b/arch/metag/include/asm/cmpxchg_lnkget.h
index 0154e2807ebb..2369ad394876 100644
--- a/arch/metag/include/asm/cmpxchg_lnkget.h
+++ b/arch/metag/include/asm/cmpxchg_lnkget.h
@@ -73,7 +73,7 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
" DCACHE [%2], %0\n"
#endif
"2:\n"
- : "=&d" (temp), "=&da" (retval)
+ : "=&d" (temp), "=&d" (retval)
: "da" (m), "bd" (old), "da" (new)
: "cc"
);
--
2.9.3
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 3.12 090/100] metag: Fix __cmpxchg_u32 asm constraint for CMP Jiri Slaby <jslaby@suse.cz> - 2016-08-19 09:20 +0200
csiph-web