LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 49611 - Need multiple errata workaround options for loongson
Summary: Need multiple errata workaround options for loongson
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: MIPS (show other bugs)
Version: trunk
Hardware: Other Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-17 01:26 PDT by Mingye Wang
Modified: 2021-03-17 01:49 PDT (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mingye Wang 2021-03-17 01:26:53 PDT
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].

  [1]: https://sourceware.org/legacy-ml/binutils/2009-11/msg00387.html

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]

  [2]: https://binutils.sourceware.narkive.com/dP1eQBrO/patch-mips-add-fix-for-loongson3-llsc-errata
Comment 1 Mingye Wang 2021-03-17 01:49:46 PDT
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.