System freezes when setting smp value to 54 or higher with qemu-system-riscv64
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- c
- Área
- embedded-iot
Línea de trabajo
Comienza con los cálculos de heap_size en platform/generic/platform.c y compara el comportamiento introducido por el commit 87aa3069d14b52bf87cb14d8f6b3ed51b45465ea. Ejecuta el comando qemu-system-riscv64 proporcionado con diferentes valores de smp e inspecciona dónde se detiene el arranque. Se considera terminado cuando el firmware arranca en U-Boot con las cantidades de CPU indicadas sin congelarse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C
- Estrellas
- 1.6k
- Forks
- 734
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de riscv-software-src/opensbi
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
riscv-software-src/opensbi#425 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
riscv-software-src/opensbi#424 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
riscv-software-src/opensbi#439 ·
-
sbi_trap_redirect() does not clear SPELP when the interrupted context had no landing pad expectedAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
riscv-software-src/opensbi#438 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
riscv-software-src/opensbi#436 · 3 comentarios ·
Todos los issues de riscv-software-src/opensbi
Issues similares
-
area/docdb kind/failing-test priority/medium status/awaiting-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
yugabyte/yugabyte-db#39462 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
libreswan/libreswan#3185 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
[SDL3pp] update to 0.12.0Abiertocategory:port-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días