<la_mettrie>
i'm looking for a more practical advice than what ISA manuals do offer (like for more concrete programming purposes) about when to use FENCE instruction
GenTooMan has joined #riscv
haise01 has joined #riscv
GenTooMan has quit [Ping timeout: 248 seconds]
jmdaemon has quit [Ping timeout: 252 seconds]
haise01 has quit [Quit: Leaving]
loggervicky has quit [Quit: loggervicky]
GenTooMan has joined #riscv
jacklsw has quit [Read error: Connection reset by peer]
vagrantc has joined #riscv
aburgess has quit [Ping timeout: 265 seconds]
jacklsw has joined #riscv
jacklsw has quit [Quit: Back to the real life]
GenTooMan has quit [Ping timeout: 260 seconds]
davidlt has joined #riscv
aerkiaga has joined #riscv
GenTooMan has joined #riscv
wingsorc has joined #riscv
aburgess has joined #riscv
prabhakarlad has quit [Ping timeout: 252 seconds]
Trifton has quit [Ping timeout: 252 seconds]
paddymahoney has joined #riscv
rurtty has quit [Ping timeout: 268 seconds]
aburgess has quit [Remote host closed the connection]
aburgess has joined #riscv
paddymahoney has quit [Read error: Connection reset by peer]
<palmer>
la_mettrie: the LKMM implementation is probably your best bet, it's been pretty well tested/reviewed and there's a bunch of comments (and commit/email history) about the tricky bits
<palmer>
there's also review for new patches, so if you find something interesting you can send along a fix and see what folks say
aburgess has quit [Ping timeout: 268 seconds]
<jrtc27>
outside of the Linux kernel (where you should still be using the various barrier abstractions not raw fences) and hand-written assembly you shouldn't really be thinking about FENCE as an instruction, you should be using proper atomics and abstracting
<jrtc27>
even in FreeBSD we almost always use an atomics API modelled on C11
<jrtc27>
the only places that use fence directly in sys/riscv are the atomics implementation itself, busdma and pmap for sfence/fence.i things
<jrtc27>
I assume la_mettrie is asking in the context of writing a FreeBSD driver based on past conversations, to which my response is you're probably asking the wrong question
<jrtc27>
and should be stepping back to ask the question at a higher level, and in a freebsd context
<palmer>
ya, if the question was really "how do I write a FreeBSD" driver than looking at LKMM is a pretty terrible suggestion
AmyMalik has quit [Quit: Bye Open Projects!]
Ellenor has joined #riscv
<muurkha>
heh
<muurkha>
it's a good suggestion for the rest of us, though!
<jrtc27>
context matters, who knew :)
<muurkha>
I mean, unless reading the Linux stuff will lead us into bad practices that reading the FreeBSD atomics API would lead us to avoid
<la_mettrie>
jrtc27: just tried to understand some mhorne's wip-code. maybe i should have asked him directly
<muurkha>
what's he working on?
<jrtc27>
the linux docs are perfectly fine for when you want to understand the problems that exist in parallel worlds and how the hardware primitives help
<jrtc27>
and are quite well written in that regard
<jrtc27>
you just don't want to take on board the specific APIs for how to avoid them
<jrtc27>
he has a beaglev branch on his fork
<muurkha>
ah, thanks
catern has quit [Ping timeout: 246 seconds]
\subline has quit [Ping timeout: 265 seconds]
Ellenor is now known as AmyMalik
jmdaemon has joined #riscv
wingsorc has quit [Remote host closed the connection]
wingsorc has joined #riscv
radu242 has quit [Ping timeout: 260 seconds]
\subline has joined #riscv
<dh`>
apart from the specific issue that the linux world doesn't believe in condition variables and keeps trying to make up broken alternatives
<muurkha>
haha
wingsorc has quit [Quit: Leaving]
wingsorc has joined #riscv
Andre_H has quit [Ping timeout: 250 seconds]
KombuchaKip has quit [Quit: Leaving.]
KombuchaKip has joined #riscv
aerkiaga has quit [Remote host closed the connection]