Implement multi-core emulation
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C
- スター
- 316
- フォーク
- 76
- 平均マージ
- 7時間 1分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/semu のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
Implement VirtIO PCI transport layer再び着手できるかも @shengwen-tw が 527 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
似ている issue
-
issue: bug report
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
BasedHardware/omi#26486 ·
メンテナーはふだん 1 日以内に返信
-
The LLVM object can build before collection_config.h is generated対応中かも @Vonng が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
aws/pgcollection#51 ·
-
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 日以内に返信