arch, hypervisor: Report KVM IMSIC interrupt IDs

The RISC-V AIA FDT node currently advertises a fixed riscv,num-ids
value. That can diverge from the interrupt identity count configured by
KVM, which matters for guests running with an emulated IMSIC.

Record the NR_IDS value reported by KVM and expose that value through
the generated device tree. Read back the KVM-selected AIA mode without
forcing an emulation mode.

Assisted-by: OpenAI-Codex:GPT-5

Signed-off-by: wangyf0611 <wangyufeng@iscas.ac.cn>
This commit is contained in:
wangyf0611
2026-05-21 15:47:53 +08:00
committed by Rob Bradford
parent 9c2e2a67cc
commit 649ca23345
3 changed files with 18 additions and 9 deletions

View File

@@ -46,6 +46,9 @@ pub trait Vaia: Send + Sync {
/// Returns an array with IMSIC device properties
fn imsic_properties(&self) -> [u32; 4];
/// Returns the number of IMSIC interrupt identities exposed to the guest
fn imsic_num_ids(&self) -> u32;
/// Returns the number of vCPUs this AIA handles
fn vcpu_count(&self) -> u32;