Skip to contentSkip to conversation

roms/opensbi: Update to v1.7

PATCH In review Daniel Henrique Barboza 4 participants 8 messages Jul 23, 2025 – Sep 29, 2025 RISC-V

lore
Share & tools
lore
#0 lore raw

cover roms/opensbi: Update to v1.7

Hi,

It has been awhile since we last updated OpenSBI - we're still running v1.5.1, updated almost a year ago. We're missing out a lot of fixes and goodies (including SBI 3.0) from v1.6 and v1.7.

This update didn't trigger any regressions in our opensbi tests so I would like to update the roms for 10.1 to avoid yet another release with OpenSBI v1.5.1.

Please download the roms from:

https://gitlab.com/danielhb/qemu/-/tree/opensbi_update

Daniel Henrique Barboza (1):
roms/opensbi: Update to v1.7

 .../opensbi-riscv32-generic-fw_dynamic.bin    | Bin 268312 -> 268752 bytes
 .../opensbi-riscv64-generic-fw_dynamic.bin    | Bin 272504 -> 273048 bytes
 roms/opensbi                                  |   2 +-
 3 files changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.50.1
#1 lore raw

PATCH 1/1 roms/opensbi: Update to v1.7

Update OpenSBI and the pre-built opensbi32 and opensbi64 images to version 1.7.

It has been almost an year since we last updated OpenSBI (at the time, up to v1.5.1) and we're missing a lot of good stuff from both v1.6 and v1.7, including SBI 3.0 and RPMI 1.0.

The changelog is too large and tedious to post in the commit msg so I encourage referring to [1] and [2] to see the new features we're adding into the QEMU roms.

[1] https://github.com/riscv-software-src/opensbi/releases/tag/v1.6
[2] https://github.com/riscv-software-src/opensbi/releases/tag/v1.7

---
 .../opensbi-riscv32-generic-fw_dynamic.bin    | Bin 268312 -> 268752 bytes
 .../opensbi-riscv64-generic-fw_dynamic.bin    | Bin 272504 -> 273048 bytes
 roms/opensbi                                  |   2 +-
 3 files changed, 1 insertion(+), 1 deletion(-)
pc-bios/opensbi-riscv32-generic-fw_dynamic.bin binary +0 -0
index b2e740010b..02be3a72a8 100644
Binary files a/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin and b/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin differ
pc-bios/opensbi-riscv64-generic-fw_dynamic.bin binary +0 -0
index 018b4731a7..cce35c65c2 100644
Binary files a/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin and b/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin differ
roms/opensbi +1 -1
index 43cace6c36..a32a910691 160000
@@ -1 +1 @@
-Subproject commit 43cace6c3671e5172d0df0a8963e552bb04b7b20
+Subproject commit a32a91069119e7a5aa31e6bc51d5e00860be3d80
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#2 lore raw
Quoted 8 lines · Daniel Henrique Barboza

Update OpenSBI and the pre-built opensbi32 and opensbi64 images to version 1.7.

It has been almost an year since we last updated OpenSBI (at the time, up to v1.5.1) and we're missing a lot of good stuff from both v1.6 and v1.7, including SBI 3.0 and RPMI 1.0.

Quoted 8 lines

The changelog is too large and tedious to post in the commit msg so I encourage referring to [1] and [2] to see the new features we're adding into the QEMU roms.

[1] https://github.com/riscv-software-src/opensbi/releases/tag/v1.6
[2] https://github.com/riscv-software-src/opensbi/releases/tag/v1.7

Alistair

Quoted 23 lines
---
 .../opensbi-riscv32-generic-fw_dynamic.bin    | Bin 268312 -> 268752 bytes
 .../opensbi-riscv64-generic-fw_dynamic.bin    | Bin 272504 -> 273048 bytes
 roms/opensbi                                  |   2 +-
 3 files changed, 1 insertion(+), 1 deletion(-)
pc-bios/opensbi-riscv32-generic-fw_dynamic.bin binary +0 -0
index b2e740010b..02be3a72a8 100644
Binary files a/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin and b/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin differ
pc-bios/opensbi-riscv64-generic-fw_dynamic.bin binary +0 -0
index 018b4731a7..cce35c65c2 100644
Binary files a/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin and b/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin differ
roms/opensbi +1 -2
index 43cace6c36..a32a910691 160000
@@ -1 +1 @@
-Subproject commit 43cace6c3671e5172d0df0a8963e552bb04b7b20
+Subproject commit a32a91069119e7a5aa31e6bc51d5e00860be3d80
--

2.50.1

Reviewed-by
#3 lore raw
Quoted 15 lines · Alistair Francis
Quoted 12 lines · Daniel Henrique Barboza

Update OpenSBI and the pre-built opensbi32 and opensbi64 images to version 1.7.

