mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -231,8 +231,8 @@ fn create_aia_node(fdt: &mut FdtWriter, aia_device: &Arc<Mutex<dyn Vaia>>) -> Fd
|
||||
fdt.property_u32("#interrupt-cells", 0u32)?;
|
||||
fdt.property_null("interrupt-controller")?;
|
||||
fdt.property_null("msi-controller")?;
|
||||
// TODO complete num-ids
|
||||
fdt.property_u32("riscv,num-ids", 2047u32)?;
|
||||
let imsic_num_ids = aia_device.lock().unwrap().imsic_num_ids();
|
||||
fdt.property_u32("riscv,num-ids", imsic_num_ids)?;
|
||||
fdt.property_u32("phandle", AIA_IMSIC_PHANDLE)?;
|
||||
|
||||
let mut irq_cells = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user