System freezes when setting smp value to 54 or higher with qemu-system-riscv64
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- c
- 領域
- embedded-iot
調査の方向性
platform/generic/platform.c の heap_size の計算から始め、コミット 87aa3069d14b52bf87cb14d8f6b3ed51b45465ea によって導入された動作と比較します。提供された qemu-system-riscv64 コマンドを異なる smp 値で実行し、ブートがどこで停止するかを調べます。報告された CPU 数でファームウェアがフリーズせずに U-Boot までブートすれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description:
When using qemu-system-riscv64 and setting the smp (symmetric multiprocessing) value to 54 or higher, the system freezes and is unable to properly boot into U-Boot. This issue appears to have been introduced in this commit: https://github.com/riscv-software-src/opensbi/commit/87aa3069d14b52bf87cb14d8f6b3ed51b45465ea . On the latest version, this problem still exists.
The root cause seems to be the addition of this line of code:
heap_size += 0x40 * (hart_count) * (hart_count);
After commenting out this line, it is possible to increase the smp value range, but the system still freezes when attempting to set smp to 72 or higher.
And here's some info on the variables. Here, heap_size(old) is used to represent the default value, and heap_size(new) is used to represent the added value, and return_size is the same as well.
| smp | 54 | 72 |
|---|---|---|
| heap_size(old) | 143360 | 180224 |
| return_size(old) | 143360 | 180224 |
| heap_size(new) | 329984 | 512000 |
| return_size(new) | 330752 | 512000 |
Test Command:
qemu-system-riscv64 -M virt -m 128G -smp 54 -nographic -bios build/platform/generic/firmware/fw_payload.bin
QEMU Log:
OpenSBI v1.3-140-g87aa306
Build time: 2024-04-26 15:58:14 +0800
Build compiler: gcc version 12.3.0 (Buildroot 2021.11-11272-ge2962af)
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : riscv-virtio,qemu
Platform Features : medeleg
Platform HART Count : 54
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 10000000Hz
Platform Console Device : uart8250
Platform HSM Device : ---
Platform PMU Device : ---
Platform Reboot Device : syscon-reboot
Platform Shutdown Device : syscon-poweroff
Platform Suspend Device : ---
Platform CPPC Device : ---
Firmware Base : 0x80000000
Firmware Size : 1035 KB
Firmware RW Offset : 0x40000
Firmware RW Size : 779 KB
Firmware Heap Offset : 0xb2000
Firmware Heap Size : 323 KB (total), 20 KB (reserved), 12 KB (used), 290 KB (free)
Firmware Scratch Size : 4096 B (total), 328 B (used), 3768 B (free)
Runtime SBI Version : 2.0
Domain0 Name : root
Domain0 Boot HART : 45
Domain0 HARTs : 0*,1*,2*,3*,4*,5*,6*,7*,8*,9*,10*,11*,12*,13*,14*,15*,16*,17*,18*,19*,20*,21*,22*,23*,24*,25*,26*,27*,28
*,29*,30*,31*,32*,33*,34*,35*,36*,37*,38*,39*,40*,41*,42*,43*,44*,45*,46*,47*,48*,49*,50*,51*,52*,53*
Domain0 Region00 : 0x0000000000100000-0x0000000000100fff M: (I,R,W) S/U: (R,W)
Domain0 Region01 : 0x0000000010000000-0x0000000010000fff M: (I,R,W) S/U: (R,W)
Domain0 Region02 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
Domain0 Region03 : 0x0000000080000000-0x000000008003ffff M: (R,X) S/U: ()
Domain0 Region04 : 0x0000000080000000-0x00000000801fffff M: (R,W) S/U: ()
Domain0 Region05 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
Domain0 Next Address : 0x0000000080200000
Domain0 Next Arg1 : 0x0000000082200000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Domain0 SysSuspend : yes
Boot HART ID : 45
Boot HART Domain : root
Boot HART Priv Version : v1.12
Boot HART Base ISA : rv64imafdch
Boot HART ISA Extensions : sstc,zicntr,zihpm
Boot HART PMP Count : 16
Boot HART PMP Granularity : 2 bits
Boot HART PMP Address Bits: 54
Boot HART MHPM Info : 16 (0x0007fff8)
Boot HART MIDELEG : 0x0000000000001666
Boot HART MEDELEG : 0x0000000000f0b509
And system freezes here.
Others Environment:
- U-Boot 2024.07-rc1-00069-gd097f9e129
- qemu-8.2.2-1.fc40
- 主要言語
- C
- スター
- 1.6k
- フォーク
- 734
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
riscv-software-src/opensbi のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
riscv-software-src/opensbi#425 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
riscv-software-src/opensbi#424 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
riscv-software-src/opensbi#439 ·
-
sbi_trap_redirect() does not clear SPELP when the interrupted context had no landing pad expectedオープン
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
riscv-software-src/opensbi#438 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
riscv-software-src/opensbi#436 · コメント 3 件 ·
riscv-software-src/opensbi の issue をすべて見る
似ている issue
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
yugabyte/yugabyte-db#39462 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libreswan/libreswan#3185 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信