It has been almost an year since we last updated OpenSBI (at the time, up to v1.5.1) and we're missing a lot of good stuff from both v1.6 and v1.7, including SBI 3.0 and RPMI 1.0.

The changelog is too large and tedious to post in the commit msg so I encourage referring to [1] and [2] to see the new features we're adding into the QEMU roms.

Quoted 6 lines
Quoted 4 lines

[1] https://github.com/riscv-software-src/opensbi/releases/tag/v1.6
[2] https://github.com/riscv-software-src/opensbi/releases/tag/v1.7

I noticed we have .gitlab-ci.d/opensbi.yml and .gitlab-ci.d/opensbi/Dockerfile. It looks like they are unused? Certainly the docker file looks out of date:

#
# Docker image to cross-compile OpenSBI firmware binaries #
FROM ubuntu:18.04
...

RUN wget -O - \
    https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.3.0/x86_64-gcc-8.3.0-nolibc-riscv32-linux.tar.xz

\
| tar -C /opt -xJ

Cheers,

Joel

#4 lore raw
In reply to Daniel Henrique Barboza
Quoted 33 lines · Daniel Henrique Barboza

Update OpenSBI and the pre-built opensbi32 and opensbi64 images to version 1.7.

It has been almost an year since we last updated OpenSBI (at the time, up to v1.5.1) and we're missing a lot of good stuff from both v1.6 and v1.7, including SBI 3.0 and RPMI 1.0.

The changelog is too large and tedious to post in the commit msg so I encourage referring to [1] and [2] to see the new features we're adding into the QEMU roms.

[1] https://github.com/riscv-software-src/opensbi/releases/tag/v1.6
[2] https://github.com/riscv-software-src/opensbi/releases/tag/v1.7

---
 .../opensbi-riscv32-generic-fw_dynamic.bin    | Bin 268312 -> 268752 bytes
 .../opensbi-riscv64-generic-fw_dynamic.bin    | Bin 272504 -> 273048 bytes
 roms/opensbi                                  |   2 +-
 3 files changed, 1 insertion(+), 1 deletion(-)
pc-bios/opensbi-riscv32-generic-fw_dynamic.bin binary +0 -0
index b2e740010b..02be3a72a8 100644
Binary files a/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin and b/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin differ
pc-bios/opensbi-riscv64-generic-fw_dynamic.bin binary +0 -0
index 018b4731a7..cce35c65c2 100644
Binary files a/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin and b/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin differ
roms/opensbi +0 -0
index 43cace6c36..a32a910691 160000

roms/opensbi line 1

Quoted 2 lines
roms/opensbi +1 -1
@@ -1 +1 @@
-Subproject commit 43cace6c3671e5172d0df0a8963e552bb04b7b20
+Subproject commit a32a91069119e7a5aa31e6bc51d5e00860be3d80

https://gitlab.com/qemu-project/opensbi needs to be updated, but I don't know how to do that...

Alistair

Quoted 4 lines

--
2.50.1

#5 lore raw
Quoted 24 lines · Alistair Francis
Quoted 22 lines · Daniel Henrique Barboza

Update OpenSBI and the pre-built opensbi32 and opensbi64 images to version 1.7.

It has been almost an year since we last updated OpenSBI (at the time, up to v1.5.1) and we're missing a lot of good stuff from both v1.6 and v1.7, including SBI 3.0 and RPMI 1.0.

The changelog is too large and tedious to post in the commit msg so I encourage referring to [1] and [2] to see the new features we're adding into the QEMU roms.

[1] https://github.com/riscv-software-src/opensbi/releases/tag/v1.6
[2] https://github.com/riscv-software-src/opensbi/releases/tag/v1.7

---
  .../opensbi-riscv32-generic-fw_dynamic.bin    | Bin 268312 -> 268752 bytes
  .../opensbi-riscv64-generic-fw_dynamic.bin    | Bin 272504 -> 273048 bytes
  roms/opensbi                                  |   2 +-
  3 files changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

roms/opensbi line 1

Quoted 13 lines
pc-bios/opensbi-riscv32-generic-fw_dynamic.bin binary +0 -0
index b2e740010b..02be3a72a8 100644
Binary files a/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin and b/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin differ
pc-bios/opensbi-riscv64-generic-fw_dynamic.bin binary +0 -0
index 018b4731a7..cce35c65c2 100644
Binary files a/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin and b/pc-bios/opensbi-riscv64-generic-fw_dynamic.bin differ
roms/opensbi +1 -1
index 43cace6c36..a32a910691 160000
@@ -1 +1 @@
-Subproject commit 43cace6c3671e5172d0df0a8963e552bb04b7b20
+Subproject commit a32a91069119e7a5aa31e6bc51d5e00860be3d80

https://gitlab.com/qemu-project/opensbi needs to be updated, but I don't know how to do that...

