System freezes when setting smp value to 54 or higher with qemu-system-riscv64
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- c
- Ambito
- embedded-iot
Direzione di ricerca
Inizia con i calcoli di heap_size in platform/generic/platform.c e confronta il comportamento introdotto dal commit 87aa3069d14b52bf87cb14d8f6b3ed51b45465ea. Esegui il comando qemu-system-riscv64 fornito con diversi valori di smp e verifica dove si arresta l’avvio. Il lavoro è completato quando il firmware esegue il boot fino a U-Boot con il numero di CPU indicato, senza bloccarsi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- C
- Stelle
- 1.6k
- Fork
- 734
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di riscv-software-src/opensbi
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
riscv-software-src/opensbi#425 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
riscv-software-src/opensbi#424 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
riscv-software-src/opensbi#439 ·
-
sbi_trap_redirect() does not clear SPELP when the interrupted context had no landing pad expectedAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 67/100
riscv-software-src/opensbi#438 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
riscv-software-src/opensbi#436 · 3 commenti ·
Tutte le issue di riscv-software-src/opensbi
Issue simili
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
yugabyte/yugabyte-db#39462 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
libreswan/libreswan#3185 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
[SDL3pp] update to 0.12.0Apertacategory:port-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni