<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 24, 2019 at 6:09 PM Alistair Francis &lt;<a href="mailto:alistair23@gmail.com">alistair23@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I raised the regression on the QEMU mailing list while I was preparing<br>
the revert for QEMU and Palmer pointed out this diff for musl:<br>
<br>
diff --git a/arch/riscv64/atomic_arch.h b/arch/riscv64/atomic_arch.h<br>
index c9765342..41ad4d04 100644<br>
--- a/arch/riscv64/atomic_arch.h<br>
+++ b/arch/riscv64/atomic_arch.h<br>
@@ -14,7 +14,7 @@ static inline int a_cas(volatile int *p, int t, int s)<br>
                &quot;       sc.w.aqrl %1, %4, (%2)\n&quot;<br>
                &quot;       bnez %1, 1b\n&quot;<br>
                &quot;1:&quot;<br>
-               : &quot;=&amp;r&quot;(old), &quot;=r&quot;(tmp)<br>
+               : &quot;=&amp;r&quot;(old), &quot;=&amp;r&quot;(tmp)<br>
                : &quot;r&quot;(p), &quot;r&quot;(t), &quot;r&quot;(s)<br>
                : &quot;memory&quot;);<br>
        return old;<br>
@@ -31,7 +31,7 @@ static inline void *a_cas_p(volatile void *p, void<br>
*t, void *s)<br>
                &quot;       sc.d.aqrl %1, %4, (%2)\n&quot;<br>
                &quot;       bnez %1, 1b\n&quot;<br>
                &quot;1:&quot;<br>
-               : &quot;=&amp;r&quot;(old), &quot;=r&quot;(tmp)<br>
+               : &quot;=&amp;r&quot;(old), &quot;=&amp;r&quot;(tmp)<br>
                : &quot;r&quot;(p), &quot;r&quot;(t), &quot;r&quot;(s)<br>
                : &quot;memory&quot;);<br>
        return old;<br>
<br>
This seems to fix the problem for me. Hopefully Palmer will prepare a<br>
patch then we can just cherry pick that (from the list) on musl in OE<br>
core.<br>
<br>
I&#39;m not going to send out the QEMU revert patch.<br>
</blockquote><div dir="auto"><br></div><div dir="auto">This is fine I think we were discussing atomics at musl IRC I will take this patch to discussions </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Alistair<br>
<br>
On Mon, Sep 23, 2019 at 10:12 PM Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Please send a patch<br>
&gt;<br>
&gt; On Mon, Sep 23, 2019 at 9:58 PM Alistair Francis &lt;<a href="mailto:alistair23@gmail.com" target="_blank">alistair23@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; On Mon, Sep 23, 2019 at 7:11 PM Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Mon, Sep 23, 2019 at 6:39 PM Alistair Francis<br>
&gt; &gt; &gt; &lt;<a href="mailto:Alistair.Francis@wdc.com" target="_blank">Alistair.Francis@wdc.com</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On Mon, 2019-09-23 at 17:59 -0700, Alistair Francis wrote:<br>
&gt; &gt; &gt; &gt; &gt; On Mon, Sep 23, 2019 at 3:40 PM Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt; wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; Alistair,<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; OE-core qemu upgrade to 4.1 has ended up with regressing musl/riscv<br>
&gt; &gt; &gt; &gt; &gt; &gt; port. I could pin point it to<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; <a href="https://git.openembedded.org/openembedded-core/commit/?id=50a7dec95618080962e56fd347f505e691b7ad6f" rel="noreferrer" target="_blank">https://git.openembedded.org/openembedded-core/commit/?id=50a7dec95618080962e56fd347f505e691b7ad6f</a><br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; it works fine with 4.0, I havent looked further<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; To reproduce<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; build<br>
&gt; &gt; &gt; &gt; &gt; &gt; MACHINE=qemuriscv64 TCLIBC=musl  bitbake core-image-minimal<br>
&gt; &gt; &gt; &gt; &gt; &gt; TCLIBC=musl runqemu nographic<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Thanks, I can reproduce this and am bisecting QEMU now.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; This QEMU patch causes the failure. It reverts cleanly on master and<br>
&gt; &gt; &gt; &gt; that fixes the issue:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; RISC-V: Clear load reservations on context switch and SC<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; This prevents a load reservation from being placed in one<br>
&gt; &gt; &gt; &gt; context/process,<br>
&gt; &gt; &gt; &gt; then being used in another, resulting in an SC succeeding incorrectly<br>
&gt; &gt; &gt; &gt; and<br>
&gt; &gt; &gt; &gt; breaking atomics.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Signed-off-by: Joel Sing &lt;<a href="mailto:joel@sing.id.au" target="_blank">joel@sing.id.au</a>&gt;<br>
&gt; &gt; &gt; &gt; Reviewed-by: Palmer Dabbelt &lt;<a href="mailto:palmer@sifive.com" target="_blank">palmer@sifive.com</a>&gt;<br>
&gt; &gt; &gt; &gt; Reviewed-by: Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org" target="_blank">richard.henderson@linaro.org</a>&gt;<br>
&gt; &gt; &gt; &gt; Signed-off-by: Palmer Dabbelt &lt;<a href="mailto:palmer@sifive.com" target="_blank">palmer@sifive.com</a>&gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; I&#39;ll investigate a full solution tomorrow, in the mean time do you want<br>
&gt; &gt; &gt; &gt; to just revert the patch?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; yes lets use the revert for now, this will give you enough time to<br>
&gt; &gt; &gt; investigate solution<br>
&gt; &gt; &gt; since its riscv specific it will be low risk and we can even go to 3.0<br>
&gt; &gt; &gt; release with it<br>
&gt; &gt;<br>
&gt; &gt; Do you want me to prepare a patch or do you want to do it?<br>
&gt; &gt;<br>
&gt; &gt; Alistair<br>
&gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Alistair<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Alistair<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; Thanks<br>
&gt; &gt; &gt; &gt; &gt; &gt; -Khem<br>
&gt; &gt; &gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; &gt; &gt; &gt; Openembedded-core mailing list<br>
&gt; &gt; &gt; &gt; &gt; &gt; <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
&gt; &gt; &gt; &gt; &gt; &gt; <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div></div>