OpenSBI should emulate fence.tso for the D1 soc

Bug #1995080 reported by Alexandre Ghiti
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
llvm-defaults (Ubuntu)
Invalid
Undecided
Unassigned
opensbi (Ubuntu)
Fix Released
Undecided
Heinrich Schuchardt

Bug Description

[ Impact ]

As reported in https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1994071, clang triggers an illegal instruction trap and is killed after it tries to execute a fence.tso instruction. This is a known bug in the core of this soc, and a fix exists upstream which consists in emulating this instruction in opensbi.

[ Test Plan ]

Patch opensbi with both commits c919f684d95f ("lib: sbi_illegal_insn: Add emulation for fence.tso") and 51074432b233 ("lib: sbi_illegal_insn: Fix FENCE.TSO emulation infinite trap loop"), rebuild a u-boot-nezha package with this opensbi and install it on the nezha board. Finally reboot, and just execute the following command:

$ clang --version

Which should output the current clang version and not get killed.

[ Where problems could occur ]

This could break opensbi on all the RISC-V boards, even though the patches have been in upstream for a few months.

Revision history for this message
Alexandre Ghiti (alexghiti) wrote :

Please find attached a debdiff that was successfully tested on the Nezha board.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The patch is only needed for OpenSBI 1.0. In Kinetic we use OpenSBI 1.1.

It seems easier to just SRU OpenSBI 1.1 to Jammy and rebuild U-Boot.

tags: added: foundations-todo
Changed in opensbi (Ubuntu):
assignee: nobody → Heinrich Schuchardt (xypron)
Changed in llvm-defaults (Ubuntu):
status: New → Invalid
summary: - openSBI should emulate fence.tso for the D1 soc
+ OpenSBI should emulate fence.tso for the D1 soc
Changed in opensbi (Ubuntu):
status: New → Fix Released
Benjamin Drung (bdrung)
tags: removed: foundations-todo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.