llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.18k stars 12.04k forks source link

Need multiple errata workaround options for loongson #48955

Open a2e762de-e0a0-4eb0-a561-013d50c9a81e opened 3 years ago

a2e762de-e0a0-4eb0-a561-013d50c9a81e commented 3 years ago
Bugzilla Link 49611
Version trunk
OS Linux

Extended Description

Our distro at aosc.io builds packages for the MIPS64 loongson devices some of our users (and devs) have, but we cannot use Clang because many of the loongson errata are only fixed in GCC. We request LLVM to implement options to fix the following issues:

Loongson 2F

Loongson 2F has issues with its NOP and jump instructions. The hanging NOP one can affect userspace, while the deadlocking jump one can only affect kernel code. A description is found in 1.

Loongson 2F is an older model, but we do wish that our netbooks can use some proper Rust code.

Loongson 3 (LLSC)

Loongson 3 is the current generation of Loongson CPUs. It can run into a deadlock with ll/sc. The workaround involves putting a sync before ll and some other stuff with sc.2

a2e762de-e0a0-4eb0-a561-013d50c9a81e commented 3 years ago

For the sake of keeping things, uh, "clean room", I recommend not reading past the commit message for the first patch, and going straight to the last message for the second patch.