[SRU] Update OpenSBI to 1.1

Bug #1995261 reported by Heinrich Schuchardt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
opensbi (Ubuntu)
Fix Released
Undecided
Heinrich Schuchardt
Jammy
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

We support boards with the Allwinner D1 SoC on Ubuntu Jammy.

Up to now we have officially launched a 22.04.1 image for the Nezha D1 board but with 22.04.2 we should also support the LicheeRV which is supported by 22.10.

The Allwinner D1 SoC does not implement the fence.tso instruction. This leads into crashes in programs like clang (cf. LP #1995080).

OpenSBI 1.1 provides an emulation of the instruction. But that emulation is broken in that results in an endless loop due to not incrementing the programm counter. This has been fixed in Lunar with LP #1995860.

The change for Kinetic is just adding the upstream patch fixing the endless loop.

For Jammy the change is an version upgrade plus the patch.

[ Test plan ]

* Rebuild current u-boot package in ppa against new OpenSBI and test running Ubuntu 22.04 on QEMU and on SiFive Hifive Unmatched with this U-Boot.
* Use a rebuilt u-boot-nezha package to boot the Nezha D1.
* Run clang --version on all mentioned platforms (This was the command the demonstrated the problem.)
* Run apt-get update, apt-get install, and executed an application.
* Run snap install and execute an application.

[ Where problems could occur ]

OpenSBI is only used directly when running a RISC-V emulation in QEMU.

For all real hardware we OpenSBI is build into U-Boot SPL. So getting OpenSBI onto the Nezha board will require a rebuild of U-Boot.

Theoretically upgrading OpenSBI could

* stop RISC-V boards from booting
* cause failures when the operating system calls into OpenSBI
* cause failures when OpenSBI emulates missing instructions.

[ Other Info ]

Upgrading to the same OpenSBI 1.1 that we use in Kinetic and Lunar instead of applying selected patches to 22.04 is easier to maintain in the long time.

OpenSBI 1.1 is the first release that is based on an officially approved version of the RISC-V SBI specification.

Changed in opensbi (Ubuntu):
assignee: nobody → Heinrich Schuchardt (xypron)
tags: added: foundations-todo
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "opensbi_1.0-3ubuntu1..1.1-1ubuntu0.22.04.1.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

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

We need to add patch 111afc12306e ("lib: sbi_illegal_insn: Fix FENCE.TSO emulation infinite trap loop") to avoid emulation of fence.tso on Nezha D1 hanging in an infinite loop.

Changed in opensbi (Ubuntu):
status: New → In Progress
summary: - [SRU] Copy OpenSBI 1.1 to Jammy
+ [SRU] Copy OpenSBI 1.1 to Jammy and Kinetic
description: updated
Benjamin Drung (bdrung)
summary: - [SRU] Copy OpenSBI 1.1 to Jammy and Kinetic
+ [SRU] Update OpenSBI to 1.1
Revision history for this message
Heinrich Schuchardt (xypron) wrote :
Revision history for this message
Benjamin Drung (bdrung) wrote :

Sponsored upload opensbi 1.1-0ubuntu0.22.04.1.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Heinrich, or anyone else affected,

Accepted opensbi into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/opensbi/1.1-0ubuntu0.22.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in opensbi (Ubuntu Jammy):
status: New → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Steve Langasek (vorlon) wrote :

I notice u-boot in jammy also has a build-dependency on opensbi.

Reverse-Build-Depends
* u-boot (for opensbi)
* u-boot-nezha (for opensbi)

I guess this is for u-boot-sifive.

But there's nothing in the test plan about making sure the new opensbi doesn't regress u-boot on rebuild. Can you please address this?

Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Heinrich, or anyone else affected,

Accepted u-boot-nezha into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/u-boot-nezha/2022.04+git20220405.7446a472-0ubuntu0.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

description: updated
description: updated
Revision history for this message
Heinrich Schuchardt (xypron) wrote (last edit ):

Tested OpenSBI 1.1-0ubuntu0.22.04.1 successfully on Jammy

I installed u-boot-nezha_2022.04+git20220405.7446a472-0ubuntu0.2_all.deb which is based on OpenSBI 1.1-0ubuntu0.22.04.1 both on a "Sipeed Lichee RV Dock" and a "Allwinner D1 Nezha".
Both boards boot successfully via GRUB into Ubuntu Jammy.
On both boards the command 'clang -v' executes successfully.
On both boards the command 'reboot' executes successfully.

I installed a U-Boot based on OpenSBI 1.1-0ubuntu0.22.04.1 on an Unmatched board.
The board boot successfully via GRUB into Ubuntu.
The command 'clang -v' executes successfully.
The command 'reboot' executes successfully.

I started a preinstalled Jammy image on QEMU using OpenSBI 1.1-0ubuntu0.22.04.1
The image boots successfully via GRUB into Ubuntu Jammy.
The command 'clang -v' executes successfully.
The command 'reboot' executes successfully.

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for u-boot-nezha has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package opensbi - 1.1-0ubuntu0.22.04.1

---------------
opensbi (1.1-0ubuntu0.22.04.1) jammy; urgency=medium

  * New upstream release (LP: #1995261)
  * Fix emulation of fence.tso hanging in endless loop on Allwinner D1
    d/p/lib-sbi_illegal_insn-Fix-FENCE.TSO-emulation-infinit.patch
    (LP: #1995860)
  * Dropping all other patches as they already integrated in the new source.

 -- Heinrich Schuchardt <email address hidden> Tue, 15 Nov 2022 17:10:37 +0100

Changed in opensbi (Ubuntu Jammy):
status: Fix Committed → Fix Released
Simon Quigley (tsimonq2)
Changed in opensbi (Ubuntu):
status: In Progress → 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

Remote bug watches

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