--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/c6386a75-f32c-419a-9494-9788f8ef859fn%40groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAABsk8cezTx%2BS%2BSm6PeN2evxqFTtehK_x3-7Tyd_mL3U%2BWGukA%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/groups.riscv.org/d/topic/sw-dev/mQcKbOHCU8Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CABpcLcQgGuzGUfVKzLmsuLQdTDLRtOj7HrCBbw8Zb1ze9atcgg%40mail.gmail.com.
Hi John,It sounds to me like you may be asking about purely software solutions to the mutual exclusion problem. If so, I'd suggest taking a look at some of the classic approaches to this problem:These algorithms are applicable to RISC-V machines even without the A-extension, although out-of-order execution may require careful use of memory barriers.I admit I've never tried to build/use GNU's libatomic, C's _Atomic, or C++'s std::atomic on a RISC-V machine without the A extension. I'm curious to know if/how it works.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CABpcLcQgGuzGUfVKzLmsuLQdTDLRtOj7HrCBbw8Zb1ze9atcgg%40mail.gmail.com.
This is the core of why we tossed the cmpxchg syscall during the glibc
upstreaming process. I wouldn't be opposed to taking the code (and adding the
ABI), but I don't care enough to do it myself.
It appears possible to support SMP soft atomics, albeit slowly, given a fixed known number of harts in the constrained case where all atomic ops only ever compete with other atomic ops, and not with normal stores. What's less clear is the likelihood that all software of interest adheres to that restriction, as does the mutual exclusion example code in the A extension chapter of the specs. Perhaps if this is a common enough use pattern, the A chapter's non-normative comment about using the AMO Swap idiom instead of a store can also mention the value of a generalized and consistent use of this approach (avoiding race conditions between stores and atomic ops) for SMP soft atomics.
Assuming also of course that the reasoning holds and this actually works. And without implying SMP soft atomics are particularly practical.
[Observing the list without creating a Google account. Feel free to reply on the list or not.]
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CA%2B%2B6G0BKFtM1Bq8zHOfRq5G0H51%3DhhjKhjUseu6ubM0b_QXGnw%40mail.gmail.com.
On Tue, Mar 2, 2021 at 6:19 PM <ge...@mailworks.org> wrote:It appears possible to support SMP soft atomics, albeit slowly, given a fixed known number of harts in the constrained case where all atomic ops only ever compete with other atomic ops, and not with normal stores. What's less clear is the likelihood that all software of interest adheres to that restriction, as does the mutual exclusion example code in the A extension chapter of the specs. Perhaps if this is a common enough use pattern, the A chapter's non-normative comment about using the AMO Swap idiom instead of a store can also mention the value of a generalized and consistent use of this approach (avoiding race conditions between stores and atomic ops) for SMP soft atomics.
Assuming also of course that the reasoning holds and this actually works. And without implying SMP soft atomics are particularly practical.
Luckily, I think such a system is mostly a curiosity--good fodder for exam questions, not so much a problem we need to solve :)
On Tuesday, 2 March 2021 at 21:36:26 UTC-5 andrew wrote:On Tue, Mar 2, 2021 at 6:19 PM <ge...@mailworks.org> wrote:It appears possible to support SMP soft atomics, albeit slowly, given a fixed known number of harts in the constrained case where all atomic ops only ever compete with other atomic ops, and not with normal stores. What's less clear is the likelihood that all software of interest adheres to that restriction, as does the mutual exclusion example code in the A extension chapter of the specs. Perhaps if this is a common enough use pattern, the A chapter's non-normative comment about using the AMO Swap idiom instead of a store can also mention the value of a generalized and consistent use of this approach (avoiding race conditions between stores and atomic ops) for SMP soft atomics.
Assuming also of course that the reasoning holds and this actually works. And without implying SMP soft atomics are particularly practical.
Luckily, I think such a system is mostly a curiosity--good fodder for exam questions, not so much a problem we need to solve :)I can see VSDO support being a life saver for a company that ran off thousands of chips that have an errata affecting Atomics.They can continue to develop and prove the rest of their system with real chips. They have the possibility to sell them at a discount and still get to market.If supported it can only help our RISCV.org cause.I was disappointed when VSDO for RISCV was dropped.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/mhng-ebe04d30-25ab-42fc-9ba7-1de6d5de3a9f%40palmerdabbelt-glaptop.