lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <162202828129.29796.17306997675358457890.tip-bot2@tip-bot2>
Date:   Wed, 26 May 2021 11:24:41 -0000
From:   "tip-bot2 for Mark Rutland" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Mark Rutland <mark.rutland@....com>,
        Stafford Horne <shorne@...il.com>,
        Boqun Feng <boqun.feng@...il.com>,
        Jonas Bonn <jonas@...thpole.se>,
        Peter Zijlstra <peterz@...radead.org>,
        Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
        Will Deacon <will@...nel.org>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: locking/core] locking/atomic: openrisc: avoid asm-generic/atomic.h

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     f0c7bf1b77c65c9a273207d228df27009f09ec0b
Gitweb:        https://git.kernel.org/tip/f0c7bf1b77c65c9a273207d228df27009f09ec0b
Author:        Mark Rutland <mark.rutland@....com>
AuthorDate:    Tue, 25 May 2021 15:02:04 +01:00
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Wed, 26 May 2021 13:20:49 +02:00

locking/atomic: openrisc: avoid asm-generic/atomic.h

OpenRISC is the only architecture which uses asm-generic/atomic.h and
also provides its own implementation of some functions, requiring
ifdeferry in the asm-generic header. As OpenRISC provides the vast
majority of functions itself, it would be simpler overall if it also
provided the few functions it cribs from asm-generic.

This patch decouples OpenRISC from asm-generic/atomic.h. Subsequent
patches will simplify the asm-generic implementation and remove the now
unnecessary ifdeferry.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@....com>
Acked-by: Stafford Horne <shorne@...il.com>
Cc: Boqun Feng <boqun.feng@...il.com>
Cc: Jonas Bonn <jonas@...thpole.se>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>
Cc: Will Deacon <will@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Link: https://lore.kernel.org/r/20210525140232.53872-6-mark.rutland@arm.com
---
 arch/openrisc/include/asm/atomic.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/openrisc/include/asm/atomic.h b/arch/openrisc/include/asm/atomic.h
index b589fac..cb86970 100644
--- a/arch/openrisc/include/asm/atomic.h
+++ b/arch/openrisc/include/asm/atomic.h
@@ -121,6 +121,12 @@ static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)
 }
 #define atomic_fetch_add_unless	atomic_fetch_add_unless
 
-#include <asm-generic/atomic.h>
+#define atomic_read(v)			READ_ONCE((v)->counter)
+#define atomic_set(v,i)			WRITE_ONCE((v)->counter, (i))
+
+#include <asm/cmpxchg.h>
+
+#define atomic_xchg(ptr, v)		(xchg(&(ptr)->counter, (v)))
+#define atomic_cmpxchg(v, old, new)	(cmpxchg(&((v)->counter), (old), (new)))
 
 #endif /* __ASM_OPENRISC_ATOMIC_H */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