[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-riscv] Atomic issues on riscv64

From: Marco Peereboom
Subject: [Qemu-riscv] Atomic issues on riscv64
Date: Thu, 16 May 2019 14:31:48 -0500

While porting Go (https://golang.org/) to riscv64 we ran into a couple of 
atomic issues.

At first we thought that they were go issues but we have narrowed at it down 
for it to be QEMU related. Basically atomics periodically fail and because it is
infrequent enough we wrote some test programs to bring them out quicker.

Either one of these test programs will bring out the failure:
* http://pastebitch.com/WaSP
* http://pastebitch.com/

You may have to run the programs more than once or play with TCOUNT and NCOUNT
for the issue to manifest itself. The programs will complain when the expected 
does not match the real value.

Success: ok 40000000 40000000
Failure: womp womp 39800640 40000000

These failures do *NOT* occur on `qemu-risc64` or on hardware (sifive unleashed 
They do occur in `qemu-system-riscv64` running Linux.

This was tested on `QEMU emulator version 3.1.94 (v4.0.0-rc4)`

Linux version 5.1.0-rc3-dirty (address@hidden) (gcc version 8.3.0 (GCC)) #1 SMP 
Thu Apr 11 15:18:36 CDT 2019

gcc inside qemu:
Using built-in specs.
Target: riscv64-redhat-linux
Configured with: ../configure --enable-bootstrap 
--enable-languages=c,c++,objc,obj-c++,fortran,lto --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared 
--enable-threads=posix --enable-checking=release --enable-multilib 
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions 
--enable-gnu-unique-object --enable-linker-build-id 
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin 
--enable-initfini-array --with-isl --disable-libmpx --build=riscv64-redhat-linux
Thread model: posix
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)

We did try gcc 8.3.0 as well but this one is the one I use more frequently.

Let me know if you need more data and any help figuring this out would be 

Attachment: signature.asc
Description: Message signed with OpenPGP

reply via email to

[Prev in Thread] Current Thread [Next in Thread]