Implement multi-core emulation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- c
- Ambito
- backend, operating-systems
Direzione di ricerca
Start by reading the linked execution paths in main.c:2000-2025 and main.c:1713-1726, then review issue #145, which the issue says must be resolved first. The work spans hart execution, shared memory, interrupts, devices, and GDB, with smoke tests and performance comparisons; completion means parallel multi-hart execution works while single-hart mode remains performant.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Implement multi-core emulation
Support for virtio-gpu introduced a multithreaded model to semu, while the current SMP implementation uses coroutine-based cooperative multitasking. Guest Linux can see multiple harts, but on the host, these harts still take turns running in a single emulator thread (see main.c:2000-2025 and main.c:1713-1726).
Since we have only recently introduced multithreading, now would be a good time to design multi-core emulation. This would allow multiple harts to run in parallel on the host, using multiple processor cores to execute parallel guest workloads while preserving performance in single-hart mode. It would also make semu better suited to testing Linux's multiprocessor behavior and programs that require communication across harts.
The work would broadly include:
- Allow active harts to run on separate host threads, distinguish each hart's own state from state shared by the entire VM, and retain the single-hart execution model.
- Handle shared RAM access,
AMO,LR/SC, andFENCEso that parallel execution conforms to RISC-V memory semantics. - Adapt
HSM,IPI, andRFENCEto handle starting and stopping harts, notifications across harts, and remote synchronization. Interrupts, timers, andWFIwait and wakeup behavior also need to accommodate parallel execution. - Coordinate all harts and devices when pausing, resetting, or shutting down the VM, and allow GDB to inspect each hart, stop execution, and single-step.
- Establish basic smoke tests covering multi-hart boot, parallel workloads, notifications across harts, sleep and wakeup, and shutdown, and compare single-hart and multi-hart performance.
However, the current code architecture makes these changes difficult to implement, as discussed in #145. I think we can start implementing multi-core emulation once #145 is resolved.
- Lingua principale
- C
- Stelle
- 316
- Fork
- 76
- Merge medio
- 7h 1m
- PR unite (30g)
- 1
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 sysprog21/semu
-
Implement virtio-gpu 3DAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Implement VirtIO PCI transport layerForse di nuovo libera @shengwen-tw l’ha presa 527 giorni fa e non c’è nessuna pull request aperta. Aperta
Tutte le issue di sysprog21/semu
Issue simili
-
issue: bug report
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
BasedHardware/omi#26486 ·
I maintainer di solito rispondono entro 1 giorno
-
The LLVM object can build before collection_config.h is generatedForse già presa @Vonng l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
aws/pgcollection#51 ·
-
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