I don't think we need to do anything aside from upstreaming this patch. The roms/opensbi repo will just fetch the new subproject commit.

Note that this is a no-binary patch and can't be directly applied, so you'll need to cherry-pick from the repo I pointed in the commit msg. This is the commit:

https://gitlab.com/danielhb/qemu/-/commit/ad1292586b2ec3ceb836fb7e46982bfa19920d9f

And then:

$ git submodule update --init roms/opensbi
Submodule 'roms/opensbi' (https://gitlab.com/qemu-project/opensbi.git) registered for path 'roms/opensbi'
Submodule path 'roms/opensbi': checked out 'a32a91069119e7a5aa31e6bc51d5e00860be3d80'
$
$ cd roms/opensbi/
$ ls
CONTRIBUTORS.md  COPYING.BSD  docs  firmware  include  Kconfig  lib  Makefile  platform  README.md  scripts  ThirdPartyNotices.md
$
$ git log
commit a32a91069119e7a5aa31e6bc51d5e00860be3d80 (HEAD, tag: v1.7)
Author: Anup Patel <[email protected]>
Date:   Mon Jun 30 08:37:30 2025 +0530

include: Bump-up version to 1.7

Update the OpenSBI version to 1.7 as part of release preparation.

Note that 'git submodule' already used https://gitlab.com/qemu-project/opensbi.git to retrieve the commit we want. I don't think we need to do anything special w.r.t the submodule per se.

Thanks,

Daniel

Quoted 7 lines

Alistair

Quoted 4 lines

--
2.50.1

#6 lore raw

Hi Alistair,
I saw you requested access to the opensbi mirror repo on QEMU's GitLab project.

I went ahead and pushed the latest OpenSBI master branch to QEMU's mirror:
https://gitlab.com/qemu-project/opensbi/-/commits/master?ref_type=HEADS

The mirror got stuck because commit a2807646a858 ("include: Adjust Sscofpmf mhpmevent mask for upper 6 bits") is not present in the upstream repo. There was probably a force push upstream that replaced it with commit df997c6e55fe ("include: Adjust Sscofpmf mhpmevent mask for upper 8 bits"). The diff of the QEMU mirror commit and the upstream commit is:

include/sbi/riscv_encoding.h +1 -1
index 050674a..2ed05f2 100644
@@ -207,7 +207,7 @@
 
 #endif
 
-#define MHPMEVENT_SSCOF_MASK           _ULL(0xFC00000000000000)
+#define MHPMEVENT_SSCOF_MASK           _ULL(0xFF00000000000000)
 
 #define ENVCFG_STCE                    (_ULL(1) << 63)
 #define ENVCFG_PBMTE                   (_ULL(1) << 62)

I looked at the upstream discussion about the reserved bits and I guess that the author changed their mind and force pushed with an updated mask constant. I mention this because I came to the conclusion that there was nothing nefarious about the force push and that it's safe to update QEMU's mirror to follow upstream again.

Please let me know if you have any issues updating OpenSBI in QEMU and I can tweak the QEMU mirror repository as needed.

Thanks,
Stefan

#7 lore raw
Quoted 6 lines · Stefan Hajnoczi

Hi Alistair,
I saw you requested access to the opensbi mirror repo on QEMU's GitLab project.

I went ahead and pushed the latest OpenSBI master branch to QEMU's mirror:
https://gitlab.com/qemu-project/opensbi/-/commits/master?ref_type=HEADS

Awesome! Thanks for that

Quoted 22 lines

The mirror got stuck because commit a2807646a858 ("include: Adjust Sscofpmf mhpmevent mask for upper 6 bits") is not present in the upstream repo. There was probably a force push upstream that replaced it with commit df997c6e55fe ("include: Adjust Sscofpmf mhpmevent mask for upper 8 bits"). The diff of the QEMU mirror commit and the upstream commit is:

include/sbi/riscv_encoding.h +1 -1
index 050674a..2ed05f2 100644
@@ -207,7 +207,7 @@
 
 #endif
 
-#define MHPMEVENT_SSCOF_MASK           _ULL(0xFC00000000000000)
+#define MHPMEVENT_SSCOF_MASK           _ULL(0xFF00000000000000)
 
 #define ENVCFG_STCE                    (_ULL(1) << 63)
 #define ENVCFG_PBMTE                   (_ULL(1) << 62)
Quoted 5 lines

I looked at the upstream discussion about the reserved bits and I guess that the author changed their mind and force pushed with an updated mask constant. I mention this because I came to the conclusion that there was nothing nefarious about the force push and that it's safe to update QEMU's mirror to follow upstream again.

Thanks for digging into that, I agree that it seems like someone just wanted to correct a bit mask.

Alistair

Quoted 6 lines

Please let me know if you have any issues updating OpenSBI in QEMU and I can tweak the QEMU mirror repository as needed.

Thanks,
Stefan