Incorrect AIA mtopi handling without an IMSIC
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- c
調査の方向性
まず、AIA サポートを有効にし、IMSIC と APLIC/PLIC を無効にして、legacy CLINT IPI を使用するローカル RVVM ブランチで障害を再現します。OpenSBI による未処理のローカル割り込みの処理と、mtopi/stopi と mtopei/stopei CSR の違いを追跡します。この構成でクラッシュが発生しなくなり、引き続き RISC-V AIA 仕様と整合していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The RISC-V AIA specification introduces a couple of new CSRs, and mandates that mtopei & stopei CSRs are ONLY present whenever there is AIA implemented, and an RISC-V IMSIC present in the system, but other CSRs may exist even without an IMSIC:
OpenSBI apparently assumes that IMSIC must be present whenever mtopi CSR is available instead of mtopei... and crashes whenever the guest uses legacy CLINT for IPI.
[ 0.103777] smp: Bringing up secondary CPUs ...
sbi_trap_error: hart0: trap0: unhandled local interrupt (error -1006)
sbi_trap_error: hart0: trap0: mcause=0x8000000000000003 mtval=0x0000000000000000
sbi_trap_error: hart0: trap0: mepc=0xffffffff80b4d2f8 mstatus=0x0000000a00000920
sbi_trap_error: hart0: trap0: ra=0xffffffff80b4d2ec sp=0xffffffc600003de0
sbi_trap_error: hart0: trap0: gp=0xffffffff82321198 tp=0xffffffff82325cc0
sbi_trap_error: hart0: trap0: s0=0xffffffc600003e10 s1=0xffffffff8235d3c8
sbi_trap_error: hart0: trap0: a0=0x000000000210f673 a1=0xffffffffffffffff
sbi_trap_error: hart0: trap0: a2=0x0000000000000015 a3=0x0000000000f5b338
sbi_trap_error: hart0: trap0: a4=0x0000000000000004 a5=0x000000000c800000
sbi_trap_error: hart0: trap0: a6=0x000000000200eeed a7=0xffffffff82786b60
sbi_trap_error: hart0: trap0: s2=0x0000000000000004 s3=0xffffffff8235d3c8
sbi_trap_error: hart0: trap0: s4=0x0000000000000000 s5=0x0000000000000000
sbi_trap_error: hart0: trap0: s6=0xffffffd602d50500 s7=0xffffffff80e00128
sbi_trap_error: hart0: trap0: s8=0x0000000000000000 s9=0x0000000000000001
sbi_trap_error: hart0: trap0: s10=0x0000000000000000 s11=0x0000000000000000
sbi_trap_error: hart0: trap0: t0=0x0000000000000040 t1=0x0000000000000000
sbi_trap_error: hart0: trap0: t2=0xffffffffffffffff t3=0x0000000000000002
sbi_trap_error: hart0: trap0: t4=0x0000000000000402 t5=0xffffffd602d53a68
sbi_trap_error: hart0: trap0: t6=0xffffffd602d53a70
This happens on a local RVVM branch that introduces RISC-V AIA support, and IMSIC+APLIC/PLIC supposed to be toggled, but AIA support in the CPU remains (That is, mtopi and stopi are still available, but mtopei / stopei are not).
Judging by the spec, it should be legal, but OpenSBI crashes unless I workaround it (By making mtopi unavailable too), so I think it is worth reporting.
- 主要言語
- 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 日以内に返信