* [OpenRISC] [PATCH] openrisc: define mb() as its mandatory
@ 2018-04-06 20:58 Stafford Horne
2018-04-07 9:09 ` Peter Zijlstra
0 siblings, 1 reply; 4+ messages in thread
From: Stafford Horne @ 2018-04-06 20:58 UTC (permalink / raw)
To: openrisc
Following Peter Z's patch ("asm-generic: Disallow no-op mb() for SMP
systems") which makes mb() mandatory for SMP architectures we define it
as l.msync. On OpenRISC this will flush the current cores write buffer
and trigger remote cores to invalidate their caches of the written
memory.
Signed-off-by: Stafford Horne <shorne@gmail.com>
Link: https://lkml.org/lkml/2018/1/31/254
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
---
Notes:
- Sorry, its been a while since we discussed this patch is the parent to this
still going in Peter?
- I have not got around to updating our architecture spec for the TSO/PSO
notes we discussed.
arch/openrisc/include/asm/Kbuild | 1 -
arch/openrisc/include/asm/barrier.h | 8 ++++++++
2 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 arch/openrisc/include/asm/barrier.h
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 6eb16719549e..fea95ee2fb84 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -1,4 +1,3 @@
-generic-y += barrier.h
generic-y += bug.h
generic-y += bugs.h
generic-y += checksum.h
diff --git a/arch/openrisc/include/asm/barrier.h b/arch/openrisc/include/asm/barrier.h
new file mode 100644
index 000000000000..77eaad9ba0c4
--- /dev/null
+++ b/arch/openrisc/include/asm/barrier.h
@@ -0,0 +1,8 @@
+#ifndef _ASM_OPENRISC_BARRIER_H
+#define _ASM_OPENRISC_BARRIER_H
+
+#define mb() asm volatile ("l.msync":::"memory")
+
+#include <asm-generic/barrier.h>
+
+#endif /* _ASM_OPENRISC_BARRIER_H */
--
2.13.6
^ permalink raw reply related [flat|nested] 4+ messages in thread* [OpenRISC] [PATCH] openrisc: define mb() as its mandatory
2018-04-06 20:58 [OpenRISC] [PATCH] openrisc: define mb() as its mandatory Stafford Horne
@ 2018-04-07 9:09 ` Peter Zijlstra
2018-04-08 0:07 ` Stafford Horne
0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2018-04-07 9:09 UTC (permalink / raw)
To: openrisc
On Sat, Apr 07, 2018 at 05:58:49AM +0900, Stafford Horne wrote:
> Following Peter Z's patch ("asm-generic: Disallow no-op mb() for SMP
> systems") which makes mb() mandatory for SMP architectures we define it
> as l.msync. On OpenRISC this will flush the current cores write buffer
> and trigger remote cores to invalidate their caches of the written
> memory.
>
> Signed-off-by: Stafford Horne <shorne@gmail.com>
> Link: https://lkml.org/lkml/2018/1/31/254
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Will Deacon <will.deacon@arm.com>
> ---
>
> Notes:
> - Sorry, its been a while since we discussed this patch is the parent to this
> still going in Peter?
Oops.. yes it should. It seems I also lost track of it. Thanks for the
reminder!
^ permalink raw reply [flat|nested] 4+ messages in thread* [OpenRISC] [PATCH] openrisc: define mb() as its mandatory
2018-04-07 9:09 ` Peter Zijlstra
@ 2018-04-08 0:07 ` Stafford Horne
2018-04-09 8:32 ` Peter Zijlstra
0 siblings, 1 reply; 4+ messages in thread
From: Stafford Horne @ 2018-04-08 0:07 UTC (permalink / raw)
To: openrisc
On Sat, Apr 07, 2018 at 11:09:05AM +0200, Peter Zijlstra wrote:
> On Sat, Apr 07, 2018 at 05:58:49AM +0900, Stafford Horne wrote:
> > Following Peter Z's patch ("asm-generic: Disallow no-op mb() for SMP
> > systems") which makes mb() mandatory for SMP architectures we define it
> > as l.msync. On OpenRISC this will flush the current cores write buffer
> > and trigger remote cores to invalidate their caches of the written
> > memory.
> >
> > Signed-off-by: Stafford Horne <shorne@gmail.com>
> > Link: https://lkml.org/lkml/2018/1/31/254
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Will Deacon <will.deacon@arm.com>
> > ---
> >
> > Notes:
> > - Sorry, its been a while since we discussed this patch is the parent to this
> > still going in Peter?
>
> Oops.. yes it should. It seems I also lost track of it. Thanks for the
> reminder!
No Problem,
If you think this patch makes sense I can just put it into my OpenRISC queue for
4.17. I dont see any reason to wait for yours. Any thoughts?
-Stafford
^ permalink raw reply [flat|nested] 4+ messages in thread* [OpenRISC] [PATCH] openrisc: define mb() as its mandatory
2018-04-08 0:07 ` Stafford Horne
@ 2018-04-09 8:32 ` Peter Zijlstra
0 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2018-04-09 8:32 UTC (permalink / raw)
To: openrisc
On Sun, Apr 08, 2018 at 09:07:29AM +0900, Stafford Horne wrote:
> On Sat, Apr 07, 2018 at 11:09:05AM +0200, Peter Zijlstra wrote:
> > On Sat, Apr 07, 2018 at 05:58:49AM +0900, Stafford Horne wrote:
> > > Following Peter Z's patch ("asm-generic: Disallow no-op mb() for SMP
> > > systems") which makes mb() mandatory for SMP architectures we define it
> > > as l.msync. On OpenRISC this will flush the current cores write buffer
> > > and trigger remote cores to invalidate their caches of the written
> > > memory.
> > >
> > > Signed-off-by: Stafford Horne <shorne@gmail.com>
> > > Link: https://lkml.org/lkml/2018/1/31/254
> > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > Cc: Will Deacon <will.deacon@arm.com>
> > > ---
> > >
> > > Notes:
> > > - Sorry, its been a while since we discussed this patch is the parent to this
> > > still going in Peter?
> >
> > Oops.. yes it should. It seems I also lost track of it. Thanks for the
> > reminder!
>
> No Problem,
>
> If you think this patch makes sense I can just put it into my OpenRISC queue for
> 4.17. I dont see any reason to wait for yours. Any thoughts?
I'm fine with you taking the patch, but I just saw the build robot found
two failure cases: PARISC and 32-bit SPARC. I send patches for both, if
their respective maintainers agree you could do the lot.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-09 8:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-06 20:58 [OpenRISC] [PATCH] openrisc: define mb() as its mandatory Stafford Horne
2018-04-07 9:09 ` Peter Zijlstra
2018-04-08 0:07 ` Stafford Horne
2018-04-09 8:32 ` Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